-
Notifications
You must be signed in to change notification settings - Fork 15
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
445 changed files
with
1,420 additions
and
809 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
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,19 @@ | ||
/* | ||
* ****************************************************************************** | ||
* Copyright 2002 Spectra Logic Corporation. All Rights Reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. | ||
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | ||
* CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* **************************************************************************** | ||
*/ | ||
|
||
tasks.wrapper { | ||
// to upgrade the gradle wrapper, bump the version below and run ./gradlew wrapper twice | ||
gradleVersion = "8.3" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* **************************************************************************** | ||
* Copyright 2023 Spectra Logic Corporation. All Rights Reserved. | ||
* *************************************************************************** | ||
*/ | ||
|
||
rootProject.name = "buildSrc" | ||
|
||
dependencyResolutionManagement { | ||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../libs.versions.toml")) | ||
} | ||
} | ||
} | ||
} |
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
107 changes: 107 additions & 0 deletions
107
buildSrc/src/main/kotlin/ds3-java-sdk-publishing-common-convention.gradle.kts
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,107 @@ | ||
import org.gradle.api.publish.maven.MavenPublication | ||
|
||
/* | ||
* ****************************************************************************** | ||
* Copyright 2002 Spectra Logic Corporation. All Rights Reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. | ||
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | ||
* CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* **************************************************************************** | ||
*/ | ||
|
||
plugins { | ||
`maven-publish` | ||
signing | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "internal" | ||
val releasesRepoUrl = "https://artifacts.eng.sldomain.com/repository/spectra-releases/" | ||
val snapshotsRepoUrl = "https://artifacts.eng.sldomain.com/repository/spectra-snapshots/" | ||
url = uri(if (extra["isReleaseVersion"] as Boolean) releasesRepoUrl else snapshotsRepoUrl) | ||
credentials { | ||
username = extra.has("artifactsUsername").let { | ||
if (it) extra.get("artifactsUsername") as String else null | ||
} | ||
password = extra.has("artifactsPassword").let { | ||
if (it) extra.get("artifactsPassword") as String else null | ||
} | ||
} | ||
} | ||
maven { | ||
name = "OSSRH" | ||
val releasesOssrhRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
val snapshotsOssrhRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
url = uri(if (extra["isReleaseVersion"] as Boolean) releasesOssrhRepoUrl else snapshotsOssrhRepoUrl) | ||
credentials { | ||
username = extra.has("ossrhUsername").let { | ||
if (it) extra.get("ossrhUsername") as String else null | ||
} | ||
password = extra.has("ossrhPassword").let { | ||
if (it) extra.get("ossrhPassword") as String else null | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks.register("publishToInternalRepository") { | ||
group = "publishing" | ||
description = "Publishes all Maven publications to the internal Maven repository." | ||
dependsOn(tasks.withType<PublishToMavenRepository>().matching { | ||
it.repository == publishing.repositories["internal"] | ||
}) | ||
} | ||
|
||
tasks.register("publishToSonatypeOSSRH") { | ||
group = "publishing" | ||
description = "Publishes all Maven publications to Sonatype's OSSRH repository." | ||
dependsOn(tasks.withType<PublishToMavenRepository>().matching { | ||
it.repository == publishing.repositories["OSSRH"] | ||
}) | ||
} | ||
|
||
val augmentPom = tasks.register("augmentPom") { | ||
publishing.publications.filterIsInstance<MavenPublication>().forEach { pub -> | ||
pub.pom { | ||
name.set("${project.group}:${project.name}") | ||
url.set("https://github.com/SpectraLogic/ds3_java_sdk") | ||
description.set("${project.description}") | ||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
developers { | ||
developer { | ||
name.set("Spectra Logic Developers") | ||
email.set("[email protected]") | ||
organization.set("Spectra Logic") | ||
organizationUrl.set("https://spectralogic.com/") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:https://github.com/SpectraLogic/ds3_java_sdk.git") | ||
developerConnection.set("scm:git:https://github.com/SpectraLogic/ds3_java_sdk.git") | ||
url.set("https://github.com/SpectraLogic/ds3_java_sdk") | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<GenerateMavenPom>().configureEach { | ||
dependsOn(augmentPom) | ||
} | ||
|
||
tasks.withType<Sign>().configureEach { | ||
onlyIf("isReleaseVersion is set") { project.extra["isReleaseVersion"] as Boolean } | ||
} |
Oops, something went wrong.