This repository has been archived by the owner on Dec 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup automatic publishing to Bintray (jcenter). (#9)
- Loading branch information
1 parent
ca9ab51
commit a9eac90
Showing
3 changed files
with
139 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
apply plugin: 'kotlin' | ||
apply plugin: 'application' | ||
apply plugin: 'org.junit.platform.gradle.plugin' | ||
apply plugin: 'maven' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'com.jfrog.bintray' | ||
|
||
mainClassName = 'com.gojuno.swarmer.MainKt' | ||
|
||
|
@@ -19,7 +22,7 @@ dependencies { | |
} | ||
|
||
jar { | ||
// Build "fat" jar. | ||
// Build jar with dependencies. | ||
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) { | ||
exclude 'META-INF/*.SF' | ||
exclude 'META-INF/*.DSA' | ||
|
@@ -40,3 +43,86 @@ junitPlatform { | |
} | ||
} | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
task validatePublishing { | ||
doLast { | ||
validateTagAndVersion() | ||
} | ||
} | ||
|
||
bintrayUpload.dependsOn validatePublishing | ||
|
||
def pomConfig = { | ||
licenses { | ||
license { | ||
name 'The Apache Software License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
distribution 'repo' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id 'gojuno' | ||
name 'Juno Inc.' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
SwarmerPublication(MavenPublication) { | ||
from components.java | ||
|
||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
groupId 'com.gojuno.swarmer' | ||
artifactId 'swarmer' | ||
version projectVersion() | ||
|
||
pom.withXml { | ||
def root = asNode() | ||
root.appendNode('description', 'Tool to create and start multiple Android Emulators in parallel.') | ||
root.appendNode('name', 'Swarmer') | ||
root.appendNode('url', 'https://github.com/gojuno/swarmer') | ||
root.children().last() + pomConfig | ||
} | ||
} | ||
} | ||
} | ||
|
||
bintray { | ||
user = System.getenv('BINTRAY_USER') | ||
key = System.getenv('BINTRAY_API_KEY') | ||
publish = true | ||
|
||
pkg { | ||
repo = 'maven' | ||
name = 'swarmer' | ||
licenses = ['Apache-2.0'] | ||
vcsUrl = 'https://github.com/gojuno/swarmer.git' | ||
issueTrackerUrl = 'https://github.com/gojuno/swarmer/issues' | ||
publications = ['SwarmerPublication'] | ||
|
||
version { | ||
name = projectVersion() | ||
vcsTag = gitTag() | ||
|
||
gpg { | ||
sign = true | ||
passphrase = System.getenv('BINTRAY_GPG_PASSPHRASE') | ||
} | ||
} | ||
} | ||
} |