summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2012-12-11 10:17:35 -0700
committerRocky Madden <git@rockymadden.com>2012-12-11 10:17:35 -0700
commit456af9c718c0173c37c754a7276948d0d694fb59 (patch)
tree3cab8a8db4676949df9efdc8095bb8a5be37eae6 /cli
parentaeea02eae077fc8bb916c962539c2b3db5383606 (diff)
downloadstringmetric-456af9c718c0173c37c754a7276948d0d694fb59.tar.gz
stringmetric-456af9c718c0173c37c754a7276948d0d694fb59.tar.bz2
stringmetric-456af9c718c0173c37c754a7276948d0d694fb59.zip
Restructured to more gracefully handle for Maven Repository deployment.
Diffstat (limited to 'cli')
-rwxr-xr-xcli/build.gradle52
1 files changed, 26 insertions, 26 deletions
diff --git a/cli/build.gradle b/cli/build.gradle
index 397468d..c7b3ec6 100755
--- a/cli/build.gradle
+++ b/cli/build.gradle
@@ -5,6 +5,8 @@ apply plugin: 'signing'
evaluationDependsOn(':stringmetric-core')
+def isMavenDeployable = hasProperty('mavenRepositoryUrl') && hasProperty('mavenRepositoryUsername') && hasProperty('mavenRepositoryPassword')
+
compileScala {
compileScala.scalaCompileOptions.additionalParameters = ['-optimise', '–Xdisable-assertions']
}
@@ -22,10 +24,6 @@ dependencies {
testCompile 'org.scalatest:scalatest_2.9.2:1.8'
}
-signing {
- sign configurations.archives
-}
-
sourceSets {
main {
output.resourcesDir "${project.buildDir}/classes/main"
@@ -55,16 +53,6 @@ sourceSets {
}
}
-task scaladocJar(type: Jar, dependsOn: scaladoc) {
- classifier = 'javadoc'
- from "${project.buildDir}/docs/scaladoc"
-}
-
-task sourceJar(type: Jar, dependsOn: classes) {
- classifier = 'sources'
- from sourceSets.main.allSource
-}
-
task tar(description: 'Assembles a compressed tar archive of source files.', dependsOn: [':stringmetric-cli:jar', ':stringmetric-core:jar']) {
ext.sourcePath = "${project.projectDir}/source/core/scala"
ext.outputPath = "${project.buildDir}"
@@ -128,22 +116,34 @@ task tar(description: 'Assembles a compressed tar archive of source files.', dep
}
}
-artifacts {
- archives jar
- archives scaladocJar
- archives sourceJar
-}
+if (isMavenDeployable) {
+ signing {
+ sign configurations.archives
+ }
+
+ task scaladocJar(type: Jar, dependsOn: scaladoc) {
+ classifier = 'javadoc'
+ from "${project.buildDir}/docs/scaladoc"
+ }
-def isDeployable = hasProperty('sonatypeRepositoryUrl') && hasProperty('sonatypeUsername') && hasProperty('sonatypePassword')
+ task sourceJar(type: Jar, dependsOn: classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+ }
-uploadArchives {
- repositories {
- if(isDeployable) {
+ artifacts {
+ archives jar
+ archives scaladocJar
+ archives sourceJar
+ }
+
+ uploadArchives {
+ repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
- repository(url: sonatypeRepositoryUrl) {
- authentication(userName: sonatypeUsername, password: sonatypePassword)
+ repository(url: mavenRepositoryUrl) {
+ authentication(userName: mavenRepositoryUsername, password: mavenRepositoryPassword)
}
pom.project {
@@ -175,6 +175,6 @@ uploadArchives {
}
}
}
- } else { mavenLocal() }
+ }
}
} \ No newline at end of file