Skip to content
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

[US642] Feature / prepare release and versioning #118

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
47 changes: 47 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Gradle
# Build your Java project and run tests with Gradle using a Gradle wrapper script.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- master

pool:
vmImage: ubuntu-latest

steps:
- script: |
git checkout $(Build.SourceBranchName)
git config --global user.name "gravity9piotr"
displayName: "git config"
- task: MavenAuthenticate@0
displayName: 'authenticate maven'
inputs:
artifactsFeeds: bt
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
tasks: 'clean test'
- task: Gradle@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
tasks: 'release -Prelease.useAutomaticVersion=true'
- task: PublishPipelineArtifact@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
targetPath: $(System.DefaultWorkingDirectory)/build/libs/$(artifactName)
artifactName: artifact
displayName: "publish build artifact"
134 changes: 4 additions & 130 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildscript {
repositories {
mavenCentral()
maven {
url "http://repo.springsource.org/plugins-release";
url "https://repo.springsource.org/plugins-release";
}
}
dependencies {
Expand All @@ -32,6 +32,7 @@ buildscript {

plugins {
id("net.ltgt.errorprone") version "0.8.1" apply false
id 'net.researchgate.release' version '2.8.1'
}

configure(allprojects) {
Expand All @@ -53,27 +54,13 @@ apply(from: "project.gradle");

group = "com.github.java-json-tools";

ext.forRelease = !version.endsWith("-SNAPSHOT");

/*
* Repositories to use
*/
repositories {
mavenCentral();
if (!forRelease) {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
/* Allow staging references for last pre-release testing. */
if (project.properties.containsKey("sonatypeUsername")) {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username = project.properties["sonatypeUsername"]
password = project.properties["sonatypePassword"]
}
}
maven {
url "https://pkgs.dev.azure.com/Gravity9Solutions/BT/_packaging/bt/maven/v1"
}
}

Expand Down Expand Up @@ -117,15 +104,6 @@ allprojects {
}
}

/*
* Javadoc: we need to tell where the overview.html is, it will not pick it up
* automatically...
*/

//javadoc {
// options.overview = "src/main/java/overview.html";
//}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc";
from javadoc.destinationDir;
Expand All @@ -142,108 +120,4 @@ wrapper {
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip";
}

task pom {
doLast {
pom {}.writeTo("${projectDir}/pom.xml");
}
}

/*
* SIGNING
*/

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

task checkSigningRequirements {
doLast {
def requiredProperties = [ "sonatypeUsername", "sonatypePassword" ];
def noDice = false;
requiredProperties.each {
if (project.properties[it] == null) {
noDice = true;
System.err.printf("property \"%s\" is not defined!\n", it);
}
}
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.ext.description}";
url "${projectURL}";

scm {
url "${scmUrl}";
connection "${scmUrl}";
developerConnection "scm:git:${scmUrl}";
}

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 "huggsboson";
name "John Huffaker";
email "[email protected]";
}
}
}
}

signing {
required { forRelease && gradle.taskGraph.hasTask("uploadArchives") };
sign configurations.archives;
}

12 changes: 6 additions & 6 deletions project.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
* Project-specific settings. Unfortunately we cannot put the name in there!
*/
group = "com.github.java-json-tools";
version = "1.13";
version = "2.0.0-SNAPSHOT";
sourceCompatibility = JavaVersion.VERSION_1_7;
targetCompatibility = JavaVersion.VERSION_1_7; // defaults to sourceCompatibility
project.ext.description = "JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java";
project.ext.description = "JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java, using extended TMF620 JsonPath syntax";

/*
* List of dependencies
*/
dependencies {
provided(group: "com.google.code.findbugs", name: "jsr305", version: "3.0.2");
compile(group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.11.0");
compile(group: 'com.jayway.jsonpath', name: 'json-path', version: '2.6.0')
compile(group: "com.github.java-json-tools", name: "msg-simple", version: "1.2");

compile(group: "com.github.java-json-tools", name: "jackson-coreutils", version: "2.0");
testCompile(group: "org.testng", name: "testng", version: "7.1.0") {
exclude(group: "junit", module: "junit");
Expand All @@ -54,9 +54,9 @@ javadoc.options {
}
links("https://docs.oracle.com/javase/7/docs/api/");
links("https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.2/");
links("https://fasterxml.github.com/jackson-databind/javadoc/2.11/");
links("https://fasterxml.github.com/jackson-core/javadoc/2.11/");
links("https://fasterxml.github.com/jackson-annotations/javadoc/2.11/");
links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.11.4/index.html");
links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.11.4/index.html");
links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/2.11.4/index.html");
links("https://www.javadoc.io/doc/com.google.guava/guava/28.2-android/");
links("https://java-json-tools.github.io/msg-simple/");
links("https://java-json-tools.github.io/jackson-coreutils/");
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* - ASL 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt
*/

rootProject.name = "json-patch";
rootProject.name = "json-patch-query";
Loading