fix(gradle): delay making decisions based on project version until it is configured.
@@ -25,6 +25,12 @@ publishing {
deducedPublishRepo = "terasology"
}
+ afterEvaluate {
+ // depends on project.version, so must be delayed until project is configured
+ if (!project.version || project.version == "unspecified") {
+ throw new GradleException("Project ${project} does not have a version set yet: ${project.version}")
+ }
+
if (project.version.toString().endsWith("-SNAPSHOT")) {
deducedPublishRepo += "-snapshot-local"
} else {
@@ -35,6 +41,7 @@ publishing {
url = "http://artifactory.terasology.org/artifactory/$deducedPublishRepo"
allowInsecureProtocol true
}
+ }
if (rootProject.hasProperty("mavenUser") && rootProject.hasProperty("mavenPass")) {
credentials {
