Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tech refresh #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 29 additions & 15 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,7 +15,8 @@ buildscript {

allprojects {
repositories {
jcenter()
google()
mavenCentral()
}
}

Expand Down
37 changes: 16 additions & 21 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
BINTRAY_REPO = maven
BINTRAY_NAME = ShowcaseStepper

PUBLISHED_GROUP_ID = com.tokopedia.tkpdlib
LIBRARY_NAME = ShowcaseStepper
ARTIFACT = showcase-stepper

LIBRARY_DESC = A library to showcase chains of views to guide the user or for onboarding view / feature

SITE_URL = https://github.com/tokopedia/ShowCase
GIT_URL = https://github.com/tokopedia/ShowCase.git

LIBRARY_VERSION = 0.5.7

DEVELOPER_ID = tokopedia
DEVELOPER_NAME = Tokopedia
DEVELOPER_EMAIL = apps@tokopedia.com

LICENSE_NAME = The Apache Software License, Version 2.0
LICENSE_URL = http://www.apache.org/licenses/LICENSE-2.0.txt
ALLLICENSES = ["Apache-2.0"]
BINTRAY_REPO=maven
BINTRAY_NAME=ShowcaseStepper
PUBLISHED_GROUP_ID=com.tokopedia.tkpdlib
LIBRARY_NAME=ShowcaseStepper
ARTIFACT=showcase-stepper
LIBRARY_DESC=A library to showcase chains of views to guide the user or for onboarding view / feature
SITE_URL=https://github.com/tokopedia/ShowCase
GIT_URL=https://github.com/tokopedia/ShowCase.git
LIBRARY_VERSION=0.5.7
DEVELOPER_ID=tokopedia
DEVELOPER_NAME=Tokopedia
DEVELOPER_EMAIL=apps@tokopedia.com
LICENSE_NAME=The Apache Software License, Version 2.0
LICENSE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
ALLLICENSES=["Apache-2.0"]
android.useAndroidX=true
77 changes: 29 additions & 48 deletions gradle/mvn-install-publish.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

def pomConfig = {
licenses {
Expand All @@ -17,6 +16,34 @@ def pomConfig = {
}
}
}

if (project.hasProperty("android")) { // Android libraries
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompileProvider.get().classpath
}
}
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
} else { // Java libraries
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}

publishing {
publications {
tkpdPublish(MavenPublication) {
Expand All @@ -35,7 +62,7 @@ publishing {

def dependenciesNode = asNode().appendNode('dependencies')

configurations.compile.allDependencies.each {
configurations.implementation.allDependencies.each {
if (it.group != null && it.name != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
Expand All @@ -48,53 +75,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
}
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 12 additions & 11 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdk 31
buildToolsVersion "30.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"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
Expand All @@ -20,12 +20,13 @@ 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('androidx.test.espresso:espresso-core:3.1.0', {
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')
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
testImplementation 'junit:junit:4.13.2'
implementation project(path: ':showcase')
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.tokopedia.showcase.sample;

import static org.junit.Assert.assertEquals;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumentation test, which will execute on an Android device.
*
Expand All @@ -19,7 +20,7 @@ public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();

assertEquals("com.tokopedia.showcase.sample", appContext.getPackageName());
}
Expand Down
3 changes: 2 additions & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<activity
android:name="com.tokopedia.showcase.sample.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
android:theme="@style/AppTheme.NoActionBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Loading