Skip to content

Commit

Permalink
chore: recreated language SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeckel committed Dec 29, 2024
1 parent d7b6649 commit cafa309
Show file tree
Hide file tree
Showing 15 changed files with 658 additions and 23 deletions.
20 changes: 14 additions & 6 deletions sdk/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

group = "com.pulumiverse"

def resolvedVersion = System.getenv("PACKAGE_VERSION") ?:
(project.version == "unspecified"
? "0.0.1"
Expand All @@ -27,7 +29,8 @@ java {

compileJava {
options.fork = true
options.forkOptions.jvmArgs.addAll(["-Xmx4g"])
options.forkOptions.jvmArgs.addAll(["-Xmx16g"])
options.encoding = "UTF-8"
}

repositories {
Expand All @@ -41,7 +44,7 @@ repositories {
dependencies {
implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation("com.google.code.gson:gson:2.8.9")
implementation("com.pulumi:pulumi:0.9.1")
implementation("com.pulumi:pulumi:0.9.8")
}

task sourcesJar(type: Jar) {
Expand All @@ -52,6 +55,7 @@ task sourcesJar(type: Jar) {
task javadocJar(type: Jar) {
from javadoc
archiveClassifier.set('javadoc')
zip64 = true
}

def genPulumiResources = tasks.register('genPulumiResources') {
Expand All @@ -63,7 +67,7 @@ def genPulumiResources = tasks.register('genPulumiResources') {
new File(outDir, "version.txt").text = resolvedVersion
def info = new Object()
info.metaClass.resource = true
info.metaClass.name = ""
info.metaClass.name = "time"
info.metaClass.version = resolvedVersion
def infoJson = new groovy.json.JsonBuilder(info).toPrettyString()
new File(outDir, "plugin.json").text = infoJson
Expand All @@ -77,8 +81,8 @@ jar.configure {
publishing {
publications {
mainPublication(MavenPublication) {
groupId = ""
artifactId = ""
groupId = "com.pulumiverse"
artifactId = "time"
version = resolvedVersion
from components.java
artifact sourcesJar
Expand All @@ -88,7 +92,7 @@ publishing {
inceptionYear = ""
name = ""
packaging = "jar"
description = ""
description = "A Pulumi package for creating and managing Time resources"

url = "https://github.com/pulumiverse/pulumi-time"

Expand Down Expand Up @@ -124,6 +128,10 @@ javadoc {
options.jFlags("-Xmx8g", "-Xms512m")
}

jar {
zip64 = true
}

if (publishRepoUsername) {
nexusPublishing {
repositories {
Expand Down
54 changes: 49 additions & 5 deletions sdk/java/src/main/java/com/pulumiverse/time/Offset.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

/**
* ## Example Usage
*
* ### Basic Usage
*
* <!--Start PulumiCodeChooser -->
* ```java
* package generated_program;
*
Expand All @@ -40,15 +43,54 @@
* }
*
* public static void stack(Context ctx) {
* var example = new Offset("example", OffsetArgs.builder()
* var example = new Offset("example", OffsetArgs.builder()
* .offsetDays(7)
* .build());
*
* ctx.export("oneWeekFromNow", example.rfc3339());
* }
* }
* ```
* <!--End PulumiCodeChooser -->
*
* ### Multiple Offsets Usage
*
* <!--Start PulumiCodeChooser -->
* ```java
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.time.Offset;
* import com.pulumi.time.OffsetArgs;
* 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 example = new Offset("example", OffsetArgs.builder()
* .offsetYears(1)
* .offsetMonths(1)
* .build());
*
* ctx.export("oneYearAndMonthFromNow", example.rfc3339());
* }
* }
* ```
* <!--End PulumiCodeChooser -->
*
* ### Triggers Usage
*
* <!--Start PulumiCodeChooser -->
* ```java
* package generated_program;
*
Expand All @@ -72,29 +114,31 @@
* }
*
* public static void stack(Context ctx) {
* var amiUpdate = new Offset("amiUpdate", OffsetArgs.builder()
* var amiUpdate = new Offset("amiUpdate", OffsetArgs.builder()
* .triggers(Map.of("ami_id", data.aws_ami().example().id()))
* .offsetDays(7)
* .build());
*
* var server = new Instance("server", InstanceArgs.builder()
* var server = new Instance("server", InstanceArgs.builder()
* .ami(amiUpdate.triggers().applyValue(triggers -> triggers.amiId()))
* .tags(Map.of("ExpirationTime", amiUpdate.rfc3339()))
* .build());
*
* // ... (other aws_instance arguments) ...
* }
* }
* ```
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* This resource can be imported using the base UTC RFC3339 timestamp and offset years, months, days, hours, minutes, and seconds, separated by commas (`,`), e.g.
*
* ```sh
* $ pulumi import time:index/offset:Offset example 2020-02-12T06:36:13Z,0,0,7,0,0,0
* $ pulumi import time:index/offset:Offset example 2020-02-12T06:36:13Z,0,0,7,0,0,0
* ```
*
* The `triggers` argument cannot be imported.
* The `triggers` argument cannot be imported.
*
*/
@ResourceType(type="time:index/offset:Offset")
Expand Down
14 changes: 9 additions & 5 deletions sdk/java/src/main/java/com/pulumiverse/time/Rotating.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

/**
* ## Example Usage
*
* ### Basic Usage
*
* <!--Start PulumiCodeChooser -->
* ```java
* package generated_program;
*
Expand All @@ -40,29 +43,30 @@
* }
*
* public static void stack(Context ctx) {
* var example = new Rotating("example", RotatingArgs.builder()
* var example = new Rotating("example", RotatingArgs.builder()
* .rotationDays(30)
* .build());
*
* }
* }
* ```
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* This resource can be imported using the base UTC RFC3339 value and rotation years, months, days, hours, and minutes, separated by commas (`,`), e.g. for 30 days
*
* ```sh
* $ pulumi import time:index/rotating:Rotating example 2020-02-12T06:36:13Z,0,0,30,0,0
* $ pulumi import time:index/rotating:Rotating example 2020-02-12T06:36:13Z,0,0,30,0,0
* ```
*
* Otherwise, to import with the rotation RFC3339 value, the base UTC RFC3339 value and rotation UTC RFC3339 value, separated by commas (`,`), e.g.
* Otherwise, to import with the rotation RFC3339 value, the base UTC RFC3339 value and rotation UTC RFC3339 value, separated by commas (`,`), e.g.
*
* ```sh
* $ pulumi import time:index/rotating:Rotating example 2020-02-12T06:36:13Z,2020-02-13T06:36:13Z
* $ pulumi import time:index/rotating:Rotating example 2020-02-12T06:36:13Z,2020-02-13T06:36:13Z
* ```
*
* The `triggers` argument cannot be imported.
* The `triggers` argument cannot be imported.
*
*/
@ResourceType(type="time:index/rotating:Rotating")
Expand Down
Loading

0 comments on commit cafa309

Please sign in to comment.