Skip to content

Commit

Permalink
Add release plugin, update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Nov 19, 2018
1 parent f263969 commit 755d82c
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//tag::header[]
= {project-name}
:author: Jeremie Bresson
:revnumber: 1.0.0

Simple jetty server to record HTTP requests.
//end::header[]
Expand Down
24 changes: 22 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -15,4 +18,21 @@ subprojects {
mavenCentral()
jcenter()
}
}
}

release {
versionPropertyFile = 'gradle.properties'
versionProperties = ['version', 'projectversion']
buildTasks = ['releaseBuild']
}

task releaseBuild {
dependsOn(
'core:clean',
'core:build',
'core:publish',
'cli:clean',
'cli:build',
'cli:publish'
)
}
9 changes: 9 additions & 0 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ publishing {
}
}
}
repositories {
maven {
url = unbluBintrayReleases
credentials {
username = bintrayUser
password = bintrayPassword
}
}
}
}
9 changes: 9 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,13 @@ publishing {
artifact sourcesJar
}
}
repositories {
maven {
url = unbluBintrayReleases
credentials {
username = bintrayUser
password = bintrayPassword
}
}
}
}
53 changes: 53 additions & 0 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,65 @@
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]

== URLs

* 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]
----
<repositories>
<repository>
<id>unblu-releases</id>
<url>https://dl.bintray.com/unblu/releases/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
</repositories>
----

The repository can be added to gradle with:

[source,groovy]
----
repositories {
maven {
url "https://dl.bintray.com/unblu/releases/"
}
}
----

== Usage

=== cli
Expand Down Expand Up @@ -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:

----
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
25 changes: 22 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.unblu.tools</groupId>
<artifactId>http-request-recorder-root</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>0.0.1</version>
<packaging>pom</packaging>

<pluginRepositories>
Expand Down Expand Up @@ -36,6 +36,24 @@

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>gradle.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>

<!-- Run AsciidoctorJ -->
<plugin>
Expand Down Expand Up @@ -76,7 +94,8 @@
<idseparator>-</idseparator>
<docinfo1>true</docinfo1>
<sourcedir>${project.build.sourceDirectory}</sourcedir>
<project-version>${project.version}</project-version>
<project-version>${projectversion}</project-version>
<revnumber>${projectversion}</revnumber>
</attributes>
</configuration>
<executions>
Expand Down Expand Up @@ -126,7 +145,7 @@
<executable>mvn</executable>
<arguments>
<argument>clean:clean</argument>
<argument>asciidoctor:process-asciidoc</argument>
<argument>verify</argument>
<argument>site:site</argument>
<argument>clean:clean</argument>
</arguments>
Expand Down

0 comments on commit 755d82c

Please sign in to comment.