-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
latest jmad-core. Deployment scripts
- Loading branch information
1 parent
8712db9
commit 41a6e7b
Showing
2 changed files
with
121 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
project.ext.getDeploymentVersion = { | ||
if(VCS_TAG == null) { | ||
throw new RuntimeException("VCS_TAG is not set. Cannot detect deployment version") | ||
} | ||
String tmpDeploymentVersion = VCS_TAG.replaceFirst("v", ""); | ||
if (!tmpDeploymentVersion.matches("\\d+\\.\\d+\\.\\d+")) { | ||
throw new RuntimeException("Version is not valid. Correct format is like 1.0.2 but was " + tmpDeploymentVersion) | ||
} | ||
return tmpDeploymentVersion; | ||
} | ||
|
||
bintrayUpload.doFirst { | ||
println "Deploying version ${getDeploymentVersion()} from vscTag ${VCS_TAG}" | ||
} | ||
|
||
bintray { | ||
user = "${BINTRAY.userName}" | ||
key = "${BINTRAY.apiToken}" | ||
|
||
publications = ['CustomMavenPublication'] | ||
// When uploading Maven-based publication files. Nebula is because we're using the netflix plugins and they use nebula as default name for a publication | ||
dryRun = !DEPLOYMENT // Whether to run this as dry-run, without deploying | ||
publish = DEPLOYMENT // Whether version should be auto published after an upload | ||
override = false // Whether to override version artifacts already published | ||
|
||
pkg { | ||
repo = "${BINTRAY.repo}" | ||
name = "${BINTRAY.name}" | ||
userOrg = "${BINTRAY.organization}" | ||
websiteUrl = "${INFO.github}" | ||
issueTrackerUrl = "${INFO.githubIssues}" | ||
vcsUrl = "${INFO.repo}" | ||
licenses = [INFO.licenseNameShort] | ||
|
||
version { | ||
name = getDeploymentVersion() | ||
released = new Date() | ||
vcsTag = VCS_TAG | ||
gpg { sign = true } | ||
} | ||
} | ||
} | ||
|
||
def pomExtraInfo = { | ||
url INFO.url | ||
scm { | ||
connection "scm:git:${INFO.repo}" | ||
developerConnection "scm:git:${INFO.repo}" | ||
url INFO.repo | ||
} | ||
licenses { | ||
license { | ||
name INFO.licenseName | ||
url INFO.licenseUrl | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
CustomMavenPublication(MavenPublication) { | ||
groupId POM.groupId | ||
artifactId POM.artifactId | ||
version getDeploymentVersion() | ||
|
||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
pom.withXml { | ||
asNode().appendNode('description', POM.description) | ||
asNode().children().last() + pomExtraInfo | ||
} | ||
|
||
from components.java | ||
} | ||
} | ||
} |