Skip to content
Snippets Groups Projects
Commit f6346b06 authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

fixed problems when releasing to nexus repository

parent 283d43dd
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,6 @@ targetCompatibility=1.7 ...@@ -48,7 +48,6 @@ targetCompatibility=1.7
* "Building RELEASE version 0.2.3") * "Building RELEASE version 0.2.3")
*/ */
ext { ext {
isRelease = false isRelease = false
} }
...@@ -72,15 +71,32 @@ gradle.taskGraph.whenReady {taskGraph -> ...@@ -72,15 +71,32 @@ gradle.taskGraph.whenReady {taskGraph ->
if (version.endsWith('-SNAPSHOT')) { if (version.endsWith('-SNAPSHOT')) {
println "Building SNAPSHOT version $version" println "Building SNAPSHOT version $version"
cargo.deployable {
context = 'testing'
}
} else { } else {
isRelease = true;
println "Building RELEASE version $version" println "Building RELEASE version $version"
cargo.deployable { isRelease = true;
context = 'isochrone' }
}
// fixed lazy versioning for cargo plugin
cargo.deployable {
context = "${isRelease ? 'isochrone' : 'testing'}"
}
// fixes lazy versioning for maven-publish plugin
project.tasks.withType(PublishToMavenRepository) { publishTask ->
def oldArtifacts = publishTask.publication.artifacts.toArray()
publishTask.publication.artifacts.clear()
oldArtifacts.each({ artifact ->
publishTask.publication.artifacts.artifact(
source: artifact.file.getAbsolutePath().replaceAll(publishTask.publication.version, project.version),
classifier: artifact.classifier,
extension: artifact.extension
)
})
publishTask.repository.url repositoryPrefix + "${isRelease ? 'releases' : 'snapshots'}"
publishTask.publication.version = project.version
}
project.tasks.withType(GenerateMavenPom).each { generateMavenPomTask ->
generateMavenPomTask.pom.getProjectIdentity().version = project.version
} }
} }
...@@ -156,7 +172,7 @@ cargo { ...@@ -156,7 +172,7 @@ cargo {
containerId = cargoContainer containerId = cargoContainer
port = cargoPort as int port = cargoPort as int
// deployable part is set by versioning above // deployable block is set by versioning above
remote { remote {
hostname = cargoHostname hostname = cargoHostname
...@@ -270,7 +286,7 @@ publishing { ...@@ -270,7 +286,7 @@ publishing {
username repositoryUsername username repositoryUsername
password repositoryPassword password repositoryPassword
} }
url repositoryPrefix + "${isRelease ? 'releases' : 'snapshots'}" // url is configured in versioning part
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment