From c7b576e450f9878a1f916ef48dcec141665d002f Mon Sep 17 00:00:00 2001 From: Rocky Madden Date: Mon, 10 Dec 2012 20:18:23 -0700 Subject: Added Maven Central integration. --- core/build.gradle | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'core/build.gradle') 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 -- cgit v1.2.3