Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit 88ffbba

Browse files
authored
Grab outgoing configuration artifacts instead of jar task output (#341)
revapi should now work seamlessly in projects that also apply `com.palantir.shadow-jar`
1 parent 2058c13 commit 88ffbba

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type: fix
2+
fix:
3+
description: revapi should now work seamlessly in projects that also apply `com.palantir.shadow-jar`
4+
links:
5+
- https://github.com/palantir/gradle-revapi/pull/341

src/main/java/com/palantir/gradle/revapi/RevapiPlugin.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ public void apply(Project project) {
7979

8080
task.getAcceptedBreaks().set(acceptedBreaks(project, configManager, extension.oldGroupAndName()));
8181

82-
FileCollection thisJarFile = project.getTasks()
83-
.withType(Jar.class)
84-
.getByName(JavaPlugin.JAR_TASK_NAME)
85-
.getOutputs()
82+
// we don't want to just grab the output of the 'jar' task, because peiple using
83+
// 'com.palantir.shadow-jar' actually publish the output of a different task: 'shadowJar'
84+
FileCollection thisJarFile = project.getConfigurations()
85+
.getByName(JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME)
86+
.getOutgoing()
87+
.getArtifacts()
8688
.getFiles();
8789

8890
FileCollection otherProjectsOutputs = revapiNewApiElements

0 commit comments

Comments
 (0)