Skip to content

Commit

Permalink
fix: gradle-tooling-api dependency is added to the target project (#51)
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
  • Loading branch information
manusa authored Jan 21, 2025
1 parent 554a520 commit 643e32a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/it/gradle-tooling-api/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals.1=verify
invoker.goals.1=verify dependency:tree
5 changes: 5 additions & 0 deletions src/it/gradle-tooling-api/verify.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import java.util.jar.JarFile

// Dependency is downloaded to the local Maven repository
def gradleToolingApiJar = new File(projectBuildDirectory,
"local-repo/org/gradle/gradle-tooling-api/${versionGradle8}/gradle-tooling-api-${versionGradle8}.jar")
assert gradleToolingApiJar.exists()
Expand All @@ -16,3 +17,7 @@ jar.entries().each {
}
assert containsManifest
assert containsGradleApi

// Project contains dependency to gradle-tooling-api (dependency:tree output)
def buildLog = new File(basedir, 'build.log').text
assert buildLog.contains('[INFO] +- org.gradle:gradle-tooling-api:jar:')
4 changes: 3 additions & 1 deletion src/main/java/com/marcnuri/plugins/gradle/api/GradleApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public final Collection<String> call() {
downloadDistribution();
downloadGradleToolingApi();
}
return extract();
final Set<String> artifactIds = extract();
artifactIds.add(GRADLE_TOOLING_API_ARTIFACT_ID);
return artifactIds;
}

private void downloadDistribution() {
Expand Down

0 comments on commit 643e32a

Please sign in to comment.