diff --git a/pkg/cmd/pulumi-language-java/language_test.go b/pkg/cmd/pulumi-language-java/language_test.go index 5dd31a01e88..64e2b04fb8c 100644 --- a/pkg/cmd/pulumi-language-java/language_test.go +++ b/pkg/cmd/pulumi-language-java/language_test.go @@ -180,7 +180,6 @@ var expectedFailures = map[string]string{ "l2-resource-config": "unimplemented for Java", "l2-resource-primitives": "unimplemented for Java", "l2-resource-secret": "unimplemented for Java", - "l2-target-up-with-new-dependency": "unimplemented for Java", } // runTestingHost boots up a new instance of the language conformance test runner, `pulumi-test-language`, as well as a diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/Pulumi.yaml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/Pulumi.yaml new file mode 100644 index 00000000000..f02ea54c089 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-target-up-with-new-dependency +runtime: java diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/pom.xml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/pom.xml new file mode 100644 index 00000000000..a0a5a8fb334 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/pom.xml @@ -0,0 +1,99 @@ + + + 4.0.0 + + com.pulumi + l2-target-up-with-new-dependency + 1.0-SNAPSHOT + + + UTF-8 + 11 + 11 + 11 + generated_program.App + + + + + + repository-0 + REPOSITORY + + + + + + com.pulumi + pulumi + CORE.VERSION + + + com.pulumi + simple + 2.0.0 + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + + true + ${mainClass} + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.4.2 + + + + true + ${mainClass} + + + + jar-with-dependencies + + + + + make-my-jar-with-dependencies + package + + single + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + ${mainClass} + ${mainArgs} + + + + org.apache.maven.plugins + maven-wrapper-plugin + 3.1.1 + + 3.8.5 + + + + + \ No newline at end of file diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/src/main/java/generated_program/App.java b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/src/main/java/generated_program/App.java new file mode 100644 index 00000000000..0856e968cec --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/0/src/main/java/generated_program/App.java @@ -0,0 +1,30 @@ +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.simple.Resource; +import com.pulumi.simple.ResourceArgs; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var targetOnly = new Resource("targetOnly", ResourceArgs.builder() + .value(true) + .build()); + + var unrelated = new Resource("unrelated", ResourceArgs.builder() + .value(true) + .build()); + + } +} diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/Pulumi.yaml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/Pulumi.yaml new file mode 100644 index 00000000000..f02ea54c089 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-target-up-with-new-dependency +runtime: java diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/pom.xml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/pom.xml new file mode 100644 index 00000000000..a0a5a8fb334 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/pom.xml @@ -0,0 +1,99 @@ + + + 4.0.0 + + com.pulumi + l2-target-up-with-new-dependency + 1.0-SNAPSHOT + + + UTF-8 + 11 + 11 + 11 + generated_program.App + + + + + + repository-0 + REPOSITORY + + + + + + com.pulumi + pulumi + CORE.VERSION + + + com.pulumi + simple + 2.0.0 + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + + true + ${mainClass} + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.4.2 + + + + true + ${mainClass} + + + + jar-with-dependencies + + + + + make-my-jar-with-dependencies + package + + single + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + ${mainClass} + ${mainArgs} + + + + org.apache.maven.plugins + maven-wrapper-plugin + 3.1.1 + + 3.8.5 + + + + + \ No newline at end of file diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/src/main/java/generated_program/App.java b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/src/main/java/generated_program/App.java new file mode 100644 index 00000000000..9baa6fa804a --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-target-up-with-new-dependency/1/src/main/java/generated_program/App.java @@ -0,0 +1,37 @@ +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.simple.Resource; +import com.pulumi.simple.ResourceArgs; +import com.pulumi.resources.CustomResourceOptions; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var targetOnly = new Resource("targetOnly", ResourceArgs.builder() + .value(true) + .build()); + + var dep = new Resource("dep", ResourceArgs.builder() + .value(true) + .build()); + + var unrelated = new Resource("unrelated", ResourceArgs.builder() + .value(true) + .build(), CustomResourceOptions.builder() + .dependsOn(dep) + .build()); + + } +}