-
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.
Make it uploadable to the Maven Central
- Loading branch information
Showing
4 changed files
with
82 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,16 @@ plugins { | |
id 'java' | ||
id 'java-library' | ||
id 'maven' | ||
id 'signing' | ||
} | ||
|
||
project.version = '1.0.0' | ||
group = 'org.flytrace' | ||
def projectFileName = "${project.name}" | ||
|
||
version = '1.0.0' | ||
project.version = version | ||
group = 'io.github.new-mikha' | ||
archivesBaseName = projectFileName | ||
ext.isReleaseVersion = !version.endsWith("SNAPSHOT") | ||
|
||
defaultTasks 'clean', 'build' | ||
|
||
|
@@ -20,28 +26,23 @@ repositories { | |
jcenter() | ||
} | ||
|
||
def projectFileName = "${project.name}-${project.version}" | ||
|
||
jar { | ||
archiveFileName = "${projectFileName}.jar" | ||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
archiveClassifier.set('sources') | ||
from sourceSets.main.allSource | ||
} | ||
|
||
task writePom { | ||
doLast { | ||
pom { | ||
}.writeTo("$buildDir/libs/${projectFileName}.pom") | ||
} | ||
task javadocJar(type: Jar, dependsOn: classes) { | ||
archiveClassifier.set('javadoc') | ||
from sourceSets.main.allSource | ||
} | ||
|
||
build.dependsOn(writePom) | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
archiveClassifier.set('sources') | ||
from sourceSets.main.allSource | ||
artifacts { | ||
archives javadocJar, sourcesJar | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
signing { | ||
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") } | ||
sign configurations.archives | ||
} | ||
|
||
dependencies { | ||
|
@@ -53,3 +54,48 @@ dependencies { | |
testImplementation 'junit:junit:4.12' | ||
testImplementation "org.mockito:mockito-core:2.1.0" | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: project.findProperty("nexusUsername"), password: project.findProperty("nexusPassword")) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: project.findProperty("nexusUsername"), password: project.findProperty("nexusPassword")) | ||
} | ||
|
||
pom.project { | ||
name 'rxhelpers' | ||
packaging 'jar' | ||
// optionally artifactId can be defined here | ||
description 'Add-ons for RxJava2, currently contains ReplayRemoveSubject that allows to remove replayable items from the buffer' | ||
url 'https://github.com/new-mikha/rxhelpers' | ||
|
||
scm { | ||
connection 'scm:git:https://github.com/new-mikha/rxhelpers' | ||
developerConnection 'scm:git:https://github.com/new-mikha/rxhelpers' | ||
url 'https://github.com/new-mikha/rxhelpers' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'The Apache License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'new-mikha' | ||
name 'Michael Karmazin' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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