Skip to content

Apply binary compatibility plugin to Detekt - #3320

Merged
BraisGabin merged 5 commits into
detekt:masterfrom
picklebento:api
Dec 30, 2020
Merged

Apply binary compatibility plugin to Detekt#3320
BraisGabin merged 5 commits into
detekt:masterfrom
picklebento:api

Conversation

@picklebento

Copy link
Copy Markdown
Member

This will help catch API changes like discussed in #3310 (comment)
There is also a temporary workaround to exclude rootProject from compability check. See Kotlin/binary-compatibility-validator#32

When running ./gradlew build, if there is any change in :detekt-api, the task will fail with the following message

~/detekt(api*) » ./gradlew build  
> Task :detekt-api:apiCheck FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':detekt-api:apiCheck'.
> API check failed for project detekt-api.
  --- /Users/cazhang/detekt/detekt-api/api/detekt-api.api
  +++ /Users/cazhang/detekt/detekt-api/build/api/detekt-api.api
  @@ -315,17 +315,20 @@
   
   public final class io/gitlab/arturbosch/detekt/api/Location : io/gitlab/arturbosch/detekt/api/Compactable {
        public static final field Companion Lio/gitlab/arturbosch/detekt/api/Location$Companion;
  -     public fun <init> (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;)V
  +     public fun <init> (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/io/File;)V
  +     public synthetic fun <init> (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/io/File;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
        public fun <init> (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/lang/String;)V
        public fun compact ()Ljava/lang/String;
        public fun compactWithSignature ()Ljava/lang/String;
        public final fun component1 ()Lio/gitlab/arturbosch/detekt/api/SourceLocation;
        public final fun component2 ()Lio/gitlab/arturbosch/detekt/api/TextLocation;
        public final fun component3 ()Ljava/lang/String;
  -     public final fun copy (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;)Lio/gitlab/arturbosch/detekt/api/Location;
  -     public static synthetic fun copy$default (Lio/gitlab/arturbosch/detekt/api/Location;Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;ILjava/lang/Object;)Lio/gitlab/arturbosch/detekt/api/Location;
  +     public final fun component4 ()Ljava/io/File;
  +     public final fun copy (Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/io/File;)Lio/gitlab/arturbosch/detekt/api/Location;
  +     public static synthetic fun copy$default (Lio/gitlab/arturbosch/detekt/api/Location;Lio/gitlab/arturbosch/detekt/api/SourceLocation;Lio/gitlab/arturbosch/detekt/api/TextLocation;Ljava/lang/String;Ljava/io/File;ILjava/lang/Object;)Lio/gitlab/arturbosch/detekt/api/Location;
        public fun equals (Ljava/lang/Object;)Z
        public final fun getFile ()Ljava/lang/String;
  +     public final fun getFile2 ()Ljava/io/File;
        public final fun getSource ()Lio/gitlab/arturbosch/detekt/api/SourceLocation;
        public final fun getText ()Lio/gitlab/arturbosch/detekt/api/TextLocation;
        public fun hashCode ()I
  
   You can run :detekt-api:apiDump task to overwrite API declarations

@codecov

codecov Bot commented Dec 25, 2020

Copy link
Copy Markdown

Codecov Report

Merging #3320 (e31c46d) into master (0d6ac64) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3320   +/-   ##
=========================================
  Coverage     80.33%   80.33%           
  Complexity     2719     2719           
=========================================
  Files           445      445           
  Lines          8165     8165           
  Branches       1552     1552           
=========================================
  Hits           6559     6559           
  Misses          774      774           
  Partials        832      832           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d6ac64...e31c46d. Read the comment docs.

@BraisGabin BraisGabin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏻👏🏻👏🏻👏🏻

Comment thread build.gradle.kts
Comment thread build.gradle.kts
@picklebento

Copy link
Copy Markdown
Member Author

Is it possible to merge this PR already? The benefit of this PR overwhelms its temporary hack.

@BraisGabin
BraisGabin merged commit ff655d2 into detekt:master Dec 30, 2020
@picklebento
picklebento deleted the api branch December 30, 2020 21:21
picklebento pushed a commit to picklebento/detekt that referenced this pull request Dec 30, 2020
* Apply binary compatibility plugin to Detekt

* Exclude internal api

* Add an additional new line

* Fix comment to point out the problem in gradle setup

* Remove TODO as forbidden comment
@BraisGabin

BraisGabin commented Jan 4, 2021

Copy link
Copy Markdown
Member

I can't remove the workaround after I merge #3322 🤔. The issue is still there.

@picklebento

Copy link
Copy Markdown
Member Author

Let me open a new issue to further investigate.

arturbosch pushed a commit that referenced this pull request Jan 16, 2021
* Apply binary compatibility plugin to Detekt

* Exclude internal api

* Add an additional new line

* Fix comment to point out the problem in gradle setup

* Remove TODO as forbidden comment
@arturbosch arturbosch added this to the 1.16.0 milestone Jan 18, 2021
@arturbosch arturbosch added the housekeeping Marker for housekeeping tasks and refactorings label Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

housekeeping Marker for housekeeping tasks and refactorings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants