summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.gradle4
-rwxr-xr-xcli/build.gradle71
-rwxr-xr-xcore/build.gradle67
-rwxr-xr-xgradle.properties10
4 files changed, 149 insertions, 3 deletions
diff --git a/build.gradle b/build.gradle
index a2b1651..ec88592 100755
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,10 @@
+description = 'A small library of string metrics and phonetic algorithms.'
group = 'org.hashtree.stringmetric'
version = '0.18.5'
+ext.scm = 'scm:git@github.com:rockymadden/stringmetric.git'
+ext.url = 'https://github.com/rockymadden/stringmetric/'
+
allprojects {
repositories {
mavenCentral()
diff --git a/cli/build.gradle b/cli/build.gradle
index 8491e97..397468d 100755
--- a/cli/build.gradle
+++ b/cli/build.gradle
@@ -1,12 +1,14 @@
apply plugin: 'eclipse'
+apply plugin: 'maven'
apply plugin: 'scala'
+apply plugin: 'signing'
+
+evaluationDependsOn(':stringmetric-core')
compileScala {
compileScala.scalaCompileOptions.additionalParameters = ['-optimise', '–Xdisable-assertions']
}
-evaluationDependsOn(':stringmetric-core')
-
dependencies {
compile project(':stringmetric-core')
compile 'org.scala-lang:scala-compiler:2.9.2'
@@ -20,6 +22,10 @@ dependencies {
testCompile 'org.scalatest:scalatest_2.9.2:1.8'
}
+signing {
+ sign configurations.archives
+}
+
sourceSets {
main {
output.resourcesDir "${project.buildDir}/classes/main"
@@ -49,6 +55,16 @@ 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}"
@@ -110,4 +126,55 @@ task tar(description: 'Assembles a compressed tar archive of source files.', dep
tarfileset(dir: workingPath, fileMode: 755, prefix: project.name)
}
}
+}
+
+artifacts {
+ archives jar
+ archives scaladocJar
+ archives sourceJar
+}
+
+def isDeployable = hasProperty('sonatypeRepositoryUrl') && hasProperty('sonatypeUsername') && hasProperty('sonatypePassword')
+
+uploadArchives {
+ repositories {
+ if(isDeployable) {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+
+ repository(url: sonatypeRepositoryUrl) {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ description "${parent.project.description}"
+ groupId "${parent.project.group}"
+ name "${project.name}"
+ packaging 'jar'
+ url "${parent.project.url}"
+ version "${parent.project.version}"
+
+ developers {
+ developer {
+ id 'rockymadden'
+ name 'Rocky Madden'
+ }
+ }
+
+ licenses {
+ license {
+ name 'Apache License v2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ url "${parent.project.scm}"
+ connection "${parent.project.scm}"
+ }
+ }
+ }
+ } else { mavenLocal() }
+ }
} \ No newline at end of file
diff --git a/core/build.gradle b/core/build.gradle
index b37daf3..de9c813 100755
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -1,5 +1,7 @@
apply plugin: 'eclipse'
+apply plugin: 'maven'
apply plugin: 'scala'
+apply plugin: 'signing'
compileScala {
compileScala.scalaCompileOptions.additionalParameters = ['-optimise', '–Xdisable-assertions']
@@ -17,6 +19,10 @@ dependencies {
testCompile 'org.scalatest:scalatest_2.9.2:1.8'
}
+signing {
+ sign configurations.archives
+}
+
sourceSets {
benchmark {
output.resourcesDir "${project.buildDir}/classes/benchmark"
@@ -57,4 +63,65 @@ sourceSets {
srcDir 'source/test/scala'
}
}
+}
+
+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
+}
+
+artifacts {
+ archives jar
+ archives scaladocJar
+ archives sourceJar
+}
+
+def isDeployable = hasProperty('sonatypeRepositoryUrl') && hasProperty('sonatypeUsername') && hasProperty('sonatypePassword')
+
+uploadArchives {
+ repositories {
+ if(isDeployable) {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+
+ repository(url: sonatypeRepositoryUrl) {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ description "${parent.project.description}"
+ groupId "${parent.project.group}"
+ name "${project.name}"
+ packaging 'jar'
+ url "${parent.project.url}"
+ version "${parent.project.version}"
+
+ developers {
+ developer {
+ id 'rockymadden'
+ name 'Rocky Madden'
+ }
+ }
+
+ licenses {
+ license {
+ name 'Apache License v2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ url "${parent.project.scm}"
+ connection "${parent.project.scm}"
+ }
+ }
+ }
+ } else { mavenLocal() }
+ }
} \ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 06b28c5..ebf7df6 100755
--- a/gradle.properties
+++ b/gradle.properties
@@ -1 +1,9 @@
-org.gradle.jvmargs=-XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m \ No newline at end of file
+org.gradle.jvmargs=-XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m
+
+signing.keyId=
+signing.password=
+signing.secretKeyRingFile=
+
+sonatypePassword=
+sonatypeRepositoryUrl=
+sonatypeUsername= \ No newline at end of file