diff --git a/build.gradle b/build.gradle index 0b57642..5842380 100644 --- a/build.gradle +++ b/build.gradle @@ -29,10 +29,12 @@ description = 'Smart REST Client - JAX-RS (Jersey) REST client that provides cli ext.githubProjectName = 'smart-client-java' buildscript { - apply from: "ecs-publish.buildscript.gradle", to: buildscript + ext.commonBuildVersion = '1.1' + ext.commonBuildDir = "https://raw.githubusercontent.com/emcvipr/ecs-common-build/v$commonBuildVersion" + apply from: "$commonBuildDir/ecs-publish.buildscript.gradle", to: buildscript } -apply from: 'ecs-publish.gradle' +apply from: "$commonBuildDir/ecs-publish.gradle" dependencies { compile 'com.sun.jersey:jersey-client:1.18.3', diff --git a/ecs-publish.buildscript.gradle b/ecs-publish.buildscript.gradle deleted file mode 100644 index 185d4b5..0000000 --- a/ecs-publish.buildscript.gradle +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2015, EMC Corporation. - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * + Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * + Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * + The name of EMC Corporation may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -repositories { - mavenCentral() -} -dependencies { - classpath 'org.ajoberstar:gradle-git:0.13.0', - 'net.saliman:gradle-cobertura-plugin:2.2.5' -} diff --git a/ecs-publish.gradle b/ecs-publish.gradle deleted file mode 100644 index 248fa9a..0000000 --- a/ecs-publish.gradle +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2015, EMC Corporation. - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * + Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * + Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * + The name of EMC Corporation may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -/* --- Please put the following in ~/.gradle/gradle.properties --- -# path to Java 6 rt.jar (if installed) -java6Classpath= - -# set these if you plan on publishing. note: you will be prompted for passwords if necessary -sonatypeUsername= -githubUsername= -gitUsername= -# Located on the signing server. KeyId can be found using gpg --list-keys -signingKeyId= -signingSecretKeyRingFile= -*/// --- END --- - -/* --- Set the following in your project's build.gradle along with any necessary custom logic --- -description 'Description of this project' -version '1.0.0'// omit the version to enable automated semantic versioning based on tags - -// if your github project is different than your origin project -ext.githubProjectName = 'my-project-java' - -buildscript { - apply from: "ecs-publish.buildscript.gradle", to: buildscript -} - -apply from: 'ecs-publish.gradle' - -// replace below with your project's actual dependencies -dependencies { - compile 'com.emc.ecs:smart-client:1.0.0', - 'com.emc.vipr:vipr-object-transformations:2.0.3', - 'org.jdom:jdom2:2.0.5' - testCompile 'junit:junit:4.11' -} -*/// --- END --- - -group 'com.emc.ecs' - -if (!hasProperty('githubProjectName')) ext.githubProjectName = project.name -ext.scmUrl = "https://github.com/emcvipr/${githubProjectName}" -ext.scmConnection = "scm:git@github.com:emcvipr/${githubProjectName}.git" -ext.githubUrl = "https://github.com/emcvipr/${githubProjectName}.git" -ext.aggregatedDocsDir = "$buildDir/aggregatedDocs" - -buildscript { - apply from: "ecs-publish.buildscript.gradle", to: buildscript -} - -import org.ajoberstar.grgit.* - -apply plugin: 'idea' -apply plugin: 'eclipse' -apply plugin: 'java' -apply plugin: 'net.saliman.cobertura' -apply plugin: 'distribution' -apply plugin: 'signing' -apply plugin: 'maven' - -defaultTasks 'distZip' - -gradle.taskGraph.whenReady { taskGraph -> - if (taskGraph.hasTask(':uploadArchives')) { - def signingPass = new String(System.console().readPassword('\nSigning key passphrase: ')) - ext.'signing.keyId' = signingKeyId - ext.'signing.secretKeyRingFile' = signingSecretKeyRingFile - ext.'signing.password' = signingPass - def sonatypePass = new String(System.console().readPassword('\nSonatype password: ')) - uploadArchives.repositories.mavenDeployer.repository.authentication.password = sonatypePass - } - if (taskGraph.hasTask(':publishGhPages')) { - githubPages.credentials.password = new String(System.console().readPassword('\nGithub password: ')) - } - if (taskGraph.hasTask(':release')) { - def gitPassword = new String(System.console().readPassword('\nASD git password: ')) - release.grgit = Grgit.open(project.file('.'), new Credentials(gitUsername, gitPassword)) - } -} - -[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' - -compileJava { - sourceCompatibility = 1.6 - if (java6Classpath) options.bootClasspath = java6Classpath -} - -repositories { - mavenCentral() - mavenLocal() -} - -test { - jvmArgs '-XX:-UseSplitVerifier' // required for cobertura and Java 1.7 -} - -def projectPom = { - project { - name project.name - description project.description - url 'https://community.emc.com/community/products/vipr#developer' - - scm { - url scmUrl - connection scmConnection - developerConnection scmConnection - } - - licenses { - license { - name 'The BSD 3-Clause License' - url 'http://opensource.org/licenses/BSD-3-Clause' - distribution 'repo' - } - } - - developers { - developer { - id 'emcvipr' - name 'EMC ViPR' - } - } - } -} - -task writePom { - ext.pomFile = file("$buildDir/pom.xml") - outputs.file pomFile - doLast { - pom(projectPom).writeTo pomFile - } -} - -jar { - doFirst { - manifest { - attributes 'Implementation-Version': project.version, - 'Class-Path': configurations.runtime.collect { it.getName() }.join(' ') - } - } - into("META-INF/maven/$project.group/$project.name") { - from writePom - } -} - -javadoc { - options.quiet() -} - -task javadocJar(type: Jar) { - classifier = 'javadoc' - from "${docsDir}/javadoc" -} -javadocJar.dependsOn javadoc - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} - -artifacts { - archives jar - archives javadocJar - archives sourcesJar -} - -distributions { - main { - contents { - from configurations.archives.allArtifacts.files - from 'readme.txt' - from 'license.txt' - into('lib') { - from configurations.runtime - } - } - } -} - -signing { - required { gradle.taskGraph.hasTask(':uploadArchives') } - sign configurations.archives -} - -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { deployment -> signing.signPom(deployment) } - - repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') { - authentication(userName: sonatypeUsername, password: '') - } - - pom projectPom - } - } -} - -task aggregateDocs << { - copy { - from docsDir - into "${aggregatedDocsDir}/latest" - } - copy { - from docsDir - into "${aggregatedDocsDir}/${project.version}" - } -} -aggregateDocs.dependsOn javadoc - -apply plugin: 'base' -apply plugin: 'org.ajoberstar.github-pages' -apply plugin: 'org.ajoberstar.release-opinion' - -githubPages { - repoUri = githubUrl - credentials { - username = githubUsername - password = '' - } - pages { - from aggregatedDocsDir - } -} -publishGhPages.dependsOn aggregateDocs - -release { - grgit = Grgit.open(project.file('.')) -} -tasks.release.dependsOn test, distZip, uploadArchives, publishGhPages - -clean { - delete aggregatedDocsDir -} - -task wrapper(type: Wrapper) { - gradleVersion = '2.2.1' -} -