From 5a19eed5a21d3c0a5d05403ca40fe654330f81d1 Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Tue, 23 Jan 2024 00:36:24 +0530 Subject: [PATCH 01/11] added maven central publish changes --- .idea/misc.xml | 3 ++- build.gradle | 3 +++ coachmark/build.gradle | 2 +- gradle.properties | 22 +++++++++++++++++++++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 773fe0f..0ad17cb 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,7 @@ + - + diff --git a/build.gradle b/build.gradle index 24d2b3a..9076d37 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,9 @@ buildscript { ext { compose_compiler = '1.3.2' } + dependencies { + classpath("com.vanniktech:gradle-maven-publish-plugin:0.20.0") + } } plugins { id 'com.android.application' version '8.0.1' apply false diff --git a/coachmark/build.gradle b/coachmark/build.gradle index fb898c6..6388ff1 100644 --- a/coachmark/build.gradle +++ b/coachmark/build.gradle @@ -1,7 +1,7 @@ plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' - id 'maven-publish' + id "com.vanniktech.maven.publish" apply true } kotlin { diff --git a/gradle.properties b/gradle.properties index 3c5031e..7ade138 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,24 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true +SONATYPE_HOST=S01 +RELEASE_SIGNING_ENABLED=true +GROUP=io.github.pseudoankit +POM_ARTIFACT_ID=coachmark +VERSION_NAME=1.0.0 +POM_NAME=coachmark library +POM_DESCRIPTION=Compose library to add coachmark +POM_INCEPTION_YEAR=2024 +POM_URL=https://github.com/pseudoankit/coachmark +POM_LICENSE_NAME=The Apache Software License, Version 2.0 +POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENSE_DIST=repo +POM_SCM_URL=An android library to create onboarding flow with compose +POM_SCM_CONNECTION=scm:git:git://github.com/pseudoankit/coachmark.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/pseudoankit/coachmark.git +POM_DEVELOPER_ID=pseudoankit +POM_DEVELOPER_NAME=Ankit Kumar +POM_DEVELOPER_URL=https://github.com/pseudoankit/ +mavenCentralUsername=YOUR_SONATYPE_USERNAME +mavenCentralPassword=YOUR_SONATYPE_PASSWORD \ No newline at end of file From 58a58566498d190934a9ceb09e9fda059af7fa0c Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Wed, 24 Jan 2024 01:38:55 +0530 Subject: [PATCH 02/11] added maven central publish changes --- app/build.gradle | 2 +- build.gradle | 3 -- coachmark/build.gradle | 16 +----- gradle.properties | 26 ++++------ publish-package.gradle | 111 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 125 insertions(+), 33 deletions(-) create mode 100644 publish-package.gradle diff --git a/app/build.gradle b/app/build.gradle index e900d59..0246372 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,7 +52,7 @@ dependencies { implementation('org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0') } - implementation project(':coachmark') + implementation 'io.github.pseudoankit:coachmark:1.0.0' implementation 'androidx.activity:activity-compose:1.7.2' implementation platform('androidx.compose:compose-bom:2022.10.00') implementation 'androidx.compose.ui:ui' diff --git a/build.gradle b/build.gradle index 9076d37..24d2b3a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,6 @@ buildscript { ext { compose_compiler = '1.3.2' } - dependencies { - classpath("com.vanniktech:gradle-maven-publish-plugin:0.20.0") - } } plugins { id 'com.android.application' version '8.0.1' apply false diff --git a/coachmark/build.gradle b/coachmark/build.gradle index 6388ff1..cf2b89a 100644 --- a/coachmark/build.gradle +++ b/coachmark/build.gradle @@ -1,9 +1,10 @@ plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' - id "com.vanniktech.maven.publish" apply true } +apply from: '../publish-package.gradle' + kotlin { explicitApi = 'strict' } @@ -49,16 +50,3 @@ dependencies { implementation 'androidx.compose.ui:ui-tooling-preview' implementation 'androidx.compose.material3:material3' } - -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - groupId = 'com.pseudoankit' - artifactId = 'compose-coachmark' - version = '1.0.0' - } - } - } -} diff --git a/gradle.properties b/gradle.properties index 7ade138..7dcfee6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,23 +21,19 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -SONATYPE_HOST=S01 -RELEASE_SIGNING_ENABLED=true -GROUP=io.github.pseudoankit -POM_ARTIFACT_ID=coachmark +# Maven details VERSION_NAME=1.0.0 -POM_NAME=coachmark library +VERSION_CODE=1 +GROUP=io.github.pseudoankit POM_DESCRIPTION=Compose library to add coachmark -POM_INCEPTION_YEAR=2024 POM_URL=https://github.com/pseudoankit/coachmark -POM_LICENSE_NAME=The Apache Software License, Version 2.0 -POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt -POM_LICENSE_DIST=repo -POM_SCM_URL=An android library to create onboarding flow with compose -POM_SCM_CONNECTION=scm:git:git://github.com/pseudoankit/coachmark.git -POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/pseudoankit/coachmark.git +POM_SCM_CONNECTION=scm:git@github.com:pseudoankit/coachmark.git POM_DEVELOPER_ID=pseudoankit POM_DEVELOPER_NAME=Ankit Kumar -POM_DEVELOPER_URL=https://github.com/pseudoankit/ -mavenCentralUsername=YOUR_SONATYPE_USERNAME -mavenCentralPassword=YOUR_SONATYPE_PASSWORD \ No newline at end of file +POM_DEVELOPER_EMAIL=lostankit7@gmail.com +#**** +signing.keyId= +signing.password= +signing.secretKeyRingFile= +ossrhUsername= +ossrhPassword= diff --git a/publish-package.gradle b/publish-package.gradle new file mode 100644 index 0000000..2a4b1c4 --- /dev/null +++ b/publish-package.gradle @@ -0,0 +1,111 @@ +apply plugin: 'maven-publish' +apply plugin: 'signing' + +task androidJavadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + android.libraryVariants.all { variant -> + if (variant.name == 'release') { + owner.classpath += variant.javaCompileProvider.get().classpath + } + } + + exclude '**/R.html', '**/R.*.html', '**/index.html' + options.encoding 'utf-8' + options { + addStringOption 'docencoding', 'utf-8' + addStringOption 'charset', 'utf-8' + links 'https://docs.oracle.com/javase/7/docs/api/' + links 'https://d.android.com/reference' + links 'https://developer.android.com/reference/androidx/' + } +} + +task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { + archiveClassifier.set('javadoc') + from androidJavadoc.destinationDir + + preserveFileTimestamps = false + reproducibleFileOrder = true +} + +task javaSourcesJar(type: Jar) { + archiveClassifier.set('sources') + from android.sourceSets.main.java.srcDirs + + preserveFileTimestamps = false + reproducibleFileOrder = true +} + +afterEvaluate { + publishing { + publications { + release(MavenPublication) { + + from components.release + +// artifact androidJavadocJar +// artifact javaSourcesJar + + groupId GROUP + version VERSION_NAME + pom { + name = artifactId + description = POM_DESCRIPTION + url = POM_URL + licenses { + license { + name = 'The Apache Software License, Version 2.0' + url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + scm { + connection = POM_SCM_CONNECTION + developerConnection = POM_SCM_CONNECTION + url = POM_URL + } + developers { + developer { + id = POM_DEVELOPER_ID + name = POM_DEVELOPER_NAME + email = POM_DEVELOPER_EMAIL + } + } + } + } + } + repositories { + maven { + name = "SonatypeSnapshot" + +// def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" +// def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" +// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" + + credentials { + username ossrhUsername + password ossrhPassword + } + } + + maven { + name = "sonatype" + +// def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" +// def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" +// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + + credentials { + username ossrhUsername + password ossrhPassword + } + } + } + } +} + +signing { + sign publishing.publications +} \ No newline at end of file From a6da4bfe0c626d27f4875c020c9286e0b1638859 Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Thu, 25 Jan 2024 01:19:43 +0530 Subject: [PATCH 03/11] refactored keys to gradle file --- gradle.properties | 10 ---------- publish-package.gradle | 17 ++++++++++------- settings.gradle | 1 - 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7dcfee6..290e212 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,16 +21,6 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -# Maven details -VERSION_NAME=1.0.0 -VERSION_CODE=1 -GROUP=io.github.pseudoankit -POM_DESCRIPTION=Compose library to add coachmark -POM_URL=https://github.com/pseudoankit/coachmark -POM_SCM_CONNECTION=scm:git@github.com:pseudoankit/coachmark.git -POM_DEVELOPER_ID=pseudoankit -POM_DEVELOPER_NAME=Ankit Kumar -POM_DEVELOPER_EMAIL=lostankit7@gmail.com #**** signing.keyId= signing.password= diff --git a/publish-package.gradle b/publish-package.gradle index 2a4b1c4..b326f74 100644 --- a/publish-package.gradle +++ b/publish-package.gradle @@ -1,6 +1,12 @@ apply plugin: 'maven-publish' apply plugin: 'signing' +def VERSION_NAME = '1.0.0' +def GROUP_ID = 'io.github.pseudoankit' +def POM_DESCRIPTION = 'Compose library to add coachmark' +def POM_URL = 'https://github.com/pseudoankit/coachmark' +def POM_SCM_CONNECTION = 'scm:git@github.com:pseudoankit/coachmark.git' + task androidJavadoc(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) @@ -44,10 +50,7 @@ afterEvaluate { from components.release -// artifact androidJavadocJar -// artifact javaSourcesJar - - groupId GROUP + groupId GROUP_ID version VERSION_NAME pom { name = artifactId @@ -66,9 +69,9 @@ afterEvaluate { } developers { developer { - id = POM_DEVELOPER_ID - name = POM_DEVELOPER_NAME - email = POM_DEVELOPER_EMAIL + id = 'pseudoankit' + name = 'Ankit Kumar' + email = 'lostankit7@gmail.com' } } } diff --git a/settings.gradle b/settings.gradle index e5af097..ee136ab 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,7 +10,6 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - maven { url 'https://jitpack.io' } } } rootProject.name = "coachmark" From bc35db3ee511bea4437ededd23903e8d776a545d Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Thu, 25 Jan 2024 01:34:51 +0530 Subject: [PATCH 04/11] moved to env variables --- gradle.properties | 8 +------- publish-package.gradle | 37 +++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/gradle.properties b/gradle.properties index 290e212..3c5031e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,10 +20,4 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true -#**** -signing.keyId= -signing.password= -signing.secretKeyRingFile= -ossrhUsername= -ossrhPassword= +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/publish-package.gradle b/publish-package.gradle index b326f74..ff73ece 100644 --- a/publish-package.gradle +++ b/publish-package.gradle @@ -1,12 +1,6 @@ apply plugin: 'maven-publish' apply plugin: 'signing' -def VERSION_NAME = '1.0.0' -def GROUP_ID = 'io.github.pseudoankit' -def POM_DESCRIPTION = 'Compose library to add coachmark' -def POM_URL = 'https://github.com/pseudoankit/coachmark' -def POM_SCM_CONNECTION = 'scm:git@github.com:pseudoankit/coachmark.git' - task androidJavadoc(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) @@ -58,8 +52,8 @@ afterEvaluate { url = POM_URL licenses { license { - name = 'The Apache Software License, Version 2.0' - url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' + name = LICENCE_NAME + url = LICENCE_URL } } scm { @@ -87,8 +81,8 @@ afterEvaluate { url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" credentials { - username ossrhUsername - password ossrhPassword + username OSS_USERNAME + password OSS_PASSWORD } } @@ -101,14 +95,33 @@ afterEvaluate { url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" credentials { - username ossrhUsername - password ossrhPassword + username OSS_USERNAME + password OSS_PASSWORD } } } } } +ext { + VERSION_NAME = "1.0.0" + + GROUP_ID = "io.github.pseudoankit" + + POM_DESCRIPTION = "Compose library to add coachmark" + POM_URL = "https://github.com/pseudoankit/coachmark" + POM_SCM_CONNECTION = "scm:git@github.com:pseudoankit/coachmark.git" + + OSS_USERNAME = System.getenv("OSS_USERNAME") + OSS_PASSWORD = System.getenv("OSS_PASSWORD") + ext."signing.keyId" = System.getenv("SIGNING_KEY_ID") + ext."signing.password" = System.getenv("SIGNING_PASSWORD") + ext."signing.secretKeyRingFile" = System.getenv("SIGNING_SECRET_KEY_RING_FILE") + + LICENCE_NAME = "The Apache Software License, Version 2.0" + LICENCE_URL = "https://www.apache.org/licenses/LICENSE-2.0.txt" +} + signing { sign publishing.publications } \ No newline at end of file From 79d779910cf3c8a6fedc1e571abcb846adfeb22f Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Thu, 25 Jan 2024 01:59:08 +0530 Subject: [PATCH 05/11] moved to env variables, gradle cleanup --- coachmark/build.gradle | 14 +++++--------- publish-package.gradle | 2 -- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/coachmark/build.gradle b/coachmark/build.gradle index cf2b89a..b350789 100644 --- a/coachmark/build.gradle +++ b/coachmark/build.gradle @@ -5,6 +5,11 @@ plugins { apply from: '../publish-package.gradle' +ext { + VERSION_NAME = "1.0.0" + ARTIFACT_ID = "coachmark" +} + kotlin { explicitApi = 'strict' } @@ -16,17 +21,8 @@ android { defaultConfig { minSdk 19 targetSdk 34 - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles "consumer-rules.pro" } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/publish-package.gradle b/publish-package.gradle index ff73ece..d0f3ae4 100644 --- a/publish-package.gradle +++ b/publish-package.gradle @@ -104,8 +104,6 @@ afterEvaluate { } ext { - VERSION_NAME = "1.0.0" - GROUP_ID = "io.github.pseudoankit" POM_DESCRIPTION = "Compose library to add coachmark" From 206253f54231c01a77cb5cf7c2db5c7498b276ab Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Thu, 25 Jan 2024 02:10:09 +0530 Subject: [PATCH 06/11] upgraded version --- coachmark/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coachmark/build.gradle b/coachmark/build.gradle index b350789..0b93330 100644 --- a/coachmark/build.gradle +++ b/coachmark/build.gradle @@ -6,7 +6,7 @@ plugins { apply from: '../publish-package.gradle' ext { - VERSION_NAME = "1.0.0" + VERSION_NAME = "1.0.1" ARTIFACT_ID = "coachmark" } From be9f481c6a8f5e61e9ae38ff6633c3230f6d5c35 Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Thu, 25 Jan 2024 02:23:23 +0530 Subject: [PATCH 07/11] upgraded version --- coachmark/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coachmark/build.gradle b/coachmark/build.gradle index 0b93330..f998af7 100644 --- a/coachmark/build.gradle +++ b/coachmark/build.gradle @@ -6,7 +6,7 @@ plugins { apply from: '../publish-package.gradle' ext { - VERSION_NAME = "1.0.1" + VERSION_NAME = "1.0.2" ARTIFACT_ID = "coachmark" } From 2a3cc3086667f5e33b78a7df394fdb0506a8582c Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Fri, 26 Jan 2024 01:42:46 +0530 Subject: [PATCH 08/11] moved to gradle folder --- app/build.gradle | 2 +- coachmark/build.gradle | 3 +-- publish-package.gradle => gradle/publish-package.gradle | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) rename publish-package.gradle => gradle/publish-package.gradle (99%) diff --git a/app/build.gradle b/app/build.gradle index 0246372..2e31741 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,7 +52,7 @@ dependencies { implementation('org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0') } - implementation 'io.github.pseudoankit:coachmark:1.0.0' + implementation 'io.github.pseudoankit:coachmark:1.0.2' implementation 'androidx.activity:activity-compose:1.7.2' implementation platform('androidx.compose:compose-bom:2022.10.00') implementation 'androidx.compose.ui:ui' diff --git a/coachmark/build.gradle b/coachmark/build.gradle index f998af7..fa9cf9f 100644 --- a/coachmark/build.gradle +++ b/coachmark/build.gradle @@ -3,10 +3,9 @@ plugins { id 'org.jetbrains.kotlin.android' } -apply from: '../publish-package.gradle' +apply from: '../gradle/publish-package.gradle' ext { - VERSION_NAME = "1.0.2" ARTIFACT_ID = "coachmark" } diff --git a/publish-package.gradle b/gradle/publish-package.gradle similarity index 99% rename from publish-package.gradle rename to gradle/publish-package.gradle index d0f3ae4..c23160b 100644 --- a/publish-package.gradle +++ b/gradle/publish-package.gradle @@ -105,6 +105,7 @@ afterEvaluate { ext { GROUP_ID = "io.github.pseudoankit" + VERSION_NAME = "1.0.2" POM_DESCRIPTION = "Compose library to add coachmark" POM_URL = "https://github.com/pseudoankit/coachmark" From ab1335ed9a1e2670289d7c21491c927de06d77af Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Fri, 26 Jan 2024 01:48:21 +0530 Subject: [PATCH 09/11] code refactoring --- coachmark/consumer-rules.pro | 0 coachmark/proguard-rules.pro | 21 -------- gradle/publish-package.gradle | 97 +++++++++++++++++------------------ 3 files changed, 48 insertions(+), 70 deletions(-) delete mode 100644 coachmark/consumer-rules.pro delete mode 100644 coachmark/proguard-rules.pro diff --git a/coachmark/consumer-rules.pro b/coachmark/consumer-rules.pro deleted file mode 100644 index e69de29..0000000 diff --git a/coachmark/proguard-rules.pro b/coachmark/proguard-rules.pro deleted file mode 100644 index 481bb43..0000000 --- a/coachmark/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/gradle/publish-package.gradle b/gradle/publish-package.gradle index c23160b..35ac070 100644 --- a/gradle/publish-package.gradle +++ b/gradle/publish-package.gradle @@ -1,40 +1,23 @@ apply plugin: 'maven-publish' apply plugin: 'signing' -task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - android.libraryVariants.all { variant -> - if (variant.name == 'release') { - owner.classpath += variant.javaCompileProvider.get().classpath - } - } - - exclude '**/R.html', '**/R.*.html', '**/index.html' - options.encoding 'utf-8' - options { - addStringOption 'docencoding', 'utf-8' - addStringOption 'charset', 'utf-8' - links 'https://docs.oracle.com/javase/7/docs/api/' - links 'https://d.android.com/reference' - links 'https://developer.android.com/reference/androidx/' - } -} +ext { + GROUP_ID = "io.github.pseudoankit" + VERSION_NAME = "1.0.2" -task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - archiveClassifier.set('javadoc') - from androidJavadoc.destinationDir + POM_DESCRIPTION = "Compose library to add coachmark" + POM_URL = "https://github.com/pseudoankit/coachmark" + POM_SCM_CONNECTION = "scm:git@github.com:pseudoankit/coachmark.git" - preserveFileTimestamps = false - reproducibleFileOrder = true + OSS_USERNAME = System.getenv("OSS_USERNAME") + OSS_PASSWORD = System.getenv("OSS_PASSWORD") + ext."signing.keyId" = System.getenv("SIGNING_KEY_ID") + ext."signing.password" = System.getenv("SIGNING_PASSWORD") + ext."signing.secretKeyRingFile" = System.getenv("SIGNING_SECRET_KEY_RING_FILE") } -task javaSourcesJar(type: Jar) { - archiveClassifier.set('sources') - from android.sourceSets.main.java.srcDirs - - preserveFileTimestamps = false - reproducibleFileOrder = true +signing { + sign publishing.publications } afterEvaluate { @@ -45,15 +28,17 @@ afterEvaluate { from components.release groupId GROUP_ID + artifactId ARTIFACT_ID version VERSION_NAME + pom { - name = artifactId + name = ARTIFACT_ID description = POM_DESCRIPTION url = POM_URL licenses { license { - name = LICENCE_NAME - url = LICENCE_URL + name = "The Apache Software License, Version 2.0" + url = "https://www.apache.org/licenses/LICENSE-2.0.txt" } } scm { @@ -103,24 +88,38 @@ afterEvaluate { } } -ext { - GROUP_ID = "io.github.pseudoankit" - VERSION_NAME = "1.0.2" +task androidJavadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + android.libraryVariants.all { variant -> + if (variant.name == 'release') { + owner.classpath += variant.javaCompileProvider.get().classpath + } + } - POM_DESCRIPTION = "Compose library to add coachmark" - POM_URL = "https://github.com/pseudoankit/coachmark" - POM_SCM_CONNECTION = "scm:git@github.com:pseudoankit/coachmark.git" + exclude '**/R.html', '**/R.*.html', '**/index.html' + options.encoding 'utf-8' + options { + addStringOption 'docencoding', 'utf-8' + addStringOption 'charset', 'utf-8' + links 'https://docs.oracle.com/javase/7/docs/api/' + links 'https://d.android.com/reference' + links 'https://developer.android.com/reference/androidx/' + } +} - OSS_USERNAME = System.getenv("OSS_USERNAME") - OSS_PASSWORD = System.getenv("OSS_PASSWORD") - ext."signing.keyId" = System.getenv("SIGNING_KEY_ID") - ext."signing.password" = System.getenv("SIGNING_PASSWORD") - ext."signing.secretKeyRingFile" = System.getenv("SIGNING_SECRET_KEY_RING_FILE") +task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { + archiveClassifier.set('javadoc') + from androidJavadoc.destinationDir - LICENCE_NAME = "The Apache Software License, Version 2.0" - LICENCE_URL = "https://www.apache.org/licenses/LICENSE-2.0.txt" + preserveFileTimestamps = false + reproducibleFileOrder = true } -signing { - sign publishing.publications -} \ No newline at end of file +task javaSourcesJar(type: Jar) { + archiveClassifier.set('sources') + from android.sourceSets.main.java.srcDirs + + preserveFileTimestamps = false + reproducibleFileOrder = true +} From 74e78fa66b0a4c71e78b4c2807c850d1dc05cbdc Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Fri, 26 Jan 2024 02:32:15 +0530 Subject: [PATCH 10/11] used keys instead of file --- gradle/publish-package.gradle | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gradle/publish-package.gradle b/gradle/publish-package.gradle index 35ac070..6564e0f 100644 --- a/gradle/publish-package.gradle +++ b/gradle/publish-package.gradle @@ -11,12 +11,15 @@ ext { OSS_USERNAME = System.getenv("OSS_USERNAME") OSS_PASSWORD = System.getenv("OSS_PASSWORD") - ext."signing.keyId" = System.getenv("SIGNING_KEY_ID") - ext."signing.password" = System.getenv("SIGNING_PASSWORD") - ext."signing.secretKeyRingFile" = System.getenv("SIGNING_SECRET_KEY_RING_FILE") + } signing { + useInMemoryPgpKeys( + System.getenv("SIGNING_KEY_ID"), + System.getenv("SIGNING_KEY"), + System.getenv("SIGNING_PASSWORD"), + ) sign publishing.publications } From 2fe0e0c99108d4a94e0a1deb196e01ba24694f4d Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Fri, 26 Jan 2024 02:48:44 +0530 Subject: [PATCH 11/11] bump version --- gradle/publish-package.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/publish-package.gradle b/gradle/publish-package.gradle index 6564e0f..4098845 100644 --- a/gradle/publish-package.gradle +++ b/gradle/publish-package.gradle @@ -3,7 +3,7 @@ apply plugin: 'signing' ext { GROUP_ID = "io.github.pseudoankit" - VERSION_NAME = "1.0.2" + VERSION_NAME = "1.0.3" POM_DESCRIPTION = "Compose library to add coachmark" POM_URL = "https://github.com/pseudoankit/coachmark"