-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable the
l2-resource-alpha
conformance test
This commit enables the `l2-resource-alpha` test. The test already passes, so it's just a matter of turning it on.
- Loading branch information
Showing
12 changed files
with
611 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-alpha/Pulumi.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name: l2-resource-alpha | ||
runtime: java |
99 changes: 99 additions & 0 deletions
99
pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-alpha/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.pulumi</groupId> | ||
<artifactId>l2-resource-alpha</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<encoding>UTF-8</encoding> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
<maven.compiler.release>11</maven.compiler.release> | ||
<mainClass>generated_program.App</mainClass> | ||
<mainArgs/> | ||
</properties> | ||
|
||
<repositories> | ||
<repository> | ||
<id>repository-0</id> | ||
<url>REPOSITORY</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.pulumi</groupId> | ||
<artifactId>pulumi</artifactId> | ||
<version>CORE.VERSION</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.pulumi</groupId> | ||
<artifactId>alpha</artifactId> | ||
<version>3.0.0-alpha.1.internal</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.2.2</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<mainClass>${mainClass}</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>3.4.2</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<mainClass>${mainClass}</mainClass> | ||
</manifest> | ||
</archive> | ||
<descriptorRefs> | ||
<descriptorRef>jar-with-dependencies</descriptorRef> | ||
</descriptorRefs> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>make-my-jar-with-dependencies</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<configuration> | ||
<mainClass>${mainClass}</mainClass> | ||
<commandlineArgs>${mainArgs}</commandlineArgs> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-wrapper-plugin</artifactId> | ||
<version>3.1.1</version> | ||
<configuration> | ||
<mavenVersion>3.8.5</mavenVersion> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
26 changes: 26 additions & 0 deletions
26
...anguage-java/testdata/projects/l2-resource-alpha/src/main/java/generated_program/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package generated_program; | ||
|
||
import com.pulumi.Context; | ||
import com.pulumi.Pulumi; | ||
import com.pulumi.core.Output; | ||
import com.pulumi.alpha.Resource; | ||
import com.pulumi.alpha.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 res = new Resource("res", ResourceArgs.builder() | ||
.value(true) | ||
.build()); | ||
|
||
} | ||
} |
1 change: 1 addition & 0 deletions
1
pkg/cmd/pulumi-language-java/testdata/sdks/alpha-3.0.0-alpha.1.internal/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
155 changes: 155 additions & 0 deletions
155
pkg/cmd/pulumi-language-java/testdata/sdks/alpha-3.0.0-alpha.1.internal/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
// *** WARNING: this file was generated by pulumi-java-gen *** | ||
// *** Do not edit by hand unless you're certain you know what you are doing! *** | ||
|
||
plugins { | ||
id("signing") | ||
id("java-library") | ||
id("maven-publish") | ||
} | ||
|
||
group = "com.pulumi" | ||
|
||
def resolvedVersion = System.getenv("PACKAGE_VERSION") ?: | ||
(project.version == "unspecified" | ||
? "3.0.0-alpha.1.internal" | ||
: project.version) | ||
|
||
def signingKey = System.getenv("SIGNING_KEY") | ||
def signingPassword = System.getenv("SIGNING_PASSWORD") | ||
def publishRepoURL = System.getenv("PUBLISH_REPO_URL") | ||
def publishRepoUsername = System.getenv("PUBLISH_REPO_USERNAME") | ||
def publishRepoPassword = System.getenv("PUBLISH_REPO_PASSWORD") | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(11) | ||
} | ||
} | ||
|
||
compileJava { | ||
options.fork = true | ||
options.forkOptions.jvmArgs.addAll(["-Xmx16g"]) | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
repositories { | ||
maven { | ||
url("REPOSITORY") | ||
} | ||
mavenLocal() | ||
maven { // The google mirror is less flaky than mavenCentral() | ||
url("https://maven-central.storage-download.googleapis.com/maven2/") | ||
} | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("com.google.code.findbugs:jsr305:3.0.2") | ||
implementation("com.google.code.gson:gson:2.8.9") | ||
implementation("com.pulumi:pulumi:CORE.VERSION") | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
from sourceSets.main.allJava | ||
archiveClassifier.set('sources') | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
from javadoc | ||
archiveClassifier.set('javadoc') | ||
zip64 = true | ||
} | ||
|
||
def genPulumiResources = tasks.register('genPulumiResources') { | ||
doLast { | ||
def resourcesDir = sourceSets.main.output.resourcesDir | ||
def subDir = project.name.replace(".", "/") | ||
def outDir = file("$resourcesDir/$subDir") | ||
outDir.mkdirs() | ||
new File(outDir, "version.txt").text = resolvedVersion | ||
def info = new Object() | ||
info.metaClass.resource = true | ||
info.metaClass.name = "alpha" | ||
info.metaClass.version = resolvedVersion | ||
def infoJson = new groovy.json.JsonBuilder(info).toPrettyString() | ||
new File(outDir, "plugin.json").text = infoJson | ||
} | ||
} | ||
|
||
jar.configure { | ||
dependsOn genPulumiResources | ||
} | ||
|
||
publishing { | ||
publications { | ||
mainPublication(MavenPublication) { | ||
groupId = "com.pulumi" | ||
artifactId = "alpha" | ||
version = resolvedVersion | ||
from components.java | ||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
pom { | ||
inceptionYear = "" | ||
name = "" | ||
packaging = "jar" | ||
description = " " | ||
|
||
url = "https://example.com" | ||
|
||
scm { | ||
connection = "https://example.com" | ||
developerConnection = "https://example.com" | ||
url = "https://example.com" | ||
} | ||
|
||
licenses { | ||
license { | ||
name = "" | ||
url = "" | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = "" | ||
name = "" | ||
email = "" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (publishRepoURL) { | ||
repositories { | ||
maven { | ||
name = "PublishRepo" | ||
url = publishRepoURL | ||
credentials { | ||
username = publishRepoUsername | ||
password = publishRepoPassword | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
javadoc { | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
options.jFlags("-Xmx8g", "-Xms512m") | ||
} | ||
|
||
jar { | ||
zip64 = true | ||
} | ||
|
||
if (signingKey) { | ||
signing { | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign publishing.publications.mainPublication | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
pkg/cmd/pulumi-language-java/testdata/sdks/alpha-3.0.0-alpha.1.internal/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// *** WARNING: this file was generated by pulumi-java-gen. *** | ||
// *** Do not edit by hand unless you're certain you know what you are doing! *** | ||
|
||
pluginManagement { | ||
repositories { | ||
maven { // The google mirror is less flaky than mavenCentral() | ||
url("https://maven-central.storage-download.googleapis.com/maven2/") | ||
} | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
rootProject.name = "com.pulumi.alpha" | ||
include("lib") |
54 changes: 54 additions & 0 deletions
54
...a/testdata/sdks/alpha-3.0.0-alpha.1.internal/src/main/java/com/pulumi/alpha/Provider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// *** WARNING: this file was generated by pulumi-language-java. *** | ||
// *** Do not edit by hand unless you're certain you know what you are doing! *** | ||
|
||
package com.pulumi.alpha; | ||
|
||
import com.pulumi.alpha.ProviderArgs; | ||
import com.pulumi.alpha.Utilities; | ||
import com.pulumi.core.Output; | ||
import com.pulumi.core.annotations.ResourceType; | ||
import com.pulumi.core.internal.Codegen; | ||
import javax.annotation.Nullable; | ||
|
||
@ResourceType(type="pulumi:providers:alpha") | ||
public class Provider extends com.pulumi.resources.ProviderResource { | ||
/** | ||
* | ||
* @param name The _unique_ name of the resulting resource. | ||
*/ | ||
public Provider(java.lang.String name) { | ||
this(name, ProviderArgs.Empty); | ||
} | ||
/** | ||
* | ||
* @param name The _unique_ name of the resulting resource. | ||
* @param args The arguments to use to populate this resource's properties. | ||
*/ | ||
public Provider(java.lang.String name, @Nullable ProviderArgs args) { | ||
this(name, args, null); | ||
} | ||
/** | ||
* | ||
* @param name The _unique_ name of the resulting resource. | ||
* @param args The arguments to use to populate this resource's properties. | ||
* @param options A bag of options that control this resource's behavior. | ||
*/ | ||
public Provider(java.lang.String name, @Nullable ProviderArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { | ||
super("alpha", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); | ||
} | ||
|
||
private static ProviderArgs makeArgs(@Nullable ProviderArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { | ||
if (options != null && options.getUrn().isPresent()) { | ||
return null; | ||
} | ||
return args == null ? ProviderArgs.Empty : args; | ||
} | ||
|
||
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<java.lang.String> id) { | ||
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() | ||
.version(Utilities.getVersion()) | ||
.build(); | ||
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...stdata/sdks/alpha-3.0.0-alpha.1.internal/src/main/java/com/pulumi/alpha/ProviderArgs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// *** WARNING: this file was generated by pulumi-language-java. *** | ||
// *** Do not edit by hand unless you're certain you know what you are doing! *** | ||
|
||
package com.pulumi.alpha; | ||
|
||
|
||
|
||
|
||
public final class ProviderArgs extends com.pulumi.resources.ResourceArgs { | ||
|
||
public static final ProviderArgs Empty = new ProviderArgs(); | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static final class Builder { | ||
private ProviderArgs $; | ||
|
||
public Builder() { | ||
$ = new ProviderArgs(); | ||
} | ||
public ProviderArgs build() { | ||
return $; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.