Skip to content

Commit

Permalink
Fix travis build. Add build.gradle.deploy for releasing to maven.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbe24 committed Sep 22, 2014
1 parent 668414b commit 5f1a541
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,4 @@ branches:

# send coverage data
after_success:
- mvn clean test jacoco:report coveralls:jacoco

before_script:
- mv build.gradle build.gradle.deploy
- mv build.gradle.travis build.gradle
after_script:
- mv build.gradle build.gradle.travis
- mv build.gradle.deploy build.gradle
- mvn clean test jacoco:report coveralls:jacoco
100 changes: 100 additions & 0 deletions build.gradle.deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'signing'

sourceCompatibility = 1.7

group = 'org.beyene'
archivesBaseName = 'sius'
version = '0.2.0-SNAPSHOT'

sourceSets {
main {
java {
exclude 'org/beyene/sius/example/**'
}
}
}

jar {
manifest {
attributes 'Implementation-Title': 'Sius', 'Implementation-Version': version
}
}

repositories {
mavenCentral()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

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

tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:all'
}

artifacts {
archives sourcesJar, javadocJar
}

signing {
sign configurations.archives
}

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

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'org.beyene:sius'
packaging 'jar'
artifactId 'sius'
description 'S.I. Unit System Conversion Library'
url 'https://github.com/mbe24/sius'

scm {
connection 'scm:[email protected]:mbe24/sius.git'
developerConnection 'scm:[email protected]:mbe24/sius.git'
url 'https://github.com/mbe24/sius'
}

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id 'mbeyene'
name 'Mikael Beyene'
email '[email protected]'
}
}
}
}
}
}

0 comments on commit 5f1a541

Please sign in to comment.