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/app/build.gradle b/app/build.gradle index e900d59..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 project(':coachmark') + 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 fb898c6..fa9cf9f 100644 --- a/coachmark/build.gradle +++ b/coachmark/build.gradle @@ -1,7 +1,12 @@ plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' - id 'maven-publish' +} + +apply from: '../gradle/publish-package.gradle' + +ext { + ARTIFACT_ID = "coachmark" } kotlin { @@ -15,17 +20,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 @@ -49,16 +45,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/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 new file mode 100644 index 0000000..4098845 --- /dev/null +++ b/gradle/publish-package.gradle @@ -0,0 +1,128 @@ +apply plugin: 'maven-publish' +apply plugin: 'signing' + +ext { + GROUP_ID = "io.github.pseudoankit" + VERSION_NAME = "1.0.3" + + 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") + +} + +signing { + useInMemoryPgpKeys( + System.getenv("SIGNING_KEY_ID"), + System.getenv("SIGNING_KEY"), + System.getenv("SIGNING_PASSWORD"), + ) + sign publishing.publications +} + +afterEvaluate { + publishing { + publications { + release(MavenPublication) { + + from components.release + + groupId GROUP_ID + artifactId ARTIFACT_ID + version VERSION_NAME + + pom { + name = ARTIFACT_ID + 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 = 'pseudoankit' + name = 'Ankit Kumar' + email = 'lostankit7@gmail.com' + } + } + } + } + } + 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 OSS_USERNAME + password OSS_PASSWORD + } + } + + 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 OSS_USERNAME + password OSS_PASSWORD + } + } + } + } +} + +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 +} 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"