Skip to content

Commit

Permalink
Change gradle configuration to do release
Browse files Browse the repository at this point in the history
  • Loading branch information
surli committed Mar 29, 2017
1 parent 79745c6 commit 19eccbb
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 0 deletions.
85 changes: 85 additions & 0 deletions build.gradle
Expand Up @@ -38,5 +38,90 @@ test {
}
}

apply from: 'nexusConfig.gradle'

ext.siteUrl = "https://github.com/SpoonLabs/spoon-gradle-plugin"

ext.commonLicense = {
name 'GNU Lesser General Public License (LGPL)'
url 'http://www.gnu.org/licenses/lgpl.html'
}

ext.devs = [
{
id 'GerardPaligot'
name 'Gerard Paligot'
email 'gerard.paligot.inria.fr'
},
{
id 'surli'
name 'Simon Urli'
email 'simon.urli@inria.fr'
},
{
id 'monperrus'
name 'Martin Monperrus'
email 'martin.monperrus@univ-lille1.fr'
},
{
id 'paillardf'
name 'Florian Paillard'
email 'paillard.f@gmail.com'
},
{
id 'petitpre'
name 'Nicolas Petitprez'
email 'nicolas.petitprez@inria.fr'
}
]


task javadocJar(type: Jar, dependsOn: groovydoc) {
classifier = 'groovydoc'
from groovydoc.destinationDir
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

artifacts {
archives javadocJar, sourcesJar
}

uploadArchives {
repositories.mavenDeployer {
pom.project {
name 'Spoon Gradle Plugin'
artifactId 'spoon-gradle-plugin'
packaging 'jar'
description 'A gradle plugin to run spoon '

url siteUrl

scm {
connection 'scm:git:https://github.com/SpoonLabs/spoon-gradle-plugin.git'
developerConnection 'scm:git:https://github.com/SpoonLabs/spoon-gradle-plugin'
url siteUrl
}

licenses {
license commonLicense
}

organization {
name 'INRIA'
url 'http://www.inria.fr'
}

developers {
devs.collect({ developer it })
}
}
}
}


group = 'fr.inria.gforge.spoon'
version ='1.0-SNAPSHOT'
46 changes: 46 additions & 0 deletions nexusConfig.gradle
@@ -0,0 +1,46 @@
// Default parameters
if (!project.hasProperty("nexusUrl")) {
ext.nexusUrl = "file:///tmp/sdkRepo"
}

if (!project.hasProperty("nexusUsername")) {
ext.nexusUsername = ""
}

if (!project.hasProperty("nexusPassword")) {
ext.nexusPassword = ""
}

ext.nexusRelease = "${nexusUrl}/service/local/staging/deploy/maven2/"
ext.nexusSnapshot = "${nexusUrl}/content/repositories/snapshots/"

private boolean signingConfigured() {
return project.hasProperty("signing.keyId") && project.hasProperty("signing.password") \
&& project.hasProperty("signing.secretKeyRingFile")
}



allprojects {
apply plugin: 'maven'
if (signingConfigured()) {
apply plugin: 'signing'
signing {
sign configurations.archives
}
}

uploadArchives.repositories.mavenDeployer {
if (signingConfigured()) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}

repository(url: nexusRelease) {
authentication(userName: nexusUsername, password: nexusPassword)
}

snapshotRepository(url: nexusSnapshot) {
authentication(userName: nexusUsername, password: nexusPassword)
}
}
}

0 comments on commit 19eccbb

Please sign in to comment.