Permalink
Browse files

Cosmetics related to automatic bintray upload

  • Loading branch information...
1 parent 309c4f3 commit 1702fbc17299056cff1d7dd84b57f11b46c3f872 @HanSolo committed Feb 13, 2016
Showing with 79 additions and 93 deletions.
  1. +77 −91 build.gradle
  2. +1 −1 gradle.properties
  3. +1 −1 settings.gradle
View
@@ -1,53 +1,40 @@
-// Medusa main build file
-import org.gradle.api.XmlProvider
-import org.gradle.api.artifacts.maven.MavenDeployment
-
-apply plugin: 'idea'
-apply plugin: 'signing'
-
-def isDevBuild
-def isSnapshotBuild
-def isReleaseBuild
-
-def sonatypeRepositoryUrl
+import java.text.SimpleDateFormat
-// Apply settings for signing if available
-if (file("signing.properties").exists()) {
- Properties props = new Properties()
- props.load(new FileInputStream("signing.properties"))
- props.each { key, value -> project.ext[key] = value }
+// Medusa main build file
+plugins {
+ id 'idea'
+ id 'java'
+ id 'maven-publish'
+ id 'net.nemerosa.versioning' version '1.6.0'
+ id 'com.jfrog.bintray' version '1.6'
}
+Date buildTimeAndDate = new Date()
+ext {
+ buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
+ buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
+}
-//set build variables based on build type (release, continuous integration, development)
-if(hasProperty("release")) {
- isReleaseBuild = true
- sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
-} else if (hasProperty("snapshot")) {
- isSnapshotBuild = true
- version += "-SNAPSHOT"
- sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
-} else {
- isDevBuild = true
+jar {
+ manifest {
+ attributes(
+ 'Built-By': System.properties['user.name'],
+ 'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
+ 'Build-Date': project.buildDate,
+ 'Build-Time': project.buildTime,
+ 'Build-Revision': versioning.info.commit,
+ 'Specification-Title': project.name,
+ 'Specification-Version': project.version,
+ 'Implementation-Title': project.name,
+ 'Implementation-Version': project.version
+ )
+ }
}
repositories {
jcenter()
}
-allprojects {
- apply plugin: 'idea'
- apply plugin: 'java'
- apply plugin: 'maven'
-
- idea {
- project {
- jdkName '1.8'
- languageLevel '1.8'
- }
- }
-}
-
// create one jar for the javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
@@ -66,63 +53,62 @@ artifacts {
archives sourcesJar
}
-
-// signing the artifacts
-if (isReleaseBuild) {
- signing {
- sign configurations.archives
+def pomConfig = {
+ name 'Medusa'
+ description 'Medusa is a JavaFX 8 gauges library'
+ url 'https://github.com/HanSolo/Medusa/wiki'
+ inceptionYear '2016'
+ licenses {
+ license([:]) {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
}
-} else {
- task signArchives {
- // do nothing
+ scm {
+ url 'scm:git@github.com:HanSolo/Medusa.git'
+ connection 'scm:git@github.com:HanSolo/Medusa.git'
+ developerConnection 'scm:git@github.com:HanSolo/Medusa.git'
}
-}
-
-
-// upload artifacts to maven
-uploadArchives {
- repositories {
- if (isDevBuild) {
- //mavenLocal()
+ developers {
+ developer {
+ id 'HanSolo'
+ name 'Gerrit Grunwald'
}
- else {
- mavenDeployer {
- if(isReleaseBuild) {
- beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
- }
-
- repository(url: sonatypeRepositoryUrl) {
- authentication(userName: sonatypeUsername, password: sonatypePassword)
- }
-
- pom.project {
- name 'Medusa'
- packaging 'jar'
- description 'Medusa is a JavaFX 8 gauges library'
- url 'https://github.com/HanSolo/Medusa/wiki'
-
- scm {
- url 'scm:git@github.com:HanSolo/Medusa.git'
- connection 'scm:git@github.com:HanSolo/Medusa.git'
- developerConnection 'scm:git@github.com:HanSolo/Medusa.git'
- }
+ }
+}
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- distribution 'repo'
- }
- }
+publishing {
+ publications {
+ mavenCustom(MavenPublication) {
+ from components.java
+ artifact sourcesJar
+ artifact javadocJar
- developers {
- developer {
- id 'HanSolo'
- name 'Gerrit Grunwald'
- }
- }
- }
+ pom.withXml {
+ asNode().children().last() + pomConfig
}
}
}
}
+
+if (!project.hasProperty('bintrayUsername')) ext.bintrayUsername = ''
+if (!project.hasProperty('bintrayApiKey')) ext.bintrayApiKey = ''
+
+bintray {
+ user = project.bintrayUsername
+ key = project.bintrayApiKey
+ publications = ['mavenCustom']
+ pkg {
+ repo = 'Medusa'
+ userOrg = 'hansolo'
+ name = project.name
+ desc = 'Medusa is a JavaFX 8 gauges library'
+ licenses = ['Apache-2.0']
+ labels = ['javafx']
+ websiteUrl = 'https://github.com/HanSolo/Medusa/wiki'
+ issueTrackerUrl = 'https://github.com/HanSolo/Medusa/issues'
+ vcsUrl = 'git@github.com:HanSolo/Medusa.git'
+ publicDownloadNumbers = true
+ }
+}
View
@@ -18,4 +18,4 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8
group = eu.hansolo
-version = 4.1
+version = 4.2
View
@@ -1 +1 @@
-rootProject.name = 'medusa'
+rootProject.name = 'Medusa'

0 comments on commit 1702fbc

Please sign in to comment.