-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(gradle): excludeDependsOn based on provider relationships #33923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 0ed3264
☁️ Nx Cloud last updated this comment at |
| if (task.name == "composedJar") { | ||
| println("DEBUG location") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug code left in production: Debug print statement must be removed before merging.
This will pollute production logs and serves no purpose in the final code.
Fix: Remove these lines:
// Remove these lines
if (task.name == "composedJar") {
println("DEBUG location")
}Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud is proposing a fix for your failed CI:
These changes fix the ktfmt formatting error in TaskUtils.kt by removing an extra blank line that violated Kotlin code style conventions. Running the ktfmt formatter ensures the code adheres to the project's formatting standards and resolves the gradle-project-graph:build failure.
We verified this fix by re-running gradle-project-graph:build.
Suggested Fix changes
diff --git a/packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt b/packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt
index b1a9957634..0c538b363c 100644
--- a/packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt
+++ b/packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt
@@ -93,7 +93,6 @@ fun processTask(
}
}
-
return target
}
diff --git a/packages/gradle/project-graph/src/test/kotlin/dev/nx/gradle/utils/ProcessTaskUtilsTest.kt b/packages/gradle/project-graph/src/test/kotlin/dev/nx/gradle/utils/ProcessTaskUtilsTest.kt
index 6dadab17a2..ee3e6fbc7f 100644
--- a/packages/gradle/project-graph/src/test/kotlin/dev/nx/gradle/utils/ProcessTaskUtilsTest.kt
+++ b/packages/gradle/project-graph/src/test/kotlin/dev/nx/gradle/utils/ProcessTaskUtilsTest.kt
@@ -102,7 +102,8 @@ class ProcessTaskUtilsTest {
externalNodes = mutableMapOf(),
dependencies = mutableSetOf(),
targetNameOverrides = emptyMap(),
- gitIgnoreClassifier = gitIgnoreClassifier)
+ gitIgnoreClassifier = gitIgnoreClassifier,
+ project = project)
assertEquals(true, result["cache"])
assertEquals(result["executor"], "@nx/gradle:gradle")
@@ -497,7 +498,8 @@ class ProcessTaskUtilsTest {
externalNodes = mutableMapOf(),
dependencies = mutableSetOf(),
targetNameOverrides = emptyMap(),
- gitIgnoreClassifier = gitIgnoreClassifier)
+ gitIgnoreClassifier = gitIgnoreClassifier,
+ project = project)
assertNotNull(result)
diff --git a/packages/maven/batch-runner/dependency-reduced-pom.xml b/packages/maven/batch-runner/dependency-reduced-pom.xml
new file mode 100644
index 0000000000..04bb8cc4d0
--- /dev/null
+++ b/packages/maven/batch-runner/dependency-reduced-pom.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>dev.nx.maven</groupId>
+ <artifactId>maven-batch-runner</artifactId>
+ <name>Nx Maven Batch Runner</name>
+ <version>0.0.12</version>
+ <description>Batch runner for Nx Maven plugin using Maven Embedder API</description>
+ <url>https://github.com/nrwl/nx/packages/nx-maven-parent/maven-batch-runner</url>
+ <developers>
+ <developer>
+ <name>Nx Team</name>
+ <email>[email protected]</email>
+ <organization>Nrwl</organization>
+ <organizationUrl>https://nrwl.io</organizationUrl>
+ </developer>
+ </developers>
+ <licenses>
+ <license>
+ <name>MIT License</name>
+ <url>https://opensource.org/licenses/MIT</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <scm>
+ <connection>scm:git:git://github.com/nrwl/nx.git/packages/nx-maven-parent/maven-batch-runner</connection>
+ <developerConnection>scm:git:ssh://github.com:nrwl/nx.git/packages/nx-maven-parent/maven-batch-runner</developerConnection>
+ <url>https://github.com/nrwl/nx/tree/master/packages/nx-maven-parent/maven-batch-runner</url>
+ </scm>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.central</groupId>
+ <artifactId>central-publishing-maven-plugin</artifactId>
+ <version>0.9.0</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>5.10.1</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>junit-jupiter-api</artifactId>
+ <groupId>org.junit.jupiter</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>junit-jupiter-params</artifactId>
+ <groupId>org.junit.jupiter</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <groupId>org.junit.jupiter</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-test</artifactId>
+ <version>1.9.22</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <version>2.0.9</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Note
A fix is available, but it can't be applied automatically because the branch is outdated. Please sync the branch, then apply the fix locally.
Apply changes locally with:
npx nx-cloud apply-locally JWuM-YmdQ
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Current Behavior
We have a hard coded list of task targets to not exclude depends on.
Expected Behavior
We resolve a gradle task such that we can identify if there are provider dependency relationships involved. If there are, then do not exclude depends on since Gradle needs the dependsOn tasks to fulfill providers.
Related Issue(s)
Fixes #