-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from conductor-oss/fix/client-v4-gradle-confi…
…g-cleanup [Java Client v4] Gradle config refactoring
- Loading branch information
Showing
11 changed files
with
143 additions
and
368 deletions.
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
12 changes: 12 additions & 0 deletions
12
conductor-clients/java/conductor-java-sdk/buildSrc/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,12 @@ | ||
plugins { | ||
id 'groovy' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation gradleApi() | ||
implementation localGroovy() | ||
} |
83 changes: 83 additions & 0 deletions
83
...or-java-sdk/buildSrc/src/main/groovy/io/orkes/conductor/gradle/PublishConfigPlugin.groovy
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,83 @@ | ||
package io.orkes.conductor.gradle | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.authentication.aws.AwsImAuthentication | ||
|
||
|
||
class PublishConfigPlugin implements Plugin<Project> { | ||
@Override | ||
void apply(Project project) { | ||
project.plugins.withType(MavenPublishPlugin) { | ||
config(project) | ||
} | ||
} | ||
|
||
private void config(Project project) { | ||
project.publishing { | ||
publications(publicationConfig(project)) | ||
repositories(repositoriesConfig(project)) | ||
} | ||
} | ||
|
||
private publicationConfig(Project project) { | ||
return { | ||
mavenJava(MavenPublication) { | ||
from project.components.java | ||
pom { | ||
name = project.findProperty('artifactName') | ||
description = project.findProperty('artifactDescription') | ||
url = 'https://github.com/conductor-oss/conductor.git' | ||
scm { | ||
connection = 'scm:git:git://github.com/conductor-oss/conductor.git' | ||
developerConnection = 'scm:git:ssh://github.com/conductor-oss/conductor.git' | ||
url = 'https://github.com/conductor-oss/conductor.git' | ||
} | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
organization = 'Orkes' | ||
organizationUrl = 'https://orkes.io' | ||
name = 'Orkes Development Team' | ||
email = '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
private repositoriesConfig(Project project) { | ||
return { | ||
maven { | ||
if (project.hasProperty("mavenCentral")) { | ||
url = getMavenRepoUrl(project) | ||
credentials { | ||
username = project.properties['username'] | ||
password = project.properties['password'] | ||
} | ||
} else { | ||
url = getS3BucketUrl(project) | ||
authentication { | ||
awsIm(AwsImAuthentication) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
private static String getS3BucketUrl(Project project) { | ||
return "s3://orkes-artifacts-repo/${project.version.endsWith('-SNAPSHOT') ? 'snapshots' : 'releases'}" | ||
} | ||
|
||
private static String getMavenRepoUrl(Project project) { | ||
return "https://s01.oss.sonatype.org/${project.version.endsWith('-SNAPSHOT') ? 'content/repositories/snapshots/' : 'service/local/staging/deploy/maven2/'}" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...or-java-sdk/buildSrc/src/main/resources/META-INF/gradle-plugins/publish-config.properties
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 @@ | ||
implementation-class=io.orkes.conductor.gradle.PublishConfigPlugin |
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 |
---|---|---|
|
@@ -5,6 +5,13 @@ plugins { | |
id 'signing' | ||
} | ||
|
||
ext { | ||
artifactName = 'Conductor Client Metrics' | ||
artifactDescription = 'Conductor Client Metrics' | ||
} | ||
|
||
apply plugin: 'publish-config' | ||
|
||
dependencies { | ||
implementation 'io.micrometer:micrometer-registry-prometheus:1.10.5' | ||
implementation project(":conductor-client") | ||
|
@@ -19,72 +26,6 @@ java { | |
withJavadocJar() | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
pom { | ||
name = 'Orkes Conductor Metrics module' | ||
description = 'OSS & Orkes Conductor Metrics' | ||
url = 'https://github.com/conductor-oss/conductor.git' | ||
scm { | ||
connection = 'scm:git:git://github.com/conductor-oss/conductor.git' | ||
developerConnection = 'scm:git:ssh://github.com/conductor-oss/conductor.git' | ||
url = 'https://github.com/conductor-oss/conductor.git' | ||
} | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
organization = 'Orkes' | ||
organizationUrl = 'https://orkes.io' | ||
name = 'Orkes Development Team' | ||
email = '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
if (project.hasProperty("mavenCentral")) { | ||
println "Publishing to Sonatype Repository" | ||
url = "https://s01.oss.sonatype.org/${project.version.endsWith('-SNAPSHOT') ? "content/repositories/snapshots/" : "service/local/staging/deploy/maven2/"}" | ||
credentials { | ||
username project.properties.username | ||
password project.properties.password | ||
} | ||
} else { | ||
url = "s3://orkes-artifacts-repo/${project.version.endsWith('-SNAPSHOT') ? "snapshots" : "releases"}" | ||
authentication { | ||
awsIm(AwsImAuthentication) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
def signingKeyId = findProperty('signingKeyId') | ||
if (signingKeyId) { | ||
println 'Signing the artifact with keys' | ||
signing { | ||
def signingKey = findProperty('signingKey') | ||
def signingPassword = findProperty('signingPassword') | ||
if (signingKeyId && signingKey && signingPassword) { | ||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
} | ||
|
||
sign publishing.publications | ||
} | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
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 |
---|---|---|
|
@@ -5,6 +5,13 @@ plugins { | |
id 'signing' | ||
} | ||
|
||
ext { | ||
artifactName = 'Conductor OSS Client Spring' | ||
artifactDescription = 'Spring autoconfig for Conductor Client and SDK' | ||
} | ||
|
||
apply plugin: 'publish-config' | ||
|
||
compileJava { | ||
sourceCompatibility = 17 | ||
targetCompatibility = 17 | ||
|
@@ -21,56 +28,6 @@ dependencies { | |
implementation 'org.springframework.boot:spring-boot-starter:3.3.0' | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
pom { | ||
name = 'Conductor OSS Client Spring' | ||
description = 'Spring autoconfig for Conductor Client and SDK' | ||
url = 'https://github.com/conductor-oss/conductor.git' | ||
scm { | ||
connection = 'scm:git:git://github.com/conductor-oss/conductor.git' | ||
developerConnection = 'scm:git:ssh://github.com/conductor-oss/conductor.git' | ||
url = 'https://github.com/conductor-oss/conductor.git' | ||
} | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
organization = 'Orkes' | ||
organizationUrl = 'https://orkes.io' | ||
name = 'Orkes Development Team' | ||
email = '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
if (project.hasProperty("mavenCentral")) { | ||
println "Publishing to Sonatype Repository" | ||
url = "https://s01.oss.sonatype.org/${project.version.endsWith('-SNAPSHOT') ? "content/repositories/snapshots/" : "service/local/staging/deploy/maven2/"}" | ||
credentials { | ||
username project.properties.username | ||
password project.properties.password | ||
} | ||
} else { | ||
url = "s3://orkes-artifacts-repo/${project.version.endsWith('-SNAPSHOT') ? "snapshots" : "releases"}" | ||
authentication { | ||
awsIm(AwsImAuthentication) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
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 |
---|---|---|
|
@@ -7,6 +7,13 @@ plugins { | |
id 'groovy' | ||
} | ||
|
||
ext { | ||
artifactName = 'Conductor Client' | ||
artifactDescription = 'Conductor OSS client (http)' | ||
} | ||
|
||
apply plugin: 'publish-config' | ||
|
||
dependencies { | ||
implementation "com.squareup.okhttp3:okhttp:${versions.okHttp}" | ||
|
||
|
@@ -27,72 +34,6 @@ java { | |
withJavadocJar() | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
pom { | ||
name = 'Conductor Client' | ||
description = 'Conductor OSS client (http)' | ||
url = 'https://github.com/conductor-oss/conductor.git' | ||
scm { | ||
connection = 'scm:git:git://github.com/conductor-oss/conductor.git' | ||
developerConnection = 'scm:git:ssh://github.com/conductor-oss/conductor.git' | ||
url = 'https://github.com/conductor-oss/conductor.git' | ||
} | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
organization = 'Orkes' | ||
organizationUrl = 'https://orkes.io' | ||
name = 'Orkes Development Team' | ||
email = '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
if (project.hasProperty("mavenCentral")) { | ||
println "Publishing to Sonatype Repository" | ||
url = "https://s01.oss.sonatype.org/${project.version.endsWith('-SNAPSHOT') ? "content/repositories/snapshots/" : "service/local/staging/deploy/maven2/"}" | ||
credentials { | ||
username project.properties.username | ||
password project.properties.password | ||
} | ||
} else { | ||
url = "s3://orkes-artifacts-repo/${project.version.endsWith('-SNAPSHOT') ? "snapshots" : "releases"}" | ||
authentication { | ||
awsIm(AwsImAuthentication) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
def signingKeyId = findProperty('signingKeyId') | ||
if (signingKeyId) { | ||
println 'Signing the artifact with keys' | ||
signing { | ||
def signingKey = findProperty('signingKey') | ||
def signingPassword = findProperty('signingPassword') | ||
if (signingKeyId && signingKey && signingPassword) { | ||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
} | ||
|
||
sign publishing.publications | ||
} | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,9 +2,6 @@ plugins { | |
id 'java' | ||
} | ||
|
||
group 'io.orkes.conductor' | ||
version '3.0.0' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
Oops, something went wrong.