diff options
-rwxr-xr-x | build.gradle | 90 | ||||
-rwxr-xr-x | cli/build.gradle | 80 | ||||
-rwxr-xr-x | core/build.gradle | 81 |
3 files changed, 90 insertions, 161 deletions
diff --git a/build.gradle b/build.gradle index 9c8026e..6b6b35b 100755 --- a/build.gradle +++ b/build.gradle @@ -7,8 +7,98 @@ ext.url = 'http://rockymadden.com/stringmetric/' allprojects { apply plugin: 'idea' +} + +subprojects { + apply plugin: 'maven' + apply plugin: 'scala' + apply plugin: 'signing' + + compileScala { + compileScala.scalaCompileOptions.additionalParameters = ['-optimise', '-target:jvm-1.6', '–Xdisable-assertions'] + } + + compileTestScala { + compileTestScala.scalaCompileOptions.additionalParameters = ['-target:jvm-1.6'] + } + + dependencies { + compile 'org.scala-lang:scala-compiler:2.10.0' + compile 'org.scala-lang:scala-library:2.10.0' + + scalaTools 'org.scala-lang:scala-compiler:2.10.0' + scalaTools 'org.scala-lang:scala-library:2.10.0' + + testCompile 'junit:junit:4.11' + testCompile 'org.scalatest:scalatest_2.10.0:2.0.M5' + } repositories { mavenCentral() } + + def isMavenDeployable = hasProperty('mavenRepositoryUrl') && hasProperty('mavenRepositoryUsername') && hasProperty('mavenRepositoryPassword') + + if (isMavenDeployable) { + signing { + sign configurations.archives + } + + 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 + } + + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: mavenRepositoryUrl) { + authentication(userName: mavenRepositoryUsername, password: mavenRepositoryPassword) + } + + 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}" + } + } + } + } + } + } } diff --git a/cli/build.gradle b/cli/build.gradle index 88f961f..954da31 100755 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -1,26 +1,9 @@ -apply plugin: 'maven' -apply plugin: 'scala' -apply plugin: 'signing' - evaluationDependsOn(':stringmetric-core') -def isMavenDeployable = hasProperty('mavenRepositoryUrl') && hasProperty('mavenRepositoryUsername') && hasProperty('mavenRepositoryPassword') - -compileScala { - compileScala.scalaCompileOptions.additionalParameters = ['-optimise', '–Xdisable-assertions'] -} - dependencies { compile project(':stringmetric-core') - compile 'org.scala-lang:scala-compiler:2.9.2' - compile 'org.scala-lang:scala-library:2.9.2' - - scalaTools 'org.scala-lang:scala-compiler:2.9.2' - scalaTools 'org.scala-lang:scala-library:2.9.2' testCompile project(':stringmetric-core').sourceSets.test.output - testCompile 'junit:junit:4.10' - testCompile 'org.scalatest:scalatest_2.9.2:1.8' } sourceSets { @@ -113,67 +96,4 @@ task tar(description: 'Assembles a compressed tar archive of source files.', dep tarfileset(dir: workingPath, fileMode: 755, prefix: project.name) } } -} - -if (isMavenDeployable) { - signing { - sign configurations.archives - } - - 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 - } - - uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: mavenRepositoryUrl) { - authentication(userName: mavenRepositoryUsername, password: mavenRepositoryPassword) - } - - 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}" - } - } - } - } - } }
\ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index c88345d..6cce643 100755 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,23 +1,5 @@ -apply plugin: 'maven' -apply plugin: 'scala' -apply plugin: 'signing' - -def isMavenDeployable = hasProperty('mavenRepositoryUrl') && hasProperty('mavenRepositoryUsername') && hasProperty('mavenRepositoryPassword') - -compileScala { - compileScala.scalaCompileOptions.additionalParameters = ['-optimise', '–Xdisable-assertions'] -} - dependencies { - compile 'org.scala-lang:scala-compiler:2.9.2' - compile 'org.scala-lang:scala-library:2.9.2' - - scalaTools 'org.scala-lang:scala-compiler:2.9.2' - scalaTools 'org.scala-lang:scala-library:2.9.2' - testCompile 'com.google.caliper:caliper:0.5-rc1' - testCompile 'junit:junit:4.10' - testCompile 'org.scalatest:scalatest_2.9.2:1.8' } sourceSets { @@ -60,67 +42,4 @@ sourceSets { srcDir 'source/test/scala' } } -} - -if (isMavenDeployable) { - signing { - sign configurations.archives - } - - 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 - } - - uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: mavenRepositoryUrl) { - authentication(userName: mavenRepositoryUsername, password: mavenRepositoryPassword) - } - - 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}" - } - } - } - } - } }
\ No newline at end of file |