From 300427f104d0c6942bbb125d6088add72b1356c1 Mon Sep 17 00:00:00 2001 From: jerronjames Date: Tue, 6 Oct 2015 15:55:36 -0600 Subject: [PATCH] Gradle Deployment #80 --- .gitignore | 1 + build.gradle | 36 ++++++++++++++++++++++++++---------- deploy.gradle | 27 +++++++++++++++++++++++++++ gradle.properties | 4 ++++ 4 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 deploy.gradle create mode 100644 gradle.properties diff --git a/.gitignore b/.gitignore index a2415d1c1..cf016497e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /.project /.settings/ .gradle/**/* +/build diff --git a/build.gradle b/build.gradle index 3145ddc64..7515120e2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,37 @@ +buildscript { + repositories { + mavenLocal() + jcenter { + url "http://jcenter.bintray.com/" + } + maven { url "http://oss.sonatype.org/content/repositories/snapshots/" } + } + dependencies { + classpath 'com.bmuschko:gradle-nexus-plugin:2.3' + classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3" + } + } + +plugins { + id 'java' + id 'com.github.johnrengelman.shadow' version '1.2.2' +} + +apply plugin: "base" +apply plugin: "signing" +apply plugin: "com.bmuschko.nexus" + apply plugin: 'java' apply plugin: 'maven' apply from: 'cobertura.gradle' - -group = 'com.github.cflint' -version = '0.5.0' - -description = """CFLint""" +apply from: 'deploy.gradle' sourceCompatibility = 1.7 targetCompatibility = 1.7 - - repositories { - - maven { url "https://oss.sonatype.org/content/repositories/snapshots" } - maven { url "http://repo.maven.apache.org/maven2" } + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } + maven { url "http://repo.maven.apache.org/maven2" } } dependencies { compile group: 'com.github.cfparser', name: 'cfparser', version:'2.0.0' diff --git a/deploy.gradle b/deploy.gradle new file mode 100644 index 000000000..aa8758b27 --- /dev/null +++ b/deploy.gradle @@ -0,0 +1,27 @@ +configurations { + jaxDoclet +} + +nexus { + sign = true + repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' + snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' +} + +task deploy() { + def updatedVersion = version + if (project.hasProperty("version")) { + ant.propertyfile( + file: "gradle.properties") { + entry( key: "version", value: "$version") + } + } + if (project.hasProperty("snapshot")) { + ant.propertyfile( + file: "gradle.properties") { + entry( key: "version", value: "$version-SNAPSHOT") + } + } +} + +uploadArchives.mustRunAfter deploy diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..3ee403bca --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +#Tue, 06 Oct 2015 15:51:31 -0600 +group=com.github.cflint +version=0.5.0 +name=CFLint