From c5195a1d69eed7a96b6207c2928cdc1fefb13c74 Mon Sep 17 00:00:00 2001 From: Ruby Hartono <58564005+rh-id@users.noreply.github.com> Date: Sat, 22 Jan 2022 18:54:34 +0700 Subject: [PATCH 1/6] Remove bintray and jcenter (jfrog shutdown the repository) & update gradle plugin to 7 --- .idea/compiler.xml | 18 +----- .idea/gradle.xml | 2 + .idea/misc.xml | 36 +++++++---- .idea/modules.xml | 10 --- .idea/runConfigurations.xml | 12 ---- build.gradle | 10 +-- gradle/mvn-install-publish.gradle | 79 ++++++------------------ gradle/wrapper/gradle-wrapper.properties | 2 +- sample/build.gradle | 12 ++-- showcase/build.gradle | 8 +-- 10 files changed, 61 insertions(+), 128 deletions(-) delete mode 100644 .idea/modules.xml delete mode 100644 .idea/runConfigurations.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..fb7f4a8 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,22 +1,6 @@ - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 15224c7..9366528 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -1,8 +1,10 @@ + - - - - - - - - - - - + diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 078cd2d..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index d489d02..01385d1 100644 --- a/build.gradle +++ b/build.gradle @@ -2,12 +2,11 @@ buildscript { repositories { - jcenter() + google() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' + classpath 'com.android.tools.build:gradle:7.0.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,7 +15,8 @@ buildscript { allprojects { repositories { - jcenter() + google() + mavenCentral() } } diff --git a/gradle/mvn-install-publish.gradle b/gradle/mvn-install-publish.gradle index 92cc1b1..8ec41d0 100644 --- a/gradle/mvn-install-publish.gradle +++ b/gradle/mvn-install-publish.gradle @@ -1,22 +1,27 @@ apply plugin: 'maven-publish' -apply plugin: 'com.jfrog.bintray' -def pomConfig = { - licenses { - license { - name LICENSE_NAME - url LICENSE_URL - distribution "repo" - } +if (project.hasProperty("android")) { // Android libraries + task sourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs } - developers { - developer { - id DEVELOPER_ID - name DEVELOPER_NAME - email DEVELOPER_EMAIL - } + + task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) } +} else { // Java libraries + task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource + } +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir } + publishing { publications { tkpdPublish(MavenPublication) { @@ -48,53 +53,7 @@ publishing { } } - -if (project.hasProperty("android")) { // Android libraries - task sourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - } - - task javadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - } -} else { // Java libraries - task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource - } -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - artifacts { archives javadocJar archives sourcesJar -} - -bintray { - user = bintray_user - key = bintray_api_key - publications = ['tkpdPublish'] - pkg { - repo = BINTRAY_REPO - name = BINTRAY_NAME - desc = LIBRARY_DESC - websiteUrl = SITE_URL - vcsUrl = GIT_URL - userOrg = bintray_org - licenses = ['Apache-2.0'] - publish = true - publicDownloadNumbers = true - version { - name = LIBRARY_VERSION - gpg { - sign = true - } - } - } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2edadee..5e661ed 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip \ No newline at end of file diff --git a/sample/build.gradle b/sample/build.gradle index e5d2c52..0ea1ac8 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -20,12 +20,12 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + implementation fileTree(dir: 'libs', include: ['*.jar']) + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - compile 'com.android.support:appcompat-v7:25.3.1' - compile 'com.android.support:design:25.3.1' - testCompile 'junit:junit:4.12' - compile project(path: ':showcase') + implementation 'com.android.support:appcompat-v7:25.3.1' + implementation 'com.android.support:design:25.3.1' + testImplementation 'junit:junit:4.12' + implementation project(path: ':showcase') } diff --git a/showcase/build.gradle b/showcase/build.gradle index b85af8d..ff114fd 100644 --- a/showcase/build.gradle +++ b/showcase/build.gradle @@ -22,12 +22,12 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + implementation fileTree(dir: 'libs', include: ['*.jar']) + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - compile 'com.android.support:appcompat-v7:25.3.1' - testCompile 'junit:junit:4.12' + implementation 'com.android.support:appcompat-v7:25.3.1' + testImplementation 'junit:junit:4.12' } apply from: rootProject.file('gradle/mvn-install-publish.gradle') From c76e1e961594fe3317dca9bc84691db3b7a57dae Mon Sep 17 00:00:00 2001 From: Ruby Hartono <58564005+rh-id@users.noreply.github.com> Date: Sat, 22 Jan 2022 18:58:42 +0700 Subject: [PATCH 2/6] Fix SDK configuration --- sample/build.gradle | 8 ++++---- showcase/build.gradle | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sample/build.gradle b/sample/build.gradle index 0ea1ac8..029ac38 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdk 31 + buildToolsVersion "25.0.3" defaultConfig { applicationId "com.tokopedia.showcase.sample" - minSdkVersion 16 - targetSdkVersion 25 + minSdk 16 + targetSdk 31 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/showcase/build.gradle b/showcase/build.gradle index ff114fd..082d424 100644 --- a/showcase/build.gradle +++ b/showcase/build.gradle @@ -1,12 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 25 + compileSdk 31 buildToolsVersion "25.0.3" defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 + minSdk 14 versionCode 1 versionName "0.5" From 05d98a5af563f98b42f74f02555aa704ac3b359d Mon Sep 17 00:00:00 2001 From: Ruby Hartono <58564005+rh-id@users.noreply.github.com> Date: Sat, 22 Jan 2022 19:22:14 +0700 Subject: [PATCH 3/6] Migrate to AndroidX --- .idea/misc.xml | 8 +++- gradle.properties | 38 +++++++++---------- sample/build.gradle | 13 ++++--- .../sample/ExampleInstrumentedTest.java | 11 +++--- sample/src/main/AndroidManifest.xml | 3 +- .../showcase/sample/MainActivity.java | 16 ++++---- .../showcase/sample/SampleAdapter.java | 3 +- .../sample/ScrollShowCaseActivity.java | 7 ++-- sample/src/main/res/layout/activity_main.xml | 16 ++++---- .../res/layout/activity_scroll_showcase.xml | 20 +++++----- sample/src/main/res/layout/sample_item.xml | 9 +++-- showcase/build.gradle | 11 +++--- .../showcase/ExampleInstrumentedTest.java | 11 +++--- .../tokopedia/showcase/ShowCaseDialog.java | 7 ++-- .../tokopedia/showcase/ShowCaseLayout.java | 8 ++-- .../tokopedia/showcase/ShowCaseObject.java | 3 +- .../src/main/res/layout/tutorial_view.xml | 36 +++++++++--------- 17 files changed, 116 insertions(+), 104 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 5f3b786..19b8030 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,7 +1,11 @@ - - + +