-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
37 lines (33 loc) · 1.29 KB
/
build.gradle.kts
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
plugins {
id("ca.cutterslade.analyze") version "1.9.0"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
group = "software.momento.java"
allprojects {
apply(plugin = "ca.cutterslade.analyze")
}
// Spotless plugin used for Java Formatting needs the buildscript with repository
// to be defined in the ROOT_PROJECT
// https://github.com/diffplug/spotless/issues/747
buildscript {
repositories {
mavenCentral()
}
}
// Only configure the nexus publishing plugin if we have credentials and the version is publishable.
private val sonatypeUsername: String? = System.getenv("SONATYPE_USERNAME")
private val sonatypePassword: String? = System.getenv("SONATYPE_PASSWORD")
if (sonatypeUsername != null && sonatypePassword != null) {
if (version.toString() != "unspecified" && !version.toString().endsWith("SNAPSHOT")) {
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}
}
}