-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- publishing to bintray - release pages on www.crnk.io
- Loading branch information
Showing
18 changed files
with
1,010 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ buildscript { | |
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5-rc1' | ||
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.1" | ||
classpath "net.ltgt.gradle:gradle-apt-plugin:0.10" | ||
|
||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' | ||
} | ||
} | ||
|
||
|
@@ -29,9 +31,11 @@ ext { | |
timestampedVersion = isProductionBuild | ||
} | ||
|
||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss") | ||
apply plugin: 'org.ajoberstar.grgit' | ||
|
||
if (ext.timestampedVersion) { | ||
version = BUILD_VERSION_PREFIX + "." + format.format(new Date()) | ||
def gitCommitTimestamp = grgit.head().date.format("yyyyMMddHHmmss", TimeZone.getTimeZone('GMT')) | ||
version = BUILD_VERSION_PREFIX + "." + gitCommitTimestamp | ||
} else { | ||
version = '0.0.0-SNAPSHOT' | ||
} | ||
|
@@ -65,6 +69,8 @@ gradle.beforeProject { Project project -> | |
targetCompatibility = 1.8 | ||
|
||
if (!bom) { | ||
|
||
|
||
dependencies { | ||
testCompile group: 'junit', name: 'junit', version: '4.12' | ||
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' | ||
|
@@ -134,99 +140,43 @@ gradle.beforeProject { Project project -> | |
apply plugin: 'maven-publish' | ||
|
||
|
||
if (!docs && !examples) { | ||
|
||
if (isProductionBuild) { | ||
apply plugin: 'signing' | ||
|
||
if (!docs && !examples && !ui) { | ||
|
||
task sourcesJar(type: Jar) { | ||
from sourceSets.main.allSource | ||
classifier = 'sources' | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: 'javadoc') { | ||
from javadoc.destinationDir | ||
classifier = 'javadoc' | ||
} | ||
task sourcesJar(type: Jar) { | ||
from sourceSets.main.allSource | ||
classifier = 'sources' | ||
} | ||
|
||
artifacts { | ||
archives jar | ||
archives javadocJar | ||
archives sourcesJar | ||
} | ||
task javadocJar(type: Jar, dependsOn: 'javadoc') { | ||
from javadoc.destinationDir | ||
classifier = 'javadoc' | ||
} | ||
|
||
ext.'signing.secretKeyRingFile' = "${rootProject.projectDir}/secring.gpg" | ||
apply plugin: 'com.jfrog.bintray' | ||
|
||
signing { | ||
required { | ||
gradle.taskGraph.hasTask("uploadArchives") | ||
// Create the pom configuration: | ||
def pomConfig = { | ||
licenses { | ||
license { | ||
name "The Apache Software License, Version 2.0" | ||
url "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
distribution "repo" | ||
} | ||
sign configurations.archives | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
// if(!System.env.NEXUS_DEPLOY_PASS){ | ||
// throw new IllegalStateException("NEXUS_DEPLOY_PASS not specified in environment") | ||
// } | ||
|
||
repository(url: NEXUS_DEPLOY_URL) { | ||
authentication( | ||
userName: System.env.NEXUS_DEPLOY_USER, | ||
password: System.env.NEXUS_DEPLOY_PASS | ||
) | ||
|
||
// that plugin does not make use of global proxy settings :-( | ||
def proxyHost = System.getProperty("https.proxyHost") | ||
def proxyPort = System.getProperty("https.proxyPort") | ||
if (proxyHost && proxyPort) { | ||
proxy(host: proxyHost, port: Integer.parseInt(proxyPort), type: 'http') | ||
} | ||
} | ||
|
||
pom.project { | ||
name project.name | ||
description 'JSON API framework for Java' | ||
url 'http://www.crnk.io' | ||
scm { | ||
url 'https://github.com/crnk-project/crnk-framework' | ||
connection 'scm:git:git://github.com/crnk-project/crnk-framework.git' | ||
developerConnection 'scm:git:[email protected]:crnk-project/crnk-framework.git' | ||
} | ||
licenses { | ||
license { | ||
name 'The Apache Software License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.html' | ||
distribution 'repo' | ||
} | ||
} | ||
issueManagement { | ||
system 'GitHub' | ||
url 'https://github.com/crnk-project/crml-framework/issues' | ||
} | ||
developers { | ||
developer { | ||
id 'crnk.io' | ||
name 'crnk.io' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
developers { | ||
developer { | ||
id 'crnk.io' | ||
name 'crnk.io' | ||
email '[email protected]' | ||
} | ||
} | ||
|
||
tasks.publish.dependsOn(tasks.uploadArchives) | ||
} else { | ||
task sourcesJar(type: Jar) { | ||
from sourceSets.main.allSource | ||
classifier = 'sources' | ||
scm { | ||
url "https://github.com/crnk-project/crnk-framework" | ||
} | ||
} | ||
|
||
if (!bom) { | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
|
@@ -235,11 +185,73 @@ gradle.beforeProject { Project project -> | |
artifact sourcesJar { | ||
classifier "sources" | ||
} | ||
|
||
artifact javadocJar { | ||
classifier "javadoc" | ||
} | ||
|
||
groupId GROUP_ID | ||
artifactId project.name | ||
version project.version | ||
|
||
pom.withXml { | ||
def root = asNode() | ||
root.appendNode('description', 'JSON API with Crnk') | ||
root.appendNode('name', 'Crnk') | ||
root.appendNode('url', 'http://wwww.crnk.io') | ||
root.children().last() + pomConfig | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
bintray { | ||
user = System.env.BINTRAY_USER | ||
key = System.env.BINTRAY_TOKEN | ||
|
||
publications = ['mavenJava'] | ||
|
||
pkg { | ||
repo = 'maven' | ||
name = project.name | ||
userOrg = 'crnk-project' | ||
licenses = ['Apache-2.0'] | ||
vcsUrl = 'https://github.com/crnk-project/crnk-framework.git' | ||
websiteUrl = 'http://www.crnk.io' | ||
desc = 'JSON API with Crnk' | ||
labels = ['JSONAPI', 'rest'] | ||
|
||
githubRepo = 'crnk-project/crnk-framework' | ||
githubReleaseNotesFile = 'README.md' | ||
|
||
publish = true | ||
|
||
version { | ||
name = project.version | ||
desc = 'JSON API with Crnk' | ||
released = new Date() | ||
vcsTag = "v$project.version" | ||
|
||
|
||
mavenCentralSync { | ||
sync = true //[Default: true] Determines whether to sync the version to Maven Central. | ||
user = System.env.NEXUS_DEPLOY_USER | ||
password = System.env.NEXUS_DEPLOY_PASS | ||
close = '1' | ||
} | ||
} | ||
|
||
|
||
} | ||
} | ||
|
||
tasks.bintrayUpload.dependsOn assemble, sourcesJar, javadocJar, publishToMavenLocal | ||
|
||
publish.dependsOn tasks.bintrayUpload | ||
|
||
|
||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.