-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
304 additions
and
55 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
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 +1 @@ | ||
4.4.0 | ||
4.5.0 |
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
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 |
---|---|---|
@@ -0,0 +1,113 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
task('sourcesJar', type: Jar, dependsOn: classes) { | ||
archiveClassifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
task('javadocJar', type: Jar, dependsOn: javadoc) { | ||
archiveClassifier = 'javadoc' | ||
from javadoc.getDestinationDir() | ||
} | ||
tasks.withType(Javadoc).configureEach { | ||
javadocTool = javaToolchains.javadocToolFor { | ||
// Use latest JDK for javadoc generation | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
javadoc { | ||
// Specify the Java version that the project will use | ||
options.addStringOption('-release', "11") | ||
} | ||
artifacts { | ||
archives sourcesJar, javadocJar | ||
} | ||
|
||
|
||
final releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
final snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
|
||
groupId = GROUP | ||
artifactId = POM_ARTIFACT_ID | ||
version = getVersionName() | ||
|
||
artifact("$buildDir/libs/${project.name}-${version}.jar") | ||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
pom { | ||
name = POM_NAME | ||
packaging = POM_PACKAGING | ||
description = POM_DESCRIPTION | ||
url = POM_URL | ||
|
||
licenses { | ||
license { | ||
name = POM_LICENCE_NAME | ||
url = POM_LICENCE_URL | ||
distribution = POM_LICENCE_DIST | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = POM_DEVELOPER_ID | ||
name = POM_DEVELOPER_NAME | ||
email = POM_DEVELOPER_EMAIL | ||
} | ||
} | ||
|
||
scm { | ||
url = POM_SCM_URL | ||
connection = POM_SCM_CONNECTION | ||
developerConnection = POM_SCM_DEV_CONNECTION | ||
} | ||
|
||
pom.withXml { | ||
def dependenciesNode = asNode().appendNode('dependencies') | ||
|
||
project.configurations.implementation.allDependencies.each { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', it.group) | ||
dependencyNode.appendNode('artifactId', it.name) | ||
dependencyNode.appendNode('version', it.version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = "sonatype" | ||
url = version.endsWith('SNAPSHOT') ? snapshotRepositoryUrl : releaseRepositoryUrl | ||
credentials { | ||
username = System.getenv("MAVEN_USERNAME") | ||
password = System.getenv("MAVEN_PASSWORD") | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
def signingKey = System.getenv("SIGNING_KEY") | ||
def signingPassword = System.getenv("SIGNING_PASSWORD") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
|
||
sign publishing.publications.mavenJava | ||
} | ||
|
||
javadoc { | ||
if(JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} | ||
|
||
tasks.named('publish').configure { | ||
dependsOn tasks.named('assemble') | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
def getVersionFromFile() { | ||
def versionFile = rootProject.file('.version') | ||
return versionFile.text.readLines().first().trim() | ||
} | ||
|
||
def isSnapshot() { | ||
return hasProperty('isSnapshot') ? isSnapshot.toBoolean() : true | ||
} | ||
|
||
def getVersionName() { | ||
return isSnapshot() ? project.version+"-SNAPSHOT" : project.version | ||
} | ||
|
||
ext { | ||
getVersionName = this.&getVersionName | ||
getVersionFromFile = this.&getVersionFromFile | ||
} |
Oops, something went wrong.