This repository was archived by the owner on Sep 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +48
-1
lines changed
test/groovy/com/palantir/gradle/revapi Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 1+ type : fix
2+ fix :
3+ description : Shaded classes placed in the top level `shadow` package are no longer
4+ identified as breaks (this makes `gradle-revapi` compatible with `gradle-shadow-jar`
5+ links :
6+ - https://github.com/palantir/gradle-revapi/pull/247
Original file line number Diff line number Diff line change 66 "filter" : {
77 "classes" : {
88 "regex" : true ,
9- "exclude" : [" .*\\ $$" ]
9+ "exclude" : [
10+ " .*\\ $$" ,
11+ " ^shadow.*"
12+ ]
1013 }
1114 }
1215 }
Original file line number Diff line number Diff line change @@ -814,6 +814,44 @@ class RevapiSpec extends IntegrationSpec {
814814 runTasksSuccessfully('revapi').wasExecuted('revapiAnalyze')
815815 }
816816
817+ def 'compatible with gradle-shadow-jar'() {
818+ when:
819+ rootProjectNameIs('root')
820+
821+ buildFile << """
822+ apply plugin: '${TestConstants.PLUGIN_NAME}'
823+ apply plugin: 'java'
824+ apply plugin: 'maven-publish'
825+
826+ allprojects {
827+ group = 'revapi.test'
828+ ${mavenRepoGradle()}
829+ }
830+
831+ version = '1.0.0'
832+
833+ revapi {
834+ oldVersion = project.version
835+ }
836+
837+ ${testMavenPublication()}
838+ """
839+
840+ def shadowedClass = 'src/main/java/shadow/com/palantir/foo/Bar.java'
841+ writeToFile shadowedClass, '''
842+ package shadow. com. palantir. foo;
843+ public class Bar {}
844+ ''' .stripIndent()
845+
846+ and:
847+ println runTasksSuccessfully('publish').standardOutput
848+
849+ file(shadowedClass).delete()
850+
851+ then:
852+ println runTasksSuccessfully('revapi').standardOutput
853+ }
854+
817855 @RestoreSystemProperties
818856 def 'breaks detected in conjure projects should be limited to those which break java but are not caught by conjure-backcompat'() {
819857 when:
You can’t perform that action at this time.
0 commit comments