- 
                Notifications
    You must be signed in to change notification settings 
- Fork 67
Support Java package-level annotations #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            6 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      31c81a0
              
                Support Java package-level annotations.
              
              
                fzhinkin 8183702
              
                Updated API dump
              
              
                fzhinkin c21115d
              
                Fixed paths to resources in tests
              
              
                fzhinkin 09ea3cf
              
                Use Path.walk API instead of walkFileTree
              
              
                fzhinkin 4ca3f0a
              
                Fixed a typo
              
              
                fzhinkin 4d4d8f1
              
                Filter out fake `package-info` classes
              
              
                fzhinkin File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            6 changes: 6 additions & 0 deletions
          
          6 
        
  src/functionalTest/resources/examples/classes/AnnotatedPackage.dump
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| public final class annotated/ClassFromAnnotatedPackage { | ||
| public fun <init> ()V | ||
| } | ||
|  | ||
| public abstract interface annotation class annotated/PackageAnnotation : java/lang/annotation/Annotation { | ||
| } | 
        
          
          
            9 changes: 9 additions & 0 deletions
          
          9 
        
  src/functionalTest/resources/examples/classes/ClassFromAnnotatedPackage.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * Copyright 2016-2024 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| package annotated | ||
|  | ||
| class ClassFromAnnotatedPackage { | ||
| } | 
        
          
          
            11 changes: 11 additions & 0 deletions
          
          11 
        
  src/functionalTest/resources/examples/classes/PackageAnnotation.java
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package annotated; | ||
|  | ||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|  | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Target(ElementType.PACKAGE) | ||
| public @interface PackageAnnotation { | ||
| } | 
        
          
          
            2 changes: 2 additions & 0 deletions
          
          2 
        
  src/functionalTest/resources/examples/classes/package-info.java
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| @PackageAnnotation | ||
| package annotated; | 
        
          
          
            8 changes: 8 additions & 0 deletions
          
          8 
        
  ...nctionalTest/resources/examples/gradle/configuration/nonPublicMarkers/packages.gradle.kts
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /* | ||
| * Copyright 2016-2024 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| configure<kotlinx.validation.ApiValidationExtension> { | ||
| nonPublicMarkers.add("annotated.PackageAnnotation") | ||
| } | 
        
          
          
            8 changes: 8 additions & 0 deletions
          
          8 
        
  src/functionalTest/resources/examples/gradle/configuration/publicMarkers/packages.gradle.kts
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /* | ||
| * Copyright 2016-2024 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| configure<kotlinx.validation.ApiValidationExtension> { | ||
| publicMarkers.add("annotated.PackageAnnotation") | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * Copyright 2016-2023 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| package cases.packageAnnotations | ||
|  | ||
| @PrivateApi | ||
| annotation class PrivateApi | 
        
          
          
            9 changes: 9 additions & 0 deletions
          
          9 
        
  src/test/kotlin/cases/packageAnnotations/a/a/ShouldBeDeleted.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * Copyright 2016-2023 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| package cases.packageAnnotations.a.a | ||
|  | ||
| public class ShouldBeDeleted { | ||
| } | 
        
          
          
            9 changes: 9 additions & 0 deletions
          
          9 
        
  src/test/kotlin/cases/packageAnnotations/a/b/ShouldBeDeleted.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * Copyright 2016-2023 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| package cases.packageAnnotations.a.b | ||
|  | ||
| public class ShouldBeDeleted { | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * Copyright 2016-2023 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| @PrivateApi | ||
| package cases.packageAnnotations.a; | ||
|  | ||
| import cases.packageAnnotations.PrivateApi; | 
        
          
          
            9 changes: 9 additions & 0 deletions
          
          9 
        
  src/test/kotlin/cases/packageAnnotations/b/a/ShouldBeDeleted.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * Copyright 2016-2023 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| package cases.packageAnnotations.b.a | ||
|  | ||
| public class ShouldBeDeleted { | ||
| } | 
        
          
          
            9 changes: 9 additions & 0 deletions
          
          9 
        
  src/test/kotlin/cases/packageAnnotations/b/a/package-info.java
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * Copyright 2016-2023 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| @PrivateApi @Deprecated | ||
| package cases.packageAnnotations.b.a; | ||
|  | ||
| import cases.packageAnnotations.PrivateApi; | 
        
          
          
            9 changes: 9 additions & 0 deletions
          
          9 
        
  src/test/kotlin/cases/packageAnnotations/b/b/ShouldRemainPublic.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * Copyright 2016-2023 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| package cases.packageAnnotations.b.b | ||
|  | ||
| public class ShouldRemainPublic { | ||
| } | 
        
          
          
            6 changes: 6 additions & 0 deletions
          
          6 
        
  src/test/kotlin/cases/packageAnnotations/b/b/package-info.java
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /* | ||
| * Copyright 2016-2023 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| package cases.packageAnnotations.b.b; | 
        
          
          
            14 changes: 14 additions & 0 deletions
          
          14 
        
  src/test/kotlin/cases/packageAnnotations/b/c/shouldRemainPublic.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* | ||
| * Copyright 2016-2024 JetBrains s.r.o. | ||
| * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
| */ | ||
|  | ||
| package cases.packageAnnotations.b.c | ||
|  | ||
| import cases.packageAnnotations.PrivateApi | ||
|  | ||
| @PrivateApi | ||
| interface `package-info` { | ||
| } | ||
|  | ||
| class ShouldNotBeRemoved | 
        
          
          
            8 changes: 8 additions & 0 deletions
          
          8 
        
  src/test/kotlin/cases/packageAnnotations/packageAnnotations.txt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| public final class cases/packageAnnotations/b/b/ShouldRemainPublic { | ||
| public fun <init> ()V | ||
| } | ||
|  | ||
| public final class cases/packageAnnotations/b/c/ShouldNotBeRemoved { | ||
| public fun <init> ()V | ||
| } | ||
|  | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.