forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
80 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
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 |
---|---|---|
@@ -1,15 +1,10 @@ | ||
import io.github.gradlenexus.publishplugin.CloseNexusStagingRepository | ||
import io.github.gradlenexus.publishplugin.ReleaseNexusStagingRepository | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
id("com.gradle.plugin-publish") version "1.1.0" | ||
id("io.github.gradle-nexus.publish-plugin") version "1.1.0" | ||
id("java-gradle-plugin") | ||
id("maven-publish") | ||
id("org.gradle.kotlin.kotlin-dsl") version "2.4.1" | ||
id("org.jetbrains.kotlin.jvm") version "1.7.10" | ||
id("signing") | ||
} | ||
|
||
group = "com.equisoft.openapitools" | ||
|
@@ -34,12 +29,16 @@ repositories { | |
mavenLocal() | ||
mavenCentral() | ||
maven { | ||
name = "equisoft-openapi-generators" | ||
url = uri("https://maven.pkg.github.com/kronostechnologies/openapi-generators") | ||
} | ||
maven { | ||
name = "Sonatype Snapshots" | ||
url "https://oss.sonatype.org/content/repositories/snapshots/" | ||
name "equisoft-openapi-generator-gradle-plugin" | ||
url "https://maven.pkg.github.com/kronostechnologies/openapi-generator" | ||
credentials { | ||
username = project.findProperty("gpr.user")?.toString() | ||
?: System.getenv("GPR_USER") | ||
?: System.getenv("GHCR_USER") | ||
password = project.findProperty("gpr.key")?.toString() | ||
?: System.getenv("GPR_KEY") | ||
?: System.getenv("GHCR_TOKEN") | ||
} | ||
} | ||
} | ||
|
||
|
@@ -77,20 +76,13 @@ tasks.withType(Javadoc).configureEach { | |
} | ||
} | ||
|
||
tasks.withType(CloseNexusStagingRepository).configureEach { | ||
onlyIf { nexusPublishing.useStaging.get() } | ||
} | ||
|
||
tasks.withType(ReleaseNexusStagingRepository).configureEach { | ||
onlyIf { nexusPublishing.useStaging.get() } | ||
} | ||
|
||
gradlePlugin { | ||
website = "https://openapi-generator.tech/" | ||
vcsUrl = "https://github.com/OpenAPITools/openapi-generator" | ||
group = "com.equisoft.openapitools" | ||
plugins { | ||
openApiGenerator { | ||
id = "org.openapi.generator" | ||
id = "com.equisoft.openapitools" | ||
description = "OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)." | ||
displayName = "OpenAPI Generator Gradle Plugin" | ||
implementationClass = "org.openapitools.generator.gradle.plugin.OpenApiGeneratorPlugin" | ||
|
@@ -99,69 +91,21 @@ gradlePlugin { | |
} | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
username = project.properties["ossrhUsername"] | ||
password = project.properties["ossrhPassword"] | ||
|
||
// To retrieve: ./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="$SIGNING_SECRET" getStagingProfile | ||
stagingProfileId = "456297f829bbbe" | ||
} | ||
} | ||
} | ||
|
||
// Signing requires three keys to be defined: signing.keyId, signing.password, and signing.secretKeyRingFile. | ||
// These can be passed to the Gradle command: | ||
// ./gradlew -Psigning.keyId=yourid | ||
// or stored as key=value pairs in ~/.gradle/gradle.properties | ||
// You can also apply them in CI via environment variables. See Gradle's docs for details. | ||
signing { | ||
required { isReleaseVersion && gradle.taskGraph.hasTask("publishPluginMavenPublicationToSonatypeRepository") } | ||
sign(publishing.publications) | ||
} | ||
|
||
// afterEvaluate is necessary because java-gradle-plugin | ||
// creates its publications in an afterEvaluate callback | ||
afterEvaluate { | ||
tasks.named("publishToSonatype").configure { | ||
dependsOn("check") | ||
} | ||
|
||
publishing { | ||
publications { | ||
pluginMaven { | ||
pom { | ||
name = "OpenAPI-Generator Contributors" | ||
description = project.description | ||
url = "https://openapi-generator.tech" | ||
organization { | ||
name = "org.openapitools" | ||
url = "https://github.com/OpenAPITools" | ||
} | ||
licenses { | ||
license { | ||
name = "The Apache Software License, Version 2.0" | ||
url = "https://www.apache.org/licenses/LICENSE-2.0.txt" | ||
distribution = "repo" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "openapitools" | ||
name = "OpenAPI-Generator Contributors" | ||
email = "[email protected]" | ||
} | ||
} | ||
scm { | ||
url = "https://github.com/OpenAPITools/openapi-generator" | ||
connection = "scm:git:git://github.com/OpenAPITools/openapi-generator.git" | ||
developerConnection = "scm:git:ssh://[email protected]:OpenAPITools/openapi-generator.git" | ||
} | ||
issueManagement { | ||
system = "GitHub" | ||
url = "https://github.com/OpenAPITools/openapi-generator/issues" | ||
} | ||
repositories { | ||
maven { | ||
name "equisoft-openapi-generator-gradle-plugin" | ||
url "https://maven.pkg.github.com/kronostechnologies/openapi-generator" | ||
credentials { | ||
username = project.findProperty("gpr.write.user")?.toString() | ||
?: System.getenv("GPR_USER") | ||
?: System.getenv("GHCR_USER") | ||
password = project.findProperty("gpr.write.key")?.toString() | ||
?: System.getenv("GPR_KEY") | ||
?: System.getenv("GHCR_TOKEN") | ||
} | ||
} | ||
} | ||
|