From 755d82ce3e5ce629ac530999b8ed60046d5fda0a Mon Sep 17 00:00:00 2001 From: Jeremie Bresson Date: Mon, 19 Nov 2018 15:06:50 +0100 Subject: [PATCH] Add release plugin, update documentation --- README.adoc | 1 - build.gradle | 24 +++++++++++++++++++-- cli/build.gradle | 9 ++++++++ core/build.gradle | 9 ++++++++ docs/index.adoc | 53 +++++++++++++++++++++++++++++++++++++++++++++++ gradle.properties | 4 ++++ pom.xml | 25 +++++++++++++++++++--- 7 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 gradle.properties diff --git a/README.adoc b/README.adoc index f103a61..5eac612 100644 --- a/README.adoc +++ b/README.adoc @@ -15,7 +15,6 @@ //tag::header[] = {project-name} :author: Jeremie Bresson -:revnumber: 1.0.0 Simple jetty server to record HTTP requests. //end::header[] diff --git a/build.gradle b/build.gradle index dcc29f9..a92448f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,11 @@ +plugins { + id 'net.researchgate.release' version '2.6.0' +} + allprojects { apply plugin: 'maven-publish' group = 'com.unblu.tools' - version = '1.0.0-SNAPSHOT' } subprojects { @@ -15,4 +18,21 @@ subprojects { mavenCentral() jcenter() } -} \ No newline at end of file +} + +release { + versionPropertyFile = 'gradle.properties' + versionProperties = ['version', 'projectversion'] + buildTasks = ['releaseBuild'] +} + +task releaseBuild { + dependsOn( + 'core:clean', + 'core:build', + 'core:publish', + 'cli:clean', + 'cli:build', + 'cli:publish' + ) +} diff --git a/cli/build.gradle b/cli/build.gradle index 9a2df52..4c42806 100644 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -37,4 +37,13 @@ publishing { } } } + repositories { + maven { + url = unbluBintrayReleases + credentials { + username = bintrayUser + password = bintrayPassword + } + } + } } \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index c9b723e..964ad97 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -36,4 +36,13 @@ publishing { artifact sourcesJar } } + repositories { + maven { + url = unbluBintrayReleases + credentials { + username = bintrayUser + password = bintrayPassword + } + } + } } \ No newline at end of file diff --git a/docs/index.adoc b/docs/index.adoc index 49a6b10..1dbaf8c 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -3,6 +3,7 @@ include::{github-readme}[tags=vardef] :projectpage: https://github.com/{gh-repo-owner}/{gh-repo-name} +:bintraypage: https://bintray.com/unblu/releases/http-request-recorder include::{github-readme}[tags=header] @@ -10,12 +11,57 @@ include::{github-readme}[tags=header] * link:{homepage}[Project home] (this page) * link:{projectpage}[GitHub project] +* link:{bintraypage}[Binaries on Bintray] * link:{issues}[Issue tracker] TIP: Do you want to improve this page? Please git-link:self[edit it on GitHub, edit]. include::{github-readme}[tags=description] +== Download + +Binaries are hosted on bintray: link:{bintraypage}[http-request-recorder]. + +You can download a all-in-one jar: link:https://dl.bintray.com/unblu/releases/com/unblu/tools/http-request-recorder-cli/{project-version}/http-request-recorder-cli-{project-version}-all.jar[http-request-recorder-cli-{project-version}-all.jar]. +In the example provided in the "Usage" section, it stored as `hrr.jar` file locally. + +The artifacts are hosted on following maven repository: + +---- +https://dl.bintray.com/unblu/releases/ +---- + +Coordinates: + +* `com.unblu.tools:http-request-recorder-core:{project-version}`: core module that can be included in other java application +* `com.unblu.tools:http-request-recorder-cli:{project-version}`: command line interface module (dependencies not included in the jar) +* `com.unblu.tools:http-request-recorder-cli:{project-version}:all`: all-in-one jar that can be used to run on the command line + +The repository can be added to a maven build with: + +[source,xml] +---- + + + unblu-releases + https://dl.bintray.com/unblu/releases/ + true + false + + +---- + +The repository can be added to gradle with: + +[source,groovy] +---- +repositories { + maven { + url "https://dl.bintray.com/unblu/releases/" + } +} +---- + == Usage === cli @@ -129,6 +175,13 @@ Deploy to maven local: ./gradlew publishToMavenLocal ---- +Perform a release: (link:https://superuser.com/a/990447/[using `ssh-agent`] might be requested) + +---- +./gradlew release -Prelease.useAutomaticVersion=true +---- + + Build the documentation page: ---- diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..a723985 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +version=1.0.0-SNAPSHOT +projectversion=1.0.0-SNAPSHOT + +unbluBintrayReleases=https://api.bintray.com/maven/unblu/releases/http-request-recorder \ No newline at end of file diff --git a/pom.xml b/pom.xml index 72213f3..3b1c74e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.unblu.tools http-request-recorder-root - 1.0.0-SNAPSHOT + 0.0.1 pom @@ -36,6 +36,24 @@ + + org.codehaus.mojo + properties-maven-plugin + 1.0.0 + + + initialize + + read-project-properties + + + + gradle.properties + + + + + @@ -76,7 +94,8 @@ - true ${project.build.sourceDirectory} - ${project.version} + ${projectversion} + ${projectversion} @@ -126,7 +145,7 @@ mvn clean:clean - asciidoctor:process-asciidoc + verify site:site clean:clean