Skip to content

Commit

Permalink
Prepare version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Nov 18, 2019
1 parent 3cfb51b commit 64725cf
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
- store_artifacts:
path: picnic/build/libs
when: always
- run:
name: Publish Snapshot
command: ./gradlew publishSnapshot

workflows:
version: 2
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Change Log
==========

Version 0.1.0 *(2019-11-18)*
----------------------------

Initial release.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ table {
Download
--------

Coming soon.
Artifacts are available in Maven Central at `com.jakewharton.picnic:picnic:0.1.0`.

In-development snapshots are available from
[Sonatype's snapshot repository](https://oss.sonatype.org/content/repositories/snapshots/).



Expand Down
16 changes: 16 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Releasing
========

1. Change the version in `build.gradle` to a non-SNAPSHOT version.
2. Update the `CHANGELOG.md` for the impending release.
3. Update the `README.md` with the new version.
4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
5. `./gradlew clean uploadArchives`.
6. Visit [Sonatype Nexus](https://oss.sonatype.org/) and promote the artifact.
7. `git tag -a X.Y.X -m "Version X.Y.Z"` (where X.Y.Z is the new version)
8. Update the `gradle.properties` to the next SNAPSHOT version.
9. `git commit -am "Prepare next development version."`
10. `git push && git push --tags`
11. Update the two sample modules to point to the newly released version.

If step 5 or 6 fails, drop the Sonatype repo, fix the problem, commit, and start again at step 5.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ buildscript {

subprojects {
group('com.jakewharton.picnic')
version('0.1.0-SNAPSHOT')
version('0.1.0')

repositories {
mavenCentral()
Expand Down
73 changes: 65 additions & 8 deletions picnic/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'java-library'
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
java {
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
withSourcesJar()
}

apply plugin: 'org.jetbrains.kotlin.jvm'
compileKotlin {
Expand Down Expand Up @@ -31,12 +34,66 @@ def javadocJarTaskProvider = tasks.register('javadocJar', Jar) { task ->
task.dependsOn('dokka')
}

def sourcesJarTaskProvider = tasks.register('sourcesJar', Jar) { task ->
task.archiveClassifier.set('sources')
task.from(sourceSets.main.allSource)
def isReleaseBuild = !version.endsWith('-SNAPSHOT')

apply plugin: 'maven-publish'

publishing {
publications {
release(MavenPublication) {
from components.java

// TODO how to provide this asynchronously?
// TODO how to provide this through the component?
artifact javadocJarTaskProvider.get()

pom {
name = 'Picnic'
description = 'An API for constructing HTML-like tables which can be rendered to text'
url = 'https://github.com/JakeWharton/picnic'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'jakewharton'
name = 'Jake Wharton'
}
}
scm {
connection = 'scm:git:git://github.com/JakeWharton/picnic.git'
developerConnection = 'scm:git:ssh://git@github.com/JakeWharton/picnic.git'
url = 'https://github.com/JakeWharton/picnic'
}
}
}
}
repositories {
maven {
url = isReleaseBuild
? 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
: 'https://oss.sonatype.org/content/repositories/snapshots/'
credentials {
username = project.hasProperty('SONATYPE_NEXUS_USERNAME') ? SONATYPE_NEXUS_USERNAME : ''
password = project.hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : ''
}
}
}
}

artifacts {
archives javadocJarTaskProvider
archives sourcesJarTaskProvider
if (isReleaseBuild) {
apply plugin: 'signing'
signing {
required { gradle.taskGraph.hasTask("publish") }
sign publishing.publications
}
}

tasks.register('publishSnapshot').configure { task ->
if (!isReleaseBuild) {
task.dependsOn(tasks.getByName('publish'))
}
}

0 comments on commit 64725cf

Please sign in to comment.