generated from pulumi/pulumi-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathbuild.gradle
More file actions
153 lines (131 loc) · 4.31 KB
/
build.gradle
File metadata and controls
153 lines (131 loc) · 4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// *** 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")
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}
group = "com.pulumi"
def resolvedVersion = System.getenv("PACKAGE_VERSION") ?:
(project.version == "unspecified"
? "0.0.1"
: project.version)
def signingKey = System.getenv("SIGNING_KEY")
def signingPassword = System.getenv("SIGNING_PASSWORD")
def publishRepoURL = System.getenv("PUBLISH_REPO_URL") ?: "https://s01.oss.sonatype.org"
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 {
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:0.18.0")
}
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 = "command"
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 = "command"
version = resolvedVersion
from components.java
artifact sourcesJar
artifact javadocJar
pom {
inceptionYear = "2022"
name = "pulumi-command"
packaging = "jar"
description = "The Pulumi Command Provider enables you to execute commands and scripts either locally or remotely as part of the Pulumi resource model."
url = "https://github.com/pulumi/pulumi-command"
scm {
connection = "git@github.com/pulumi/pulumi-command.git"
developerConnection = "git@github.com/pulumi/pulumi-command.git"
url = "https://github.com/pulumi/pulumi-command"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "pulumi"
name = "Pulumi"
email = "support@pulumi.com"
}
}
}
}
}
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
options.jFlags("-Xmx8g", "-Xms512m")
}
jar {
zip64 = true
}
if (publishRepoUsername) {
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri(publishRepoURL + "/service/local/"))
snapshotRepositoryUrl.set(uri(publishRepoURL + "/content/repositories/snapshots/"))
username = publishRepoUsername
password = publishRepoPassword
}
}
}
}
if (signingKey) {
signing {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mainPublication
}
}