From c0db60eef9a20484d1a20a8b61bd376cbbf9dfd3 Mon Sep 17 00:00:00 2001 From: Rocky Madden Date: Thu, 10 Jan 2013 14:04:39 -0700 Subject: Signing and Maven code must be located in subproject Gradle build. --- cli/build.gradle | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'cli') diff --git a/cli/build.gradle b/cli/build.gradle index 954da31..c0d1b89 100755 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -1,3 +1,8 @@ +apply plugin: 'maven' +apply plugin: 'signing' + +def isMavenDeployable = hasProperty('mavenRepositoryUrl') && hasProperty('mavenRepositoryUsername') && hasProperty('mavenRepositoryPassword') + evaluationDependsOn(':stringmetric-core') dependencies { @@ -96,4 +101,67 @@ 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 -- cgit v1.2.3