diff --git a/docs/shared/tutorials/gradle-pdv.json b/docs/shared/tutorials/gradle-pdv.json index 0733a851966bf..63a3c9472cbe7 100644 --- a/docs/shared/tutorials/gradle-pdv.json +++ b/docs/shared/tutorials/gradle-pdv.json @@ -22,7 +22,6 @@ "resolveTestMainClassName", "testClasses" ], - "Custom": ["mytask"], "Documentation": ["javadoc"], "Help": [ "buildEnvironment", @@ -44,372 +43,331 @@ }, "targets": { "bootRun": { - "options": { - "cwd": "application", - "command": "../gradlew bootRun" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:bootRun" + }, "configurations": {} }, "bootTestRun": { - "options": { - "cwd": "application", - "command": "../gradlew bootTestRun" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:bootTestRun" + }, "configurations": {} }, "assemble": { - "options": { - "cwd": "application", - "command": "../gradlew assemble" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:assemble" + }, "configurations": {} }, "bootBuildImage": { - "options": { - "cwd": "application", - "command": "../gradlew bootBuildImage" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:bootBuildImage" + }, "configurations": {} }, "bootJar": { - "options": { - "cwd": "application", - "command": "../gradlew bootJar" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:bootJar" + }, "configurations": {} }, "build": { - "options": { - "cwd": "application", - "command": "../gradlew build" - }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["production", "^production"], "outputs": ["{workspaceRoot}/application/build"], "dependsOn": ["^build", "classes"], "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:build" + }, "configurations": {} }, "buildDependents": { - "options": { - "cwd": "application", - "command": "../gradlew buildDependents" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:buildDependents" + }, "configurations": {} }, "buildNeeded": { - "options": { - "cwd": "application", - "command": "../gradlew buildNeeded" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:buildNeeded" + }, "configurations": {} }, "classes": { - "options": { - "cwd": "application", - "command": "../gradlew classes" - }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["production", "^production"], "outputs": ["{workspaceRoot}/application/build/classes"], "dependsOn": ["^classes"], "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:classes" + }, "configurations": {} }, "clean": { - "options": { - "cwd": "application", - "command": "../gradlew clean" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:clean" + }, "configurations": {} }, "jar": { - "options": { - "cwd": "application", - "command": "../gradlew jar" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:jar" + }, "configurations": {} }, "resolveMainClassName": { - "options": { - "cwd": "application", - "command": "../gradlew resolveMainClassName" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:resolveMainClassName" + }, "configurations": {} }, "resolveTestMainClassName": { - "options": { - "cwd": "application", - "command": "../gradlew resolveTestMainClassName" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:resolveTestMainClassName" + }, "configurations": {} }, "testClasses": { - "options": { - "cwd": "application", - "command": "../gradlew testClasses" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", - "configurations": {} - }, - "mytask": { "options": { - "cwd": "application", - "command": "../gradlew mytask" + "command": "./gradlew :application:testClasses" }, - "cache": false, - "metadata": { - "technologies": ["gradle"] - }, - "executor": "nx:run-commands", "configurations": {} }, "javadoc": { - "options": { - "cwd": "application", - "command": "../gradlew javadoc" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:javadoc" + }, "configurations": {} }, "buildEnvironment": { - "options": { - "cwd": "application", - "command": "../gradlew buildEnvironment" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:buildEnvironment" + }, "configurations": {} }, "dependencies": { - "options": { - "cwd": "application", - "command": "../gradlew dependencies" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:dependencies" + }, "configurations": {} }, "dependencyInsight": { - "options": { - "cwd": "application", - "command": "../gradlew dependencyInsight" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:dependencyInsight" + }, "configurations": {} }, "dependencyManagement": { - "options": { - "cwd": "application", - "command": "../gradlew dependencyManagement" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:dependencyManagement" + }, "configurations": {} }, "help": { - "options": { - "cwd": "application", - "command": "../gradlew help" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:help" + }, "configurations": {} }, "javaToolchains": { - "options": { - "cwd": "application", - "command": "../gradlew javaToolchains" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:javaToolchains" + }, "configurations": {} }, "outgoingVariants": { - "options": { - "cwd": "application", - "command": "../gradlew outgoingVariants" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:outgoingVariants" + }, "configurations": {} }, "projects": { - "options": { - "cwd": "application", - "command": "../gradlew projects" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:projects" + }, "configurations": {} }, "properties": { - "options": { - "cwd": "application", - "command": "../gradlew properties" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:properties" + }, "configurations": {} }, "resolvableConfigurations": { - "options": { - "cwd": "application", - "command": "../gradlew resolvableConfigurations" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:resolvableConfigurations" + }, "configurations": {} }, "tasks": { - "options": { - "cwd": "application", - "command": "../gradlew tasks" - }, "cache": false, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:tasks" + }, "configurations": {} }, "projectReport": { - "options": { - "cwd": "application", - "command": "../gradlew projectReport" - }, "cache": false, "outputs": ["{workspaceRoot}/application/build/reports/project"], "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:projectReport" + }, "configurations": {} }, "check": { - "options": { - "cwd": "application", - "command": "../gradlew check" - }, "cache": true, "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:check" + }, "configurations": {} }, "test": { - "options": { - "cwd": "application", - "command": "../gradlew test" - }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["default", "^production"], "dependsOn": ["classes"], "metadata": { "technologies": ["gradle"] }, "executor": "nx:run-commands", + "options": { + "command": "./gradlew :application:test" + }, "configurations": {} } }, @@ -420,53 +378,142 @@ "sourceMap": { "root": ["application/build.gradle", "@nx/gradle"], "name": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Application": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Application.0": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Application.1": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Build": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.0": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.1": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.2": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.3": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.4": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.5": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.6": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.7": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.8": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.9": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Build.10": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Build.11": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Documentation": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Documentation.0": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Help": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.0": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.1": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.2": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.3": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.4": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.5": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.6": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.7": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.8": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.9": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Help.10": ["application/build.gradle", "@nx/gradle"], + "metadata.targetGroups.Reporting": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Reporting.0": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Verification": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Verification.0": [ + "application/build.gradle", + "@nx/gradle" + ], + "metadata.targetGroups.Verification.1": [ + "application/build.gradle", + "@nx/gradle" + ], "metadata.technologies": ["application/build.gradle", "@nx/gradle"], "metadata.technologies.0": ["application/build.gradle", "@nx/gradle"], "targets": ["application/build.gradle", "@nx/gradle"], "targets.bootRun": ["application/build.gradle", "@nx/gradle"], - "targets.bootRun.options": ["application/build.gradle", "@nx/gradle"], "targets.bootRun.cache": ["application/build.gradle", "@nx/gradle"], "targets.bootRun.inputs": ["application/build.gradle", "@nx/gradle"], "targets.bootRun.outputs": ["application/build.gradle", "@nx/gradle"], "targets.bootRun.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.bootRun.metadata": ["application/build.gradle", "@nx/gradle"], "targets.bootRun.executor": ["application/build.gradle", "@nx/gradle"], - "targets.bootRun.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.bootRun.options": ["application/build.gradle", "@nx/gradle"], "targets.bootRun.options.command": [ "application/build.gradle", "@nx/gradle" ], + "targets.bootRun.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.bootRun.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.bootTestRun": ["application/build.gradle", "@nx/gradle"], - "targets.bootTestRun.options": ["application/build.gradle", "@nx/gradle"], "targets.bootTestRun.cache": ["application/build.gradle", "@nx/gradle"], "targets.bootTestRun.inputs": ["application/build.gradle", "@nx/gradle"], "targets.bootTestRun.outputs": ["application/build.gradle", "@nx/gradle"], "targets.bootTestRun.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.bootTestRun.metadata": ["application/build.gradle", "@nx/gradle"], "targets.bootTestRun.executor": ["application/build.gradle", "@nx/gradle"], - "targets.bootTestRun.options.cwd": [ + "targets.bootTestRun.options": ["application/build.gradle", "@nx/gradle"], + "targets.bootTestRun.options.command": [ "application/build.gradle", "@nx/gradle" ], - "targets.bootTestRun.options.command": [ + "targets.bootTestRun.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.bootTestRun.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], "targets.assemble": ["application/build.gradle", "@nx/gradle"], - "targets.assemble.options": ["application/build.gradle", "@nx/gradle"], "targets.assemble.cache": ["application/build.gradle", "@nx/gradle"], "targets.assemble.inputs": ["application/build.gradle", "@nx/gradle"], "targets.assemble.outputs": ["application/build.gradle", "@nx/gradle"], "targets.assemble.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.assemble.metadata": ["application/build.gradle", "@nx/gradle"], "targets.assemble.executor": ["application/build.gradle", "@nx/gradle"], - "targets.assemble.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.assemble.options": ["application/build.gradle", "@nx/gradle"], "targets.assemble.options.command": [ "application/build.gradle", "@nx/gradle" ], - "targets.bootBuildImage": ["application/build.gradle", "@nx/gradle"], - "targets.bootBuildImage.options": [ + "targets.assemble.metadata.technologies": [ "application/build.gradle", "@nx/gradle" ], + "targets.assemble.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.bootBuildImage": ["application/build.gradle", "@nx/gradle"], "targets.bootBuildImage.cache": ["application/build.gradle", "@nx/gradle"], "targets.bootBuildImage.inputs": ["application/build.gradle", "@nx/gradle"], "targets.bootBuildImage.outputs": [ @@ -477,11 +524,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.bootBuildImage.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.bootBuildImage.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.bootBuildImage.options.cwd": [ + "targets.bootBuildImage.options": [ "application/build.gradle", "@nx/gradle" ], @@ -489,32 +540,52 @@ "application/build.gradle", "@nx/gradle" ], + "targets.bootBuildImage.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.bootBuildImage.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.bootJar": ["application/build.gradle", "@nx/gradle"], - "targets.bootJar.options": ["application/build.gradle", "@nx/gradle"], "targets.bootJar.cache": ["application/build.gradle", "@nx/gradle"], "targets.bootJar.inputs": ["application/build.gradle", "@nx/gradle"], "targets.bootJar.outputs": ["application/build.gradle", "@nx/gradle"], "targets.bootJar.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.bootJar.metadata": ["application/build.gradle", "@nx/gradle"], "targets.bootJar.executor": ["application/build.gradle", "@nx/gradle"], - "targets.bootJar.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.bootJar.options": ["application/build.gradle", "@nx/gradle"], "targets.bootJar.options.command": [ "application/build.gradle", "@nx/gradle" ], + "targets.bootJar.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.bootJar.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.build": ["application/build.gradle", "@nx/gradle"], - "targets.build.options": ["application/build.gradle", "@nx/gradle"], "targets.build.cache": ["application/build.gradle", "@nx/gradle"], "targets.build.inputs": ["application/build.gradle", "@nx/gradle"], "targets.build.outputs": ["application/build.gradle", "@nx/gradle"], "targets.build.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.build.metadata": ["application/build.gradle", "@nx/gradle"], "targets.build.executor": ["application/build.gradle", "@nx/gradle"], - "targets.build.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.build.options": ["application/build.gradle", "@nx/gradle"], "targets.build.options.command": ["application/build.gradle", "@nx/gradle"], - "targets.buildDependents": ["application/build.gradle", "@nx/gradle"], - "targets.buildDependents.options": [ + "targets.build.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.build.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], + "targets.buildDependents": ["application/build.gradle", "@nx/gradle"], "targets.buildDependents.cache": ["application/build.gradle", "@nx/gradle"], "targets.buildDependents.inputs": [ "application/build.gradle", @@ -528,11 +599,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.buildDependents.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.buildDependents.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.buildDependents.options.cwd": [ + "targets.buildDependents.options": [ "application/build.gradle", "@nx/gradle" ], @@ -540,56 +615,89 @@ "application/build.gradle", "@nx/gradle" ], + "targets.buildDependents.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.buildDependents.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.buildNeeded": ["application/build.gradle", "@nx/gradle"], - "targets.buildNeeded.options": ["application/build.gradle", "@nx/gradle"], "targets.buildNeeded.cache": ["application/build.gradle", "@nx/gradle"], "targets.buildNeeded.inputs": ["application/build.gradle", "@nx/gradle"], "targets.buildNeeded.outputs": ["application/build.gradle", "@nx/gradle"], "targets.buildNeeded.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.buildNeeded.metadata": ["application/build.gradle", "@nx/gradle"], "targets.buildNeeded.executor": ["application/build.gradle", "@nx/gradle"], - "targets.buildNeeded.options.cwd": [ + "targets.buildNeeded.options": ["application/build.gradle", "@nx/gradle"], + "targets.buildNeeded.options.command": [ "application/build.gradle", "@nx/gradle" ], - "targets.buildNeeded.options.command": [ + "targets.buildNeeded.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.buildNeeded.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], "targets.classes": ["application/build.gradle", "@nx/gradle"], - "targets.classes.options": ["application/build.gradle", "@nx/gradle"], "targets.classes.cache": ["application/build.gradle", "@nx/gradle"], "targets.classes.inputs": ["application/build.gradle", "@nx/gradle"], "targets.classes.outputs": ["application/build.gradle", "@nx/gradle"], "targets.classes.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.classes.metadata": ["application/build.gradle", "@nx/gradle"], "targets.classes.executor": ["application/build.gradle", "@nx/gradle"], - "targets.classes.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.classes.options": ["application/build.gradle", "@nx/gradle"], "targets.classes.options.command": [ "application/build.gradle", "@nx/gradle" ], + "targets.classes.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.classes.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.clean": ["application/build.gradle", "@nx/gradle"], - "targets.clean.options": ["application/build.gradle", "@nx/gradle"], "targets.clean.cache": ["application/build.gradle", "@nx/gradle"], "targets.clean.inputs": ["application/build.gradle", "@nx/gradle"], "targets.clean.outputs": ["application/build.gradle", "@nx/gradle"], "targets.clean.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.clean.metadata": ["application/build.gradle", "@nx/gradle"], "targets.clean.executor": ["application/build.gradle", "@nx/gradle"], - "targets.clean.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.clean.options": ["application/build.gradle", "@nx/gradle"], "targets.clean.options.command": ["application/build.gradle", "@nx/gradle"], + "targets.clean.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.clean.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.jar": ["application/build.gradle", "@nx/gradle"], - "targets.jar.options": ["application/build.gradle", "@nx/gradle"], "targets.jar.cache": ["application/build.gradle", "@nx/gradle"], "targets.jar.inputs": ["application/build.gradle", "@nx/gradle"], "targets.jar.outputs": ["application/build.gradle", "@nx/gradle"], "targets.jar.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.jar.metadata": ["application/build.gradle", "@nx/gradle"], "targets.jar.executor": ["application/build.gradle", "@nx/gradle"], - "targets.jar.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.jar.options": ["application/build.gradle", "@nx/gradle"], "targets.jar.options.command": ["application/build.gradle", "@nx/gradle"], - "targets.resolveMainClassName": ["application/build.gradle", "@nx/gradle"], - "targets.resolveMainClassName.options": [ + "targets.jar.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.jar.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], + "targets.resolveMainClassName": ["application/build.gradle", "@nx/gradle"], "targets.resolveMainClassName.cache": [ "application/build.gradle", "@nx/gradle" @@ -606,11 +714,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.resolveMainClassName.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.resolveMainClassName.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.resolveMainClassName.options.cwd": [ + "targets.resolveMainClassName.options": [ "application/build.gradle", "@nx/gradle" ], @@ -618,11 +730,15 @@ "application/build.gradle", "@nx/gradle" ], - "targets.resolveTestMainClassName": [ + "targets.resolveMainClassName.metadata.technologies": [ "application/build.gradle", "@nx/gradle" ], - "targets.resolveTestMainClassName.options": [ + "targets.resolveMainClassName.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.resolveTestMainClassName": [ "application/build.gradle", "@nx/gradle" ], @@ -642,11 +758,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.resolveTestMainClassName.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.resolveTestMainClassName.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.resolveTestMainClassName.options.cwd": [ + "targets.resolveTestMainClassName.options": [ "application/build.gradle", "@nx/gradle" ], @@ -654,50 +774,55 @@ "application/build.gradle", "@nx/gradle" ], + "targets.resolveTestMainClassName.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.resolveTestMainClassName.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.testClasses": ["application/build.gradle", "@nx/gradle"], - "targets.testClasses.options": ["application/build.gradle", "@nx/gradle"], "targets.testClasses.cache": ["application/build.gradle", "@nx/gradle"], "targets.testClasses.inputs": ["application/build.gradle", "@nx/gradle"], "targets.testClasses.outputs": ["application/build.gradle", "@nx/gradle"], "targets.testClasses.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.testClasses.metadata": ["application/build.gradle", "@nx/gradle"], "targets.testClasses.executor": ["application/build.gradle", "@nx/gradle"], - "targets.testClasses.options.cwd": [ + "targets.testClasses.options": ["application/build.gradle", "@nx/gradle"], + "targets.testClasses.options.command": [ "application/build.gradle", "@nx/gradle" ], - "targets.testClasses.options.command": [ + "targets.testClasses.metadata.technologies": [ "application/build.gradle", "@nx/gradle" ], - "targets.mytask": ["application/build.gradle", "@nx/gradle"], - "targets.mytask.options": ["application/build.gradle", "@nx/gradle"], - "targets.mytask.cache": ["application/build.gradle", "@nx/gradle"], - "targets.mytask.inputs": ["application/build.gradle", "@nx/gradle"], - "targets.mytask.outputs": ["application/build.gradle", "@nx/gradle"], - "targets.mytask.dependsOn": ["application/build.gradle", "@nx/gradle"], - "targets.mytask.executor": ["application/build.gradle", "@nx/gradle"], - "targets.mytask.options.cwd": ["application/build.gradle", "@nx/gradle"], - "targets.mytask.options.command": [ + "targets.testClasses.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], "targets.javadoc": ["application/build.gradle", "@nx/gradle"], - "targets.javadoc.options": ["application/build.gradle", "@nx/gradle"], "targets.javadoc.cache": ["application/build.gradle", "@nx/gradle"], "targets.javadoc.inputs": ["application/build.gradle", "@nx/gradle"], "targets.javadoc.outputs": ["application/build.gradle", "@nx/gradle"], "targets.javadoc.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.javadoc.metadata": ["application/build.gradle", "@nx/gradle"], "targets.javadoc.executor": ["application/build.gradle", "@nx/gradle"], - "targets.javadoc.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.javadoc.options": ["application/build.gradle", "@nx/gradle"], "targets.javadoc.options.command": [ "application/build.gradle", "@nx/gradle" ], - "targets.buildEnvironment": ["application/build.gradle", "@nx/gradle"], - "targets.buildEnvironment.options": [ + "targets.javadoc.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.javadoc.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], + "targets.buildEnvironment": ["application/build.gradle", "@nx/gradle"], "targets.buildEnvironment.cache": [ "application/build.gradle", "@nx/gradle" @@ -714,11 +839,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.buildEnvironment.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.buildEnvironment.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.buildEnvironment.options.cwd": [ + "targets.buildEnvironment.options": [ "application/build.gradle", "@nx/gradle" ], @@ -726,8 +855,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.buildEnvironment.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.buildEnvironment.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.dependencies": ["application/build.gradle", "@nx/gradle"], - "targets.dependencies.options": ["application/build.gradle", "@nx/gradle"], "targets.dependencies.cache": ["application/build.gradle", "@nx/gradle"], "targets.dependencies.inputs": ["application/build.gradle", "@nx/gradle"], "targets.dependencies.outputs": ["application/build.gradle", "@nx/gradle"], @@ -735,20 +871,22 @@ "application/build.gradle", "@nx/gradle" ], + "targets.dependencies.metadata": ["application/build.gradle", "@nx/gradle"], "targets.dependencies.executor": ["application/build.gradle", "@nx/gradle"], - "targets.dependencies.options.cwd": [ + "targets.dependencies.options": ["application/build.gradle", "@nx/gradle"], + "targets.dependencies.options.command": [ "application/build.gradle", "@nx/gradle" ], - "targets.dependencies.options.command": [ + "targets.dependencies.metadata.technologies": [ "application/build.gradle", "@nx/gradle" ], - "targets.dependencyInsight": ["application/build.gradle", "@nx/gradle"], - "targets.dependencyInsight.options": [ + "targets.dependencies.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], + "targets.dependencyInsight": ["application/build.gradle", "@nx/gradle"], "targets.dependencyInsight.cache": [ "application/build.gradle", "@nx/gradle" @@ -765,11 +903,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.dependencyInsight.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.dependencyInsight.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.dependencyInsight.options.cwd": [ + "targets.dependencyInsight.options": [ "application/build.gradle", "@nx/gradle" ], @@ -777,11 +919,15 @@ "application/build.gradle", "@nx/gradle" ], - "targets.dependencyManagement": ["application/build.gradle", "@nx/gradle"], - "targets.dependencyManagement.options": [ + "targets.dependencyInsight.metadata.technologies": [ "application/build.gradle", "@nx/gradle" ], + "targets.dependencyInsight.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.dependencyManagement": ["application/build.gradle", "@nx/gradle"], "targets.dependencyManagement.cache": [ "application/build.gradle", "@nx/gradle" @@ -798,11 +944,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.dependencyManagement.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.dependencyManagement.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.dependencyManagement.options.cwd": [ + "targets.dependencyManagement.options": [ "application/build.gradle", "@nx/gradle" ], @@ -810,20 +960,32 @@ "application/build.gradle", "@nx/gradle" ], + "targets.dependencyManagement.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.dependencyManagement.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.help": ["application/build.gradle", "@nx/gradle"], - "targets.help.options": ["application/build.gradle", "@nx/gradle"], "targets.help.cache": ["application/build.gradle", "@nx/gradle"], "targets.help.inputs": ["application/build.gradle", "@nx/gradle"], "targets.help.outputs": ["application/build.gradle", "@nx/gradle"], "targets.help.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.help.metadata": ["application/build.gradle", "@nx/gradle"], "targets.help.executor": ["application/build.gradle", "@nx/gradle"], - "targets.help.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.help.options": ["application/build.gradle", "@nx/gradle"], "targets.help.options.command": ["application/build.gradle", "@nx/gradle"], - "targets.javaToolchains": ["application/build.gradle", "@nx/gradle"], - "targets.javaToolchains.options": [ + "targets.help.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.help.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], + "targets.javaToolchains": ["application/build.gradle", "@nx/gradle"], "targets.javaToolchains.cache": ["application/build.gradle", "@nx/gradle"], "targets.javaToolchains.inputs": ["application/build.gradle", "@nx/gradle"], "targets.javaToolchains.outputs": [ @@ -834,11 +996,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.javaToolchains.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.javaToolchains.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.javaToolchains.options.cwd": [ + "targets.javaToolchains.options": [ "application/build.gradle", "@nx/gradle" ], @@ -846,11 +1012,15 @@ "application/build.gradle", "@nx/gradle" ], - "targets.outgoingVariants": ["application/build.gradle", "@nx/gradle"], - "targets.outgoingVariants.options": [ + "targets.javaToolchains.metadata.technologies": [ "application/build.gradle", "@nx/gradle" ], + "targets.javaToolchains.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.outgoingVariants": ["application/build.gradle", "@nx/gradle"], "targets.outgoingVariants.cache": [ "application/build.gradle", "@nx/gradle" @@ -867,11 +1037,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.outgoingVariants.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.outgoingVariants.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.outgoingVariants.options.cwd": [ + "targets.outgoingVariants.options": [ "application/build.gradle", "@nx/gradle" ], @@ -879,38 +1053,55 @@ "application/build.gradle", "@nx/gradle" ], + "targets.outgoingVariants.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.outgoingVariants.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.projects": ["application/build.gradle", "@nx/gradle"], - "targets.projects.options": ["application/build.gradle", "@nx/gradle"], "targets.projects.cache": ["application/build.gradle", "@nx/gradle"], "targets.projects.inputs": ["application/build.gradle", "@nx/gradle"], "targets.projects.outputs": ["application/build.gradle", "@nx/gradle"], "targets.projects.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.projects.metadata": ["application/build.gradle", "@nx/gradle"], "targets.projects.executor": ["application/build.gradle", "@nx/gradle"], - "targets.projects.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.projects.options": ["application/build.gradle", "@nx/gradle"], "targets.projects.options.command": [ "application/build.gradle", "@nx/gradle" ], + "targets.projects.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.projects.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.properties": ["application/build.gradle", "@nx/gradle"], - "targets.properties.options": ["application/build.gradle", "@nx/gradle"], "targets.properties.cache": ["application/build.gradle", "@nx/gradle"], "targets.properties.inputs": ["application/build.gradle", "@nx/gradle"], "targets.properties.outputs": ["application/build.gradle", "@nx/gradle"], "targets.properties.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.properties.metadata": ["application/build.gradle", "@nx/gradle"], "targets.properties.executor": ["application/build.gradle", "@nx/gradle"], - "targets.properties.options.cwd": [ + "targets.properties.options": ["application/build.gradle", "@nx/gradle"], + "targets.properties.options.command": [ "application/build.gradle", "@nx/gradle" ], - "targets.properties.options.command": [ + "targets.properties.metadata.technologies": [ "application/build.gradle", "@nx/gradle" ], - "targets.resolvableConfigurations": [ + "targets.properties.metadata.technologies.0": [ "application/build.gradle", "@nx/gradle" ], - "targets.resolvableConfigurations.options": [ + "targets.resolvableConfigurations": [ "application/build.gradle", "@nx/gradle" ], @@ -930,11 +1121,15 @@ "application/build.gradle", "@nx/gradle" ], + "targets.resolvableConfigurations.metadata": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.resolvableConfigurations.executor": [ "application/build.gradle", "@nx/gradle" ], - "targets.resolvableConfigurations.options.cwd": [ + "targets.resolvableConfigurations.options": [ "application/build.gradle", "@nx/gradle" ], @@ -942,17 +1137,32 @@ "application/build.gradle", "@nx/gradle" ], + "targets.resolvableConfigurations.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.resolvableConfigurations.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.tasks": ["application/build.gradle", "@nx/gradle"], - "targets.tasks.options": ["application/build.gradle", "@nx/gradle"], "targets.tasks.cache": ["application/build.gradle", "@nx/gradle"], "targets.tasks.inputs": ["application/build.gradle", "@nx/gradle"], "targets.tasks.outputs": ["application/build.gradle", "@nx/gradle"], "targets.tasks.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.tasks.metadata": ["application/build.gradle", "@nx/gradle"], "targets.tasks.executor": ["application/build.gradle", "@nx/gradle"], - "targets.tasks.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.tasks.options": ["application/build.gradle", "@nx/gradle"], "targets.tasks.options.command": ["application/build.gradle", "@nx/gradle"], + "targets.tasks.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.tasks.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.projectReport": ["application/build.gradle", "@nx/gradle"], - "targets.projectReport.options": ["application/build.gradle", "@nx/gradle"], "targets.projectReport.cache": ["application/build.gradle", "@nx/gradle"], "targets.projectReport.inputs": ["application/build.gradle", "@nx/gradle"], "targets.projectReport.outputs": ["application/build.gradle", "@nx/gradle"], @@ -960,35 +1170,60 @@ "application/build.gradle", "@nx/gradle" ], - "targets.projectReport.executor": [ + "targets.projectReport.metadata": [ "application/build.gradle", "@nx/gradle" ], - "targets.projectReport.options.cwd": [ + "targets.projectReport.executor": [ "application/build.gradle", "@nx/gradle" ], + "targets.projectReport.options": ["application/build.gradle", "@nx/gradle"], "targets.projectReport.options.command": [ "application/build.gradle", "@nx/gradle" ], + "targets.projectReport.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.projectReport.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.check": ["application/build.gradle", "@nx/gradle"], - "targets.check.options": ["application/build.gradle", "@nx/gradle"], "targets.check.cache": ["application/build.gradle", "@nx/gradle"], "targets.check.inputs": ["application/build.gradle", "@nx/gradle"], "targets.check.outputs": ["application/build.gradle", "@nx/gradle"], "targets.check.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.check.metadata": ["application/build.gradle", "@nx/gradle"], "targets.check.executor": ["application/build.gradle", "@nx/gradle"], - "targets.check.options.cwd": ["application/build.gradle", "@nx/gradle"], + "targets.check.options": ["application/build.gradle", "@nx/gradle"], "targets.check.options.command": ["application/build.gradle", "@nx/gradle"], + "targets.check.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.check.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ], "targets.test": ["application/build.gradle", "@nx/gradle"], - "targets.test.options": ["application/build.gradle", "@nx/gradle"], "targets.test.cache": ["application/build.gradle", "@nx/gradle"], "targets.test.inputs": ["application/build.gradle", "@nx/gradle"], "targets.test.outputs": ["application/build.gradle", "@nx/gradle"], "targets.test.dependsOn": ["application/build.gradle", "@nx/gradle"], + "targets.test.metadata": ["application/build.gradle", "@nx/gradle"], "targets.test.executor": ["application/build.gradle", "@nx/gradle"], - "targets.test.options.cwd": ["application/build.gradle", "@nx/gradle"], - "targets.test.options.command": ["application/build.gradle", "@nx/gradle"] + "targets.test.options": ["application/build.gradle", "@nx/gradle"], + "targets.test.options.command": ["application/build.gradle", "@nx/gradle"], + "targets.test.metadata.technologies": [ + "application/build.gradle", + "@nx/gradle" + ], + "targets.test.metadata.technologies.0": [ + "application/build.gradle", + "@nx/gradle" + ] } } diff --git a/docs/shared/tutorials/gradle-project-graph.json b/docs/shared/tutorials/gradle-project-graph.json index 093cf26121a2e..cc0026a966ed2 100644 --- a/docs/shared/tutorials/gradle-project-graph.json +++ b/docs/shared/tutorials/gradle-project-graph.json @@ -1,5 +1,5 @@ { - "hash": "d9359f8fad9d80892e579a30eb658fc90e6bb6c8acbdf742c09465830fe8eecc", + "hash": "ad0ea8f7ae85c873d6478c31b51a95c54115a49844d62a5b3972232ac82137d0", "projects": [ { "name": "application", @@ -62,7 +62,7 @@ "command": "../gradlew build" }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["production", "^production"], "outputs": ["{workspaceRoot}/application/build"], "dependsOn": ["^build", "classes"], "executor": "nx:run-commands", @@ -143,15 +143,6 @@ "executor": "nx:run-commands", "configurations": {} }, - "mytask": { - "options": { - "cwd": "application", - "command": "../gradlew mytask" - }, - "cache": false, - "executor": "nx:run-commands", - "configurations": {} - }, "javadoc": { "options": { "cwd": "application", @@ -285,7 +276,7 @@ "command": "../gradlew test" }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["default", "^production"], "dependsOn": ["classes"], "executor": "nx:run-commands", "configurations": {} @@ -320,7 +311,7 @@ "command": "../gradlew build" }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["production", "^production"], "outputs": ["{workspaceRoot}/library/build"], "dependsOn": ["^build", "classes"], "executor": "nx:run-commands", @@ -516,7 +507,7 @@ "command": "../gradlew test" }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["default", "^production"], "dependsOn": ["classes"], "executor": "nx:run-commands", "configurations": {} @@ -527,11 +518,11 @@ } }, { - "name": "gs-multi-module", + "name": "gradle-tutorial", "type": "lib", "data": { "root": ".", - "name": "gs-multi-module", + "name": "gradle-tutorial", "metadata": { "technologies": ["gradle"] }, @@ -587,7 +578,7 @@ "command": "gradlew build" }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["production", "^production"], "outputs": ["{workspaceRoot}/build"], "dependsOn": ["^build", "classes"], "executor": "nx:run-commands", @@ -686,15 +677,6 @@ "executor": "nx:run-commands", "configurations": {} }, - "mytask": { - "options": { - "cwd": ".", - "command": "gradlew mytask" - }, - "cache": false, - "executor": "nx:run-commands", - "configurations": {} - }, "javadoc": { "options": { "cwd": ".", @@ -828,7 +810,7 @@ "command": "gradlew test" }, "cache": true, - "inputs": ["default", "^default"], + "inputs": ["default", "^production"], "dependsOn": ["classes"], "executor": "nx:run-commands", "configurations": {} @@ -848,59 +830,30 @@ } ], "library": [], - "gs-multi-module": [] + "gradle-tutorial": [] }, "fileMap": { - "library": [ - { - "file": "library/build.gradle", - "hash": "10874096726061397019" - }, - { - "file": "library/src/main/java/com/example/multimodule/service/MyService.java", - "hash": "1785389597461451392" - }, - { - "file": "library/src/main/java/com/example/multimodule/service/ServiceProperties.java", - "hash": "5222601539204689670" - }, - { - "file": "library/src/test/java/com/example/multimodule/service/MyServiceTest.java", - "hash": "7173828893536126792" - } - ], - "application": [ - { - "file": "application/build.gradle", - "hash": "15595366620082022247", - "deps": ["library"] - }, - { - "file": "application/src/main/java/com/example/multimodule/application/DemoApplication.java", - "hash": "14352596731965082005" - }, + "gradle-tutorial": [ { - "file": "application/src/main/resources/application.properties", - "hash": "18341909134911292471" + "file": ".gitignore", + "hash": "14909406639319951657" }, { - "file": "application/src/test/java/com/example/multimodule/application/DemoApplicationTest.java", - "hash": "12794301020412404095" - } - ], - "gs-multi-module": [ - { - "file": ".github/workflows/ci.yml", - "hash": "17096105121767446301" + "file": ".mvn/wrapper/maven-wrapper.jar", + "hash": "4599048718252132452" }, { - "file": ".gitignore", - "hash": "4885119873161115981" + "file": ".mvn/wrapper/maven-wrapper.properties", + "hash": "14062264138023377782" }, { "file": ".nx/nxw.js", "hash": "11254603345854076312" }, + { + "file": "README.md", + "hash": "2143394647937164316" + }, { "file": "build.gradle", "hash": "6776876968973565169" @@ -931,11 +884,56 @@ }, { "file": "nx.json", - "hash": "971483985645815365" + "hash": "16332841804597347663" }, { "file": "settings.gradle", - "hash": "17607223828082968997" + "hash": "5690477904066095133" + } + ], + "application": [ + { + "file": "application/build.gradle", + "hash": "13223387111008998466", + "deps": ["library"] + }, + { + "file": "application/settings.gradle", + "hash": "18286272227920383284" + }, + { + "file": "application/src/main/java/com/example/multimodule/application/DemoApplication.java", + "hash": "117361831080317523" + }, + { + "file": "application/src/main/resources/application.properties", + "hash": "18341909134911292471" + }, + { + "file": "application/src/test/java/com/example/multimodule/application/DemoApplicationTest.java", + "hash": "12794301020412404095" + } + ], + "library": [ + { + "file": "library/build.gradle", + "hash": "10874096726061397019" + }, + { + "file": "library/settings.gradle", + "hash": "13735992102452590570" + }, + { + "file": "library/src/main/java/com/example/multimodule/service/MyService.java", + "hash": "1785389597461451392" + }, + { + "file": "library/src/main/java/com/example/multimodule/service/ServiceProperties.java", + "hash": "5222601539204689670" + }, + { + "file": "library/src/test/java/com/example/multimodule/service/MyServiceTest.java", + "hash": "7173828893536126792" } ] }, @@ -946,5 +944,6 @@ "affectedProjectIds": [], "focus": null, "groupByFolder": false, - "exclude": [] + "exclude": [], + "isPartial": false } diff --git a/docs/shared/tutorials/gradle.md b/docs/shared/tutorials/gradle.md index 9c7983415eef3..808c50f5df170 100644 --- a/docs/shared/tutorials/gradle.md +++ b/docs/shared/tutorials/gradle.md @@ -5,22 +5,14 @@ description: In this tutorial you'll add Nx to an existing Gradle repo # Gradle Tutorial -In this tutorial, you'll learn how to add Nx to a repository with an existing Gradle setup. You'll see how Nx can provide immediate value with very little configuration and then you can gradually enable more features. +In this tutorial, you'll learn how to add Nx to a repository with an existing Gradle setup. You'll see how Nx can +provide immediate value. - +## Prerequisites - - -## Get Started - -Make sure that you have [Gradle](https://gradle.org/) installed on your system. Consult [Gradle's installation guide](https://docs.gradle.org/current/userguide/installation.html) for instruction that are specific to your operating system. +Make sure that you have [Gradle](https://gradle.org/) installed on your system. +Consult [Gradle's installation guide](https://docs.gradle.org/current/userguide/installation.html) for instruction that +are specific to your operating system. To verify that Gradle was installed correctly, run this command: @@ -28,198 +20,191 @@ To verify that Gradle was installed correctly, run this command: gradle --version ``` -We'll start the tutorial with [a sample repository](https://github.com/nrwl/gradle-spring) that was created by following the [Spring framework](https://spring.io/)'s tutorial for [Creating a Multi-Module Project](https://spring.io/guides/gs/multi-module). +Nx also requires NodeJS to be installed. If you do not have NodeJS installed, you can +install it from the [NodeJS website](https://nodejs.org/en/download). + +```shell +node -v +``` + +## Getting Started -Check out [the sample repository](https://github.com/nrwl/gradle-spring) on your local machine: +This tutorial picks up where [Spring framework](https://spring.io/)'s guide +for [Multi-Module Projects](https://spring.io/guides/gs/multi-module) leaves off. Check +out [the sample repository](https://github.com/nrwl/gradle-tutorial) on your local machine: ```shell -git clone https://github.com/nrwl/gradle-spring.git +git clone https://github.com/nrwl/gradle-tutorial.git ``` -You can run the `./gradlew projects` command to get a list of projects in the repo. +The Multi-Module Spring Tutorial left us with 2 projects: + +- The main `application` project which contains the Spring `DemoApplication` +- A `library` project which contains a Service used in the `DemoApplication` + +You can see the above 2 projects by running `./gradlew projects` ```text {% command="./gradlew projects" %} > Task :projects ------------------------------------------------------------ -Root project 'gs-multi-module' +Root project 'gradle-tutorial' ------------------------------------------------------------ -Root project 'gs-multi-module' +Root project 'gradle-tutorial' +--- Project ':application' \--- Project ':library' -To see a list of the tasks of a project, run gradlew :tasks -For example, try running gradlew :application:tasks - -BUILD SUCCESSFUL in 3s -1 actionable task: 1 executed ``` -The repository has a simple library and an application that uses it. +## Add Nx -You can build the `application` project by running `./gradlew application:build`: +Nx is a build system with built in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, +both locally and on CI. We will explore the features of Nx in this tutorial by adding it to the Gradle workspace above. -```text {% command="./gradlew application:build" %} -BUILD SUCCESSFUL in 1s -9 actionable tasks: 9 up-to-date -``` +To add Nx, run `npx nx@latest init`. -## Add Nx +This command will download the latest version of Nx and help set up your repository to take advantage of it. Nx will +also detect Gradle is used in the repo so it will propose adding the `@nx/gradle` plugin to integrate Gradle with Nx. +Select the plugin and continue with the setup. -With the `@nx/gradle` plugin, Nx can be easily added to a Gradle repository and Nx will work seamlessly along side it. +Similar to Gradle, Nx can be run with the `nx` or `nx.bat` executables. We will learn about some of the Nx commands in +the following sections. -Nx offers many features, but at its core, it is a task runner. Out of the box, it can cache your tasks and ensure those tasks are run in the correct order. After the initial set up, you can incrementally add on other features that would be helpful in your organization. +## Explore Your Workspace -To enable Nx in your repository, run a single command: +Like Gradle, Nx understands your workspace as a graph of projects. Nx uses this graph for many things which we will +learn about in following sections. To visualize this graph in your browser, Run the following command and click the +"Show all projects" button in the left sidebar. -```shell {% path="~/gradle-tutorial" %} -npx nx@latest init -``` +You will recognize that the projects which are shown, are the same projects which Gradle shows. +The `@nx/gradle` plugin reflects the graph of projects in Gradle into the Nx Project Graph. As projects +are created, deleted, and change their dependencies, Nx will automatically recalculate the graph. Exploring this graph +visually is vital to understanding how your code is structured and how Nx and Gradle behaves. -This command will download the latest version of Nx and help set up your repository to take advantage of it. +{% tabs %} +{% tab label="Mac/Linux" %} -The script will propose installing the `@nx/gradle` plugin to allow Nx to understand Gradle configuration files. Make sure to select the plugin to install it. +```shell +./nx graph +``` -After Nx has been installed, there will be a few new files in your repository: +{% /tab %} +{% tab label="Windows" %} -```treeview -gradle-tutorial/ -├── .nx/ -├── application/ -├── library/ -├── build.gradle -├── gradlew -├── gradlew.bat -├── nx -├── nx.bat -├── nx.json -└── settings.gradle +```shell +./nx.bat graph ``` -Because this is not a javascript repository, there is no `package.json` file or `node_modules` folder. Instead, Nx has provided executables at the root of the repository: `nx` for Unix operating systems and `nx.bat` for Windows. These executables can be used in the same way that `gradlew` and `gradlew.bat` are used. +{% /tab %} +{% /tabs %} -The `.nx` folder contains all the code needed to run the `nx` CLI and the cache that Nx uses. +{% graph title="Gradle Projects" height="200px" jsonFile="shared/tutorials/gradle-project-graph.json" %} +{% /graph %} -The `nx.json` file contains repository-wide configuration options for Nx and a list of the currently installed Nx plugins. +## Running Tasks -## Explore Your Workspace +Nx is a task runner built for monorepos. It can run a single task for a single project, a task for all projects, and +even intelligently run a subset of tasks based on the changes you've made in your repository. Nx also has sophisticated +computation caching to reuse the results of tasks. We will explore how Nx adds to the task running Gradle provides. -To get a visual representation of the dependencies between the projects in your repository, run the `./nx graph` command. +Before we start running tasks, let's explore the tasks available for the `application` project. The `@nx/gradle` plugin +that we've added, also reflects Gradle's tasks to Nx, allowing it to run any of the Gradle +tasks. You can do this either through [Nx Console](/getting-started/editor-setup) or from the terminal: ```shell {% path="~/gradle-tutorial" %} -./nx graph +./nx show project application --web ``` -{% graph title="Gradle Projects" height="200px" jsonFile="shared/tutorials/gradle-project-graph.json" %} -{% /graph %} - -Nx uses this graph to determine the order tasks are run and enforce module boundaries. You can also leverage this graph to gain an accurate understanding of the architecture of your codebase. Notice that we did not change any of the Gradle configuration files or hard code any of these project definitions for Nx. Nx was able to directly read the Gradle configuration files, so this graph will always accurately represent the current state of the projects in your repository. - -## Run Tasks +{% project-details title="Project Details View" jsonFile="shared/tutorials/gradle-pdv.json" %} +{% /project-details %} -Nx can run any of your Gradle tasks. The Gradle command to run the `build` task for the `application` project is `./gradlew application:build`. The Nx command to run the same task is: +The Nx command to run the `build` task for the `application` project is: ```shell -./nx build application +./nx run application:build ``` -When Nx runs a Gradle task, it hands off the execution of that task to Gradle, so all task dependencies and configuration settings in the Gradle configuration are still respected. +When Nx runs a Gradle task, it hands off the execution of that task to Gradle, so all task dependencies and +configuration settings in the Gradle configuration are still respected. -To run all the `build` tasks in the repository with Gradle, run `./gradlew build`. To do the same thing with Nx, run: +By running the task via Nx however, the computation was cached for reuse. Now, running `./nx run application:build` +again, will be near instant as the result from the previous command will be used. -```shell -./nx run-many -t build -``` +```{% command="./nx run application:build" %} -Just like Gradle, Nx caches your tasks so that if you run the builds a second time without changing the source files, they'll complete almost instantly. + ✔ 1/1 dependent project tasks succeeded [1 read from cache] -```{% command="./nx run-many -t build" %} + Hint: you can run the command with --verbose to see the full dependent project outputs - ✔ nx run gs-multi-module:classes [existing outputs match the cache, left as is] - ✔ nx run library:classes [existing outputs match the cache, left as is] - ✔ nx run gs-multi-module:build [existing outputs match the cache, left as is] - ✔ nx run library:build [existing outputs match the cache, left as is] - ✔ nx run application:classes [existing outputs match the cache, left as is] - ✔ nx run application:build [existing outputs match the cache, left as is] +————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— -————————————————————————————————————————————————————————————————————————— - NX Successfully ran target build for 3 projects and 3 tasks they depend on (74ms) +> nx run application:classes [existing outputs match the cache, left as is] -Nx read the output from the cache instead of running the command for 6 out of 6 tasks. -``` +> ./gradlew :application:classes -## Create a Custom Task +> Task :library:compileJava UP-TO-DATE +> Task :library:processResources NO-SOURCE +> Task :library:classes UP-TO-DATE +> Task :library:jar UP-TO-DATE +> Task :application:compileJava UP-TO-DATE +> Task :application:processResources UP-TO-DATE +> Task :application:classes UP-TO-DATE -Nx can run any tasks that are available to Gradle - even your own custom tasks. Let's create a custom task to see this functionality in action. Edit the `application` Gradle build file to create a custom task: +BUILD SUCCESSFUL in 647ms +4 actionable tasks: 4 up-to-date -```{% fileName="application/build.gradle" highlightLines=["25-34"] %} -plugins { - id 'org.springframework.boot' version '3.2.2' - id 'io.spring.dependency-management' version '1.1.4' - id 'java' -} +> nx run application:build [existing outputs match the cache, left as is] -group = 'com.example' -version = '0.0.1-SNAPSHOT' +> ./gradlew :application:build -java { - sourceCompatibility = '17' -} -repositories { - mavenCentral() -} +Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-actuator' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation project(':library') - testImplementation 'org.springframework.boot:spring-boot-starter-test' -} +You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. -tasks.register("mytask"){ - group = "Custom" - description = "A custom task" -} +For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. -tasks.named("mytask"){ - doFirst { - println("This is my task!") - } -} -``` +BUILD SUCCESSFUL in 768ms +9 actionable tasks: 1 executed, 8 up-to-date -Now, you can run `mytask` with Nx like this: +————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— -```{% command="./nx mytask application" %} -> nx run application:mytask + NX Successfully ran target build for project application and 3 tasks it depends on (30ms) -> ../gradlew mytask +Nx read the output from the cache instead of running the command for 4 out of 4 tasks. +``` -> Task :application:mytask -This is my task! +Now that we've run one task, let's run all the `build` tasks in the repository with the Nx `run-many` command: -BUILD SUCCESSFUL in 358ms -1 actionable task: 1 executed -``` +```{% command="./nx run-many -t build" %} -You can see all the tasks available to Nx by opening the project details view for the `application` project. You can do this either through [Nx Console](/getting-started/editor-setup) or from the terminal: + ✔ nx run library:classes [existing outputs match the cache, left as is] + ✔ nx run library:build [existing outputs match the cache, left as is] + ✔ nx run application:classes [existing outputs match the cache, left as is] + ✔ nx run application:build [existing outputs match the cache, left as is] + ✔ nx run gradle-tutorial:classes (1s) + ✔ nx run gradle-tutorial:build (1s) + +————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— + + NX Successfully ran target build for 3 projects and 3 tasks they depend on (2s) + +Nx read the output from the cache instead of running the command for 4 out of 6 tasks. -```shell {% path="~/gradle-tutorial" %} -./nx show project application --web ``` -{% project-details title="Project Details View" jsonFile="shared/tutorials/gradle-pdv.json" %} -{% /project-details %} +Again, because Nx cached the tasks when the application was built, most of the tasks here were near instant. The only +ones which needed to be done is the root project's build. Running the command one more time, will be near instant as +then all the tasks will be restored from the cache. ## Run Tasks for Affected Projects -Nx doesn't just cache your task results, it can also eliminate the need to run unnecessary tasks. Nx can use its project graph in conjunction with your git history to only run tasks for projects that may have been affected by the changes that you made. Let's explore how the [nx affected](/ci/features/affected) command works. +Nx doesn't just cache your task results, it can also eliminate the need to run unnecessary tasks. -First, commit any outstanding changes in your repository: +First, commit any outstanding changes to the `main` branch locally: ```shell git commit -am "changes" @@ -240,38 +225,37 @@ import org.springframework.web.bind.annotation.RestController; @RestController public class DemoApplication { - private final MyService myService; + private final MyService myService; - public DemoApplication(MyService myService) { - this.myService = myService; - } + public DemoApplication(MyService myService) { + this.myService = myService; + } - @GetMapping("/") - public String home() { - return myService.message() + " changed!"; - } + @GetMapping("/") + public String home() { + return myService.message() + " changed!"; + } - public static void main(String[] args) { - SpringApplication.run(DemoApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } } ``` -Then you can use the `nx affected` command to run the `test` task only for projects that were affected by that change. - -```shell -./nx affected -t test -``` - -The `test` task was run for the `application` project, but not for `library` because a change to the `application` project could not have changed the behavior of those projects. This feature is most useful in CI where you want to make sure to fully check every project that may have been affected by a change, but you want to avoid wasting time on tasks that do not need to be run. As more projects are added to the repository, this functionality becomes essential to maintain a fast CI pipeline. - -## Summary +As a developer, we know that this change only affects the `application` project, not the `library` project. We would +run `./nx run application:test` to verify our changes. In CI, teams often run all test tasks rerunning +the `library:test` task unnecessarily. -Now that you have added Nx to your Gradle repository, you can take advantage of Nx's dependency graph visualisation and leverage the `affected` command to speed up your CI pipeline. You can also more easily add javascript projects along side your Gradle projects and use Nx to manage them all. +The `./nx affected` command solves this problem. Nx uses its project graph in conjunction with git history to only run +tasks for projects that may have been affected by the changes that you made. -## Setup CI for Your Gradle Repository +## Set up CI with Nx -This tutorial walked you through how Nx can improve the developer experience for local development, but Nx can also make a big difference in CI. Without adequate tooling, CI times tend to grow exponentially with the size of the codebase. Nx helps reduce wasted time in CI with the [`affected` command](/ci/features/affected) and Nx Replay's [remote caching](/ci/features/remote-cache). Nx also [efficiently parallelizes tasks across machines](/ci/concepts/parallelization-distribution) with Nx Agents. +This tutorial walked you through how Nx can improve the developer experience for local development, but Nx also makes +a huge difference in CI. Without adequate tooling, CI times tend to grow exponentially with the size of the codebase. Nx +helps reduce wasted time in CI with the [`affected` command](/ci/features/affected) and Nx +Replay's [remote caching](/ci/features/remote-cache). Nx +also [efficiently parallelizes tasks across machines](/ci/concepts/parallelization-distribution) with Nx Agents. To set up Nx Replay run: @@ -321,20 +305,35 @@ jobs: - run: ./nx affected -t test build ``` -This is a default CI configuration that sets up Nx Cloud to [use nx affected](/ci/features/affected). This will only run the tasks that are needed for a particular PR. +This is a default CI configuration that sets up Nx Cloud to [use nx affected](/ci/features/affected). This will only run +the tasks that are needed for a particular PR. -You can also [enable distributed task execution](/ci/features/distribute-task-execution) by uncommenting the `nx-cloud start-ci-run` line. This will automatically run all tasks on separate machines in parallel wherever possible, without requiring you to manually coordinate copying the output from one machine to another. +You can also [enable distributed task execution](/ci/features/distribute-task-execution) by uncommenting +the `nx-cloud start-ci-run` line. This will automatically run all tasks on separate machines in parallel wherever +possible, without requiring you to manually coordinate copying the output from one machine to another. Check out one of these detailed tutorials on setting up CI with Nx: - [Circle CI with Nx](/ci/intro/tutorials/circle) - [GitHub Actions with Nx](/ci/intro/tutorials/github-actions) +## Summary + +Now that you have added Nx to this sample Gradle repository, you have learned several ways that Nx can help your +organization: + +- Nx reflects the Gradle graph into the Nx graph +- Nx's dependency graph visualisation helps you understand your codebase +- Nx caches task results and reuses them when the same task is rerun later +- Nx intelligently determines which tasks are `affected` by code changes to reduce waste in CI +- Nx Cloud provides remote caching and distributed task execution to speed up CI + ## Next Steps Connect with the rest of the Nx community with these resources: -- [Join the Official Nx Discord Server](https://go.nx.dev/community) to ask questions and find out the latest news about Nx. +- [Join the Official Nx Discord Server](https://go.nx.dev/community) to ask questions and find out the latest news about + Nx. - [Follow Nx on Twitter](https://twitter.com/nxdevtools) to stay up to date with Nx news - [Read our Nx blog](https://blog.nrwl.io/) - [Subscribe to our Youtube channel](https://www.youtube.com/@nxdevtools) for demos and Nx insights