-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bintray plugin for publishing and configure the bintray closure
- Loading branch information
1 parent
779ba05
commit f23efd1
Showing
1 changed file
with
103 additions
and
5 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 |
---|---|---|
|
@@ -11,27 +11,35 @@ plugins { | |
id 'java-library' | ||
// Apply the jacoco plugin to aid in test coverage | ||
id 'jacoco' | ||
// Apply the maven publish plugin | ||
id 'maven-publish' | ||
// Apply the bintray plugin | ||
id "com.jfrog.bintray" version "1.8.4" | ||
} | ||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
|
||
group = 'com.kori_47' | ||
version = '1.0' | ||
|
||
repositories { | ||
// Use jcenter for resolving dependencies. | ||
// You can declare any Maven/Ivy/file repository here. | ||
jcenter() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
// Use JUnit test framework | ||
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2' //'junit:junit:4.12' | ||
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events "passed", "skipped", "failed" | ||
} | ||
useJUnitPlatform() | ||
testLogging { | ||
events 'passed', 'skipped', 'failed' | ||
} | ||
} | ||
|
||
jacocoTestReport { | ||
|
@@ -41,3 +49,93 @@ jacocoTestReport { | |
xml.enabled true | ||
} | ||
} | ||
|
||
// Configure sources JAR | ||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allJava | ||
} | ||
|
||
// Configure javadoc Jar | ||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
// Create the pom configuration: | ||
def pomConfig = { | ||
licenses { | ||
license { | ||
name 'MIT' | ||
url 'https://github.com/kennedykori/JavaUtils/blob/master/LICENSE' | ||
distribution "repo" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id 'kennedykori' | ||
name "Kennedy Kori" | ||
email '[email protected]' | ||
} | ||
} | ||
|
||
scm { | ||
url 'https://github.com/kennedykori/JavaUtils' | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
UtilsPublication(MavenPublication) { | ||
from components.java | ||
// Attach sources and javadoc Jars to the main maven publication | ||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
groupId 'com.kori_47' | ||
artifactId 'utils' | ||
version '1.0' | ||
|
||
pom.withXml { | ||
def root = asNode() | ||
root.appendNode('description', 'This library contains a utility class that is composed of static methods that can be used for checking and validation of both objects and primitives.') | ||
root.appendNode('name', 'Utils') | ||
root.appendNode('url', 'https://github.com/kennedykori/JavaUtils') | ||
root.children().last() + pomConfig | ||
} | ||
} | ||
} | ||
} | ||
|
||
bintray { | ||
user = System.getenv('BINTRAY_USER') | ||
key = System.getenv('BINTRAY_KEY') | ||
publications = ['UtilsPublication'] | ||
pkg { | ||
repo = 'kori_47' | ||
name = 'utils' | ||
desc = 'This library contains a utility class that is composed of static methods that can be used for checking and validation of both objects and primitives.' | ||
websiteUrl = 'https://github.com/kennedykori/JavaUtils' | ||
issueTrackerUrl = 'https://github.com/kennedykori/JavaUtils/issues' | ||
vcsUrl = 'https://github.com/kennedykori/JavaUtils.git' | ||
licenses = ['MIT'] | ||
publicDownloadNumbers = true | ||
|
||
githubRepo = 'kennedykori/JavaUtils' | ||
githubReleaseNotesFile = 'README.md' | ||
|
||
version { | ||
name = '1.0-Final' | ||
desc = 'Utils 1.0 final' | ||
released = new Date() | ||
// GPG Signing | ||
gpg { | ||
sign = true | ||
} | ||
// Maven Central Sync | ||
mavenCentralSync { | ||
sync = true | ||
} | ||
} | ||
} | ||
} |