Skip to content

Patch history #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Prev Previous commit
Next Next commit
Updating gradle build to publish to cvent specific repository.
  • Loading branch information
Roling, Luke committed Apr 22, 2015
commit 7ce500cbef6e4f64990d852af83c7f327b5314b1
123 changes: 10 additions & 113 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
*/

buildscript {
repositories {
maven {
url "http://repo.springsource.org/plugins-release";
}
}
dependencies {
classpath 'com.cvent.gradle:cvent-publish-plugin:0.9'
classpath(group: "org.springframework.build.gradle",
name: "propdeps-plugin", version: "0.0.7");
}
Expand All @@ -36,27 +32,26 @@ configure(allprojects) {
apply(plugin: "propdeps-eclipse");
}

apply plugin: 'com.cvent.publish'
apply(plugin: "java");
apply(plugin: "maven");
apply(plugin: "signing");
apply(plugin: "osgi");
apply(plugin: "idea");
apply(plugin: "eclipse");

group = "com.github.fge";
version = "1.10-SNAPSHOT";
group = "com.cvent";
version = "2.0-SNAPSHOT";
description = "JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java";
sourceCompatibility = "1.6";
targetCompatibility = "1.6"; // defaults to sourceCompatibility

/*
* List of dependencies
*/
dependencies {
provided(group: "com.google.code.findbugs", name: "jsr305",
version: "2.0.1");
version: "2.0.3");
compile(group: "com.github.fge", name: "jackson-coreutils",
version: "1.6");
version: "1.8");
testCompile(group: "org.testng", name: "testng", version: "6.8.7") {
exclude(group: "junit", module: "junit");
exclude(group: "org.beanshell", module: "bsh");
Expand All @@ -75,13 +70,6 @@ javadoc.options.links("http://docs.guava-libraries.googlecode.com/git-history/v1
javadoc.options.links("http://fge.github.io/msg-simple/");
javadoc.options.links("http://fge.github.io/jackson-coreutils/");

/*
* Repositories to use
*/
repositories {
mavenCentral();
}

/*
* Necessary! Otherwise TestNG will not be used...
*
Expand Down Expand Up @@ -129,102 +117,11 @@ task pom << {
pom {}.writeTo("${projectDir}/pom.xml");
}

/*
* SIGNING
*/

project.ext {
gitrwscm = sprintf("[email protected]:fge/%s", name);
gitroscm = sprintf("https://github.com/fge/%s.git", name);
projectURL = sprintf("https://github.com/fge/%s", name);
sonatypeStaging = "https://oss.sonatype.org/service/local/staging/deploy/maven2/";
sonatypeSnapshots = "https://oss.sonatype.org/content/repositories/snapshots/";
};

task checkSigningRequirements << {
def requiredProperties = [ "sonatypeUsername", "sonatypePassword" ];
def noDice = false;
requiredProperties.each {
if (project.properties[it] == null) {
noDice = true;
System.err.printf("property \"%s\" is not defined!")
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
if (noDice)
throw new IllegalStateException("missing required properties for " +
"upload");
}

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

repository(url: "${sonatypeStaging}") {
authentication(
userName: project.properties["sonatypeUsername"],
password: project.properties["sonatypePassword"]
);
}

snapshotRepository(url: "${sonatypeSnapshots}") {
authentication(
userName: project.properties["sonatypeUsername"],
password: project.properties["sonatypePassword"]
);
}
}
}
}

/*
* Configure pom.xml on install, uploadArchives
*/
[
install.repositories.mavenInstaller,
uploadArchives.repositories.mavenDeployer
]*.pom*.whenConfigured { pom ->
pom.project {
name "${project.name}";
packaging "jar";
description "${project.description}";
url "${projectURL}";

scm {
url "${gitrwscm}";
connection "${gitrwscm}";
developerConnection "${gitroscm}";
}

licenses {
license {
name "Lesser General Public License, version 3 or greater";
url "http://www.gnu.org/licenses/lgpl.html";
distribution "repo";
};
license {
name "Apache Software License, version 2.0";
url "http://www.apache.org/licenses/LICENSE-2.0";
distribution "repo";
}
}

developers {
developer {
id "fge";
name "Francis Galiegue";
email "[email protected]";
}
}
}
}

ext.forRelease = !version.endsWith("-SNAPSHOT");
signing {
required { forRelease && gradle.taskGraph.hasTask("uploadArchives") };
sign configurations.archives;
}