11buildscript {
2- repositories {
3- jcenter()
4- }
5- dependencies {
6- classpath " com.github.jengelman.gradle.plugins:shadow:$SHADOW_PLUGIN_VERSION "
7- }
2+ repositories {
3+ jcenter()
4+ }
5+ dependencies {
6+ classpath " com.github.jengelman.gradle.plugins:shadow:$SHADOW_PLUGIN_VERSION "
7+ }
88}
99
1010apply plugin : " java-library"
@@ -18,17 +18,17 @@ targetCompatibility = JavaVersion.VERSION_1_6
1818
1919// ------------------------------------------------------------------------------------------------
2020// Dependency Definitions
21- // This module exports a "fat JAR" with the embedded junit5-rt from IntelliJ IDEA,
21+ // This module exports a "fat JAR" containing embedded JARs from IntelliJ IDEA,
2222// using a shadowed JAR that overrides the default build artifact.
2323// ------------------------------------------------------------------------------------------------
2424
2525dependencies {
26- implementation files(" libs/junit5-rt.jar" )
26+ implementation files(" libs/junit5-rt.jar" )
2727}
2828
2929shadowJar {
30- // Remove '-all' suffix from the generated JAR
31- classifier = null
30+ // Remove '-all' suffix from the generated JAR
31+ classifier = null
3232}
3333
3434build. doLast { shadowJar. execute() }
@@ -42,76 +42,75 @@ build.doLast { shadowJar.execute() }
4242
4343// Include sources.jar archive in each release
4444task sourcesJar (type : Jar , dependsOn : classes) {
45- classifier = " sources"
46- from sourceSets. main. allSource
45+ classifier = " sources"
46+ from sourceSets. main. allSource
4747}
4848
4949// Include javadoc.jar archive in each release
5050task javadocJar (type : Jar , dependsOn : javadoc) {
51- classifier = " javadoc"
52- from javadoc. destinationDir
51+ classifier = " javadoc"
52+ from javadoc. destinationDir
5353}
5454
5555artifacts {
56- archives sourcesJar
57- archives javadocJar
56+ archives sourcesJar
57+ archives javadocJar
5858}
5959
6060version = VERSION_NAME
6161
6262publishing {
63- publications {
64- library(MavenPublication ) {
65- project. shadow. component(it)
66- }
63+ publications {
64+ library(MavenPublication ) {
65+ project. shadow. component(it)
6766 }
67+ }
6868}
6969
7070// Copy POM to location expected by Bintray
7171task copyPom (type : Copy ) {
72- from " build/publications/library"
73- into " build/poms"
74- include " pom-default.xml"
72+ from " build/publications/library"
73+ into " build/poms"
74+ include " pom-default.xml"
7575}
7676
7777publish. dependsOn copyPom
7878
7979project. configure(project) {
80- if (project. version. endsWith(" -SNAPSHOT" )) {
81- // Configure deployment of snapshot versions to Sonatype OSS
82- project. publishing {
83- repositories {
84- maven {
85- name " snapshot"
86- credentials {
87- username project. ext. sonatypeUser
88- password project. ext. sonatypePass
89- }
90- url " https://oss.sonatype.org/content/repositories/snapshots"
91- }
92- }
80+ if (project. version. endsWith(" -SNAPSHOT" )) {
81+ // Configure deployment of snapshot versions to Sonatype OSS
82+ project. publishing {
83+ repositories {
84+ maven {
85+ name " snapshot"
86+ credentials {
87+ username project. ext. sonatypeUser
88+ password project. ext. sonatypePass
89+ }
90+ url " https://oss.sonatype.org/content/repositories/snapshots"
9391 }
94-
95- } else {
96- // Configure deployment of release versions to Bintray
97- project. bintray {
98- user = project. ext. bintrayUser
99- key = project. ext. bintrayKey
100- configurations = [" archives" ]
101- dryRun = false
102- pkg {
103- repo = " maven"
104- name = RUNTIME_ARTIFACT_ID
105- userOrg = project. ext. bintrayUser
106- licenses = [RUNTIME_LICENSE_NAME ]
107- publish = true
108- publicDownloadNumbers = true
109- vcsUrl = VCS_URL
110- version {
111- name = VERSION_NAME
112- desc = RUNTIME_DESCRIPTION
113- }
114- }
92+ }
93+ }
94+ } else {
95+ // Configure deployment of release versions to Bintray
96+ project. bintray {
97+ user = project. ext. bintrayUser
98+ key = project. ext. bintrayKey
99+ configurations = [" archives" ]
100+ dryRun = false
101+ pkg {
102+ repo = " maven"
103+ name = RUNTIME_ARTIFACT_ID
104+ userOrg = project. ext. bintrayUser
105+ licenses = [RUNTIME_LICENSE_NAME ]
106+ publish = true
107+ publicDownloadNumbers = true
108+ vcsUrl = VCS_URL
109+ version {
110+ name = VERSION_NAME
111+ desc = RUNTIME_DESCRIPTION
115112 }
113+ }
116114 }
115+ }
117116}
0 commit comments