From 7875c1bd6abea874f52d0db81a784f179d02b6d1 Mon Sep 17 00:00:00 2001 From: Shekhar Gulati Date: Sun, 22 May 2016 20:48:58 +0530 Subject: [PATCH] added release plugins and travis.yml --- .travis.yml | 7 +++++ build.gradle | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8f2537b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: java +install: ./gradlew assemble -x :signArchives +script: ./gradlew clean build -x :signArchives +jdk: + - oraclejdk8 +after_success: + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/build.gradle b/build.gradle index 0568b64..49ec4b1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,14 @@ +plugins { + id 'net.researchgate.release' version '2.3.3' +} + group 'com.shekhargulati' version '0.1.0-SNAPSHOT' apply plugin: 'java' +apply plugin: 'maven-publish' +apply plugin: 'signing' +apply plugin: "jacoco" sourceCompatibility = 1.8 @@ -14,3 +21,75 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' testCompile 'org.hamcrest:hamcrest-all:1.3' } + + +uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: System.getenv('OSS_USER'), password: System.getenv('OSS_PASSWORD')) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: System.getenv('OSS_USER'), password: System.getenv('OSS_PASSWORD')) + } + + pom.project { + name 'strman' + packaging 'jar' + artifactId 'strman' + description 'A Java 8 library for working with String' + url 'https://github.com/shekhargulati/strman-java' + + scm { + connection 'https://github.com/shekhargulati/strman-java.git' + developerConnection 'https://github.com/shekhargulati/strman-java.git' + url 'https://github.com/shekhargulati/strman-java.git' + } + + licenses { + license { + name 'MIT' + } + } + + developers { + developer { + id 'shekhargulati' + name 'Shekhar Gulati' + email 'shekhargulati84@gmail.com' + } + } + } + } + } +} + +task javadocJar(type: Jar) { + classifier = 'javadoc' + from javadoc +} + +task sourcesJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives javadocJar, sourcesJar +} + +signing { + sign configurations.archives +} + +jacocoTestReport { + reports { + xml.enabled = true + html.enabled = true + } +} + +check.dependsOn jacocoTestReport \ No newline at end of file