From c174b99a7dab4a8cb8945d5fa76620fd2e484f3c Mon Sep 17 00:00:00 2001 From: Michael Antiufieiev Date: Tue, 19 Mar 2024 13:01:28 +0200 Subject: [PATCH 1/2] migration to maven publish --- mavenpush.gradle | 116 ++++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/mavenpush.gradle b/mavenpush.gradle index d708b725..4b99779e 100644 --- a/mavenpush.gradle +++ b/mavenpush.gradle @@ -1,5 +1,4 @@ -/* -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' def sonatypeRepositoryUrl @@ -21,73 +20,76 @@ def getRepositoryPassword() { return hasProperty('nexusPassword') ? nexusPassword : "" } -afterEvaluate { project -> - uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - pom.artifactId = POM_ARTIFACT_ID +tasks.register('androidJavadocs', Javadoc) { + source = android.sourceSets.main.java.sourceFiles +} - repository(url: sonatypeRepositoryUrl) { - authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) - } +tasks.register('androidJavadocsJar', Jar) { + classifier = 'javadoc' + //basename = artifact_id + from androidJavadocs.destinationDir +} - pom.project { - name POM_NAME - packaging POM_PACKAGING - description POM_DESCRIPTION - url POM_URL +tasks.register('androidSourcesJar', Jar) { + classifier = 'sources' + //basename = artifact_id + from android.sourceSets.main.java.sourceFiles +} - scm { - url POM_SCM_URL - connection POM_SCM_CONNECTION - developerConnection POM_SCM_DEV_CONNECTION - } +publishing { + repositories { + maven { + url = sonatypeRepositoryUrl + credentials { + username = getRepositoryUsername() + password = getRepositoryPassword() + } + } + } + publications { + maven(MavenPublication) { + afterEvaluate { project -> + from components.release + artifact androidSourcesJar + artifact androidJavadocsJar + version = project.version + } + + pom { + name = POM_NAME + packaging = POM_PACKAGING + description = POM_DESCRIPTION + url = POM_URL + scm { + url = POM_SCM_URL + connection = POM_SCM_CONNECTION + developerConnection = POM_SCM_DEV_CONNECTION + } - licenses { - license { - name POM_LICENCE_NAME - url POM_LICENCE_URL - distribution POM_LICENCE_DIST - } + licenses { + license { + name = POM_LICENCE_NAME + url = POM_LICENCE_URL + distribution = POM_LICENCE_DIST } + } - developers { - developer { - id POM_DEVELOPER_ID - name POM_DEVELOPER_NAME - } + developers { + developer { + id = POM_DEVELOPER_ID + name = POM_DEVELOPER_NAME } } } } } +} - signing { - required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } - sign configurations.archives - } - - task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.sourceFiles - } - - task androidJavadocsJar(type: Jar) { - classifier = 'javadoc' - //basename = artifact_id - from androidJavadocs.destinationDir - } - task androidSourcesJar(type: Jar) { - classifier = 'sources' - //basename = artifact_id - from android.sourceSets.main.java.sourceFiles - } +signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("publishing") } + sign publishing.publications.maven + sign configurations.archives +} - artifacts { - //archives packageReleaseJar - archives androidSourcesJar - archives androidJavadocsJar - } -}*/ From 4df4dfccb58821bba49c5c134784b4c50cbbae31 Mon Sep 17 00:00:00 2001 From: Michael Antiufieiev Date: Tue, 19 Mar 2024 13:27:23 +0200 Subject: [PATCH 2/2] use java 11 for jitpack publishing --- jitpack.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 jitpack.yml diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..0e082489 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,6 @@ +# configuration file for building snapshots and releases with jitpack.io +jdk: + - openjdk11 +before_install: + - sdk install java 11.0.10-open + - sdk use java 11.0.10-open \ No newline at end of file