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

Commit

Permalink
Grab outgoing configuration artifacts instead of jar task output (#341)
Browse files Browse the repository at this point in the history
revapi should now work seamlessly in projects that also apply `com.palantir.shadow-jar`
  • Loading branch information
iamdanfox authored Nov 26, 2020
1 parent 2058c13 commit 88ffbba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-341.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: revapi should now work seamlessly in projects that also apply `com.palantir.shadow-jar`
links:
- https://github.com/palantir/gradle-revapi/pull/341
10 changes: 6 additions & 4 deletions src/main/java/com/palantir/gradle/revapi/RevapiPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ public void apply(Project project) {

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

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

FileCollection otherProjectsOutputs = revapiNewApiElements
Expand Down

0 comments on commit 88ffbba

Please sign in to comment.