Skip to content

Commit

Permalink
Use common release tooling.
Browse files Browse the repository at this point in the history
Fixes #49
  • Loading branch information
David Dawson committed Mar 28, 2017
1 parent 30559ed commit f1c2d0c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 154 deletions.
169 changes: 18 additions & 151 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,156 +1,23 @@
import java.text.SimpleDateFormat

buildscript {
repositories {
jcenter()
maven {
url 'http://maven.tmatesoft.com/content/repositories/releases/'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'me.trnl:github-release-gradle-plugin:0.1'
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.2.0')
classpath "io.franzbecker:gradle-lombok:1.8"
}
}

apply plugin: 'git'

def globalVersion = new Version(currentVersion)

project.version = currentVersion.toString()

ext {
reactiveStreamsVersion = '1.0.0'
reactorVersion = '2.0.7.RELEASE'
}

subprojects { subproject ->
apply plugin: 'groovy'

group = "io.muoncore"
version = globalVersion.toString()

dependencies {
testCompile "org.codehaus.groovy:groovy-all:2.4.8"
testCompile "org.spockframework:spock-core:1.0-groovy-2.4"
testCompile 'cglib:cglib:2.2.2'
testCompile 'org.objenesis:objenesis:2.4'
}

compileJava {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}

compileTestJava {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}

repositories {
jcenter()
}
}

subprojects { subproject ->
if (subproject.name in ["muon-examples", "doc"]) return
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory"
apply plugin:'io.franzbecker.gradle-lombok'

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}

// ----------- Deployment --------------
artifactory {
contextUrl = 'https://simplicityitself.artifactoryonline.com/simplicityitself/' //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'muon' //The Artifactory repository key to publish to
username = 'sergio' //The publisher user name
password = 'cistechfutures' //The publisher password
}
defaults {
publications ('mavenJava')
publishArtifacts = true
publishPom = true
}
}
resolve {
repository {
repoKey = 'repo' //The Artifactory (preferably virtual) repository key to resolve from
}
}
}

if (project.plugins.hasPlugin('java')) {
// manifest.mainAttributes(provider: 'gradle')
configurations {
published
}


dependencies {
testCompile 'junit:junit:4.7'
}

task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

// Add the sourceJars to non-extractor modules
artifacts {
published sourceJar
published javadocJar
}
}
}

configurations {
published
repositories {
jcenter()
maven {
url 'http://maven.tmatesoft.com/content/repositories/releases/'
}
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "https://simplicityitself.artifactoryonline.com/simplicityitself/muon"
}
}
dependencies {
classpath 'io.muoncore.release:muon-java-release:0.0.2-SNAPSHOT'
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.2.0')
classpath "io.franzbecker:gradle-lombok:1.8"
}
}

class Version {
String originalVersion
String thisVersion
String status
Date buildTime

Version(String versionValue) {
buildTime = new Date()
originalVersion = versionValue
if (originalVersion.endsWith('-SNAPSHOT')) {
status = 'integration'
thisVersion = originalVersion.substring(0, originalVersion.length() - 'SNAPSHOT'.length()) + getTimestamp()
} else {
status = 'release'
thisVersion = versionValue
}
}
apply plugin: 'io.muoncore.release'

String getTimestamp() {
// Convert local file timestamp to UTC
def format = new SimpleDateFormat('yyyyMMddHHmmss')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')));
return format.format(buildTime)
}

String toString() {
thisVersion
}
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
currentVersion=7.2.5
version=7.2.5
group=io.muoncore
exclude=doc,muon-examples
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Mar 28 10:13:55 BST 2017
#Tue Mar 28 14:44:47 BST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip

0 comments on commit f1c2d0c

Please sign in to comment.