Skip to content

Commit b3409eb

Browse files
committed
Wrap with beforeEvaluate
1 parent e5f10e2 commit b3409eb

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

build.gradle.kts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,19 @@ publishing {
123123
}
124124
}
125125

126-
if (!project.version.toString().endsWith("SNAPSHOT")) {
127-
maven {
128-
name = "Local"
129-
url = uri(project.layout.buildDirectory.dir("staging-deploy"))
130-
}
131-
} else {
132-
maven {
133-
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
134-
credentials {
135-
username = System.getenv("MAVEN_CENTRAL_USERNAME")
136-
password = System.getenv("MAVEN_CENTRAL_PASSWORD")
126+
beforeEvaluate {
127+
if (!project.version.toString().endsWith("SNAPSHOT")) {
128+
maven {
129+
name = "Local"
130+
url = uri(project.layout.buildDirectory.dir("staging-deploy"))
131+
}
132+
} else {
133+
maven {
134+
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
135+
credentials {
136+
username = System.getenv("MAVEN_CENTRAL_USERNAME")
137+
password = System.getenv("MAVEN_CENTRAL_PASSWORD")
138+
}
137139
}
138140
}
139141
}

0 commit comments

Comments
 (0)