Skip to content

Commit bb33e86

Browse files
committed
Release 1.6.1
• Adds support for Android 13 (API level 33) • Migrates from Android Support Library to AndroidX
1 parent 2b970ec commit bb33e86

File tree

339 files changed

+24524
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+24524
-170
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: CI
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
types: [opened, synchronize, reopened]
67
push:
@@ -15,7 +16,7 @@ jobs:
1516
- uses: actions/checkout@v2
1617
- uses: actions/setup-java@v1
1718
with:
18-
java-version: 1.8
19+
java-version: 17
1920
- uses: actions/cache@v2
2021
with:
2122
path: |
@@ -35,7 +36,7 @@ jobs:
3536
- uses: actions/checkout@v2
3637
- uses: actions/setup-java@v1
3738
with:
38-
java-version: 1.8
39+
java-version: 17
3940
- uses: actions/cache@v2
4041
with:
4142
path: |
@@ -64,7 +65,7 @@ jobs:
6465
- uses: actions/checkout@v2
6566
- uses: actions/setup-java@v1
6667
with:
67-
java-version: 1.8
68+
java-version: 17
6869
- uses: actions/cache@v2
6970
with:
7071
path: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ google-services.json
5050
freeline.py
5151
freeline/
5252
freeline_project_description.json
53+
54+
# OS-specific metadata
55+
.DS_Store

build.gradle

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,27 @@
2626
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2727

2828
buildscript {
29-
ext.kotlin_version = '1.4.10'
29+
ext.kotlin_version = '1.9.0'
3030

3131
repositories {
3232
google()
3333
mavenCentral()
3434
}
3535
dependencies {
36-
classpath 'com.android.tools.build:gradle:4.2.2'
37-
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
38-
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.16.0'
36+
classpath 'com.android.tools.build:gradle:8.0.2'
3937
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
4038

4139
// NOTE: Do not place your application dependencies here; they belong
4240
// in the individual module build.gradle files
4341
}
4442
}
4543

44+
plugins {
45+
id 'org.jetbrains.dokka' version '1.8.20'
46+
id 'com.github.kt3k.coveralls' version '2.12.2'
47+
id 'jacoco'
48+
}
49+
4650
allprojects {
4751
repositories {
4852
maven {
@@ -77,9 +81,10 @@ subprojects {
7781
}
7882

7983
ext {
80-
supportLibVersion = '28.0.0'
84+
annotationVersion = '1.6.0'
85+
espressoVersion = '3.1.0'
8186
junitVersion = '4.13.1'
8287
mockitoVersion = '2.28.2'
83-
espressoVersion = '3.0.2'
8488
testRunnerVersion = '1.0.2'
89+
mockwebserverVersion = '4.4.0'
8590
}

button-merchant/build.gradle

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@
2525

2626
apply plugin: 'com.android.library'
2727
apply plugin: 'com.github.kt3k.coveralls'
28-
apply plugin: 'com.vanniktech.android.junit.jacoco'
28+
apply plugin: 'jacoco'
2929

3030
apply from: "${rootProject.projectDir}/button-merchant/publish-maven-central.gradle"
3131

3232
android {
33-
compileSdkVersion 28
33+
compileSdkVersion 33
3434

3535
defaultConfig {
3636
minSdkVersion 15
37-
targetSdkVersion 28
37+
targetSdkVersion 33
3838
buildConfigField 'int', 'VERSION_CODE', "1"
3939
buildConfigField 'String', 'VERSION_NAME', "\"${version}\""
4040

41-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
41+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4242
}
4343

4444
buildTypes {
@@ -61,21 +61,23 @@ configurations {
6161
}
6262

6363
dependencies {
64-
implementation "com.android.support:support-annotations:$supportLibVersion"
64+
implementation "androidx.annotation:annotation:$annotationVersion"
6565
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
66+
6667
testImplementation "junit:junit:$junitVersion"
6768
testImplementation "org.mockito:mockito-core:$mockitoVersion"
68-
testImplementation 'com.squareup.okhttp3:mockwebserver:4.4.0'
69-
testImplementation 'org.json:json:20180813'
70-
androidTestImplementation "com.android.support.test:runner:$testRunnerVersion"
71-
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion"
69+
testImplementation "com.squareup.okhttp3:mockwebserver:$mockwebserverVersion"
70+
testImplementation 'org.json:json:20230618'
71+
72+
androidTestImplementation "androidx.test:runner:$testRunnerVersion"
73+
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
7274
androidTestImplementation "org.mockito:mockito-android:$mockitoVersion"
7375
}
7476

7577
task jacocoReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
7678
reports {
77-
xml.enabled = true
78-
html.enabled = true
79+
xml.required = true
80+
html.required = true
7981
}
8082

8183
def fileFilter = ['**/R.class',

button-merchant/doclava-1.0.6.jar

-1.72 MB
Binary file not shown.

button-merchant/publish-maven-central.gradle

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,56 @@
2525

2626
apply plugin: 'maven-publish'
2727
apply plugin: 'signing'
28+
apply plugin: 'kotlin-android'
29+
apply plugin: 'org.jetbrains.dokka'
2830

2931
group = 'com.usebutton.merchant'
3032
version = libraryVersionName
31-
project.archivesBaseName = 'button-merchant'
3233

33-
task androidJavadocs(type: Javadoc) {
34-
source = android.sourceSets.main.java.source
35-
title = null
36-
options.docletpath = [file('./doclava-1.0.6.jar')]
37-
options.classpath = classpath as List
38-
options.noTimestamp = false
39-
options {
40-
doclet "com.google.doclava.Doclava"
41-
bootClasspath new File(System.getenv('JAVA_HOME') + "/jre/lib/rt.jar")
42-
addStringOption "hdf project.name", "Button Merchant Library v${libraryVersionName}"
43-
addStringOption "public"
44-
addStringOption "templatedir", "javadoc"
45-
addStringOption "verbose"
34+
dokkaHtml.configure {
35+
outputDirectory.set(file("$buildDir/docs/html"))
36+
dokkaSourceSets {
37+
named("main") {
38+
moduleName.set("Button Merchant Library")
39+
includeNonPublic.set(false)
40+
skipEmptyPackages.set(true)
41+
skipDeprecated.set(true)
42+
reportUndocumented.set(false)
43+
suppressInheritedMembers.set(true)
44+
documentedVisibilities.set([Visibility.PUBLIC])
45+
}
46+
}
47+
}
4648

47-
addStringOption "federate jdk", "http://download.oracle.com/javase/6/docs/api/index.html?"
48-
addStringOption "federationxml jdk", "http://doclava.googlecode.com/svn/static/api/openjdk-6.xml"
49-
addStringOption "federate android", "https://d.android.com/reference"
50-
addStringOption "federationxml android", "http://doclava.googlecode.com/svn/static/api/android-10.xml"
49+
dokkaJavadoc.configure {
50+
outputDirectory.set(file("$buildDir/docs/javadoc"))
51+
dokkaSourceSets {
52+
named("main") {
53+
moduleName.set("Button Merchant Library")
54+
includeNonPublic.set(false)
55+
skipEmptyPackages.set(true)
56+
skipDeprecated.set(true)
57+
reportUndocumented.set(false)
58+
suppressInheritedMembers.set(true)
59+
documentedVisibilities.set([Visibility.PUBLIC])
60+
}
5161
}
52-
exclude '**/BuildConfig.java'
53-
exclude '**/R.java'
54-
exclude '**/internal/**'
55-
exclude '**/thirdparty/**'
5662
}
5763

58-
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
59-
archiveClassifier.set('javadoc')
60-
from new File(buildDir, '/docs/javadoc/')
64+
task androidHtmlDocs() {
65+
dependsOn(dokkaHtml)
66+
}
67+
68+
tasks.register('dokkaHtmlJar', Jar.class) {
69+
dependsOn(dokkaHtml)
70+
from(dokkaHtml)
71+
archiveClassifier.set("html-docs")
72+
}
73+
74+
tasks.register('androidJavadocsJar', Jar.class) {
75+
dependsOn(dokkaJavadoc)
76+
from(dokkaJavadoc)
77+
archiveClassifier.set("javadoc")
6178
}
6279

6380
task androidSourcesJar(type: Jar) {
@@ -93,7 +110,7 @@ afterEvaluate {
93110
publications {
94111
release(MavenPublication) {
95112
groupId group
96-
artifactId project.archivesBaseName
113+
artifactId 'button-merchant'
97114
version version
98115

99116
artifact("$buildDir/outputs/aar/${artifactId}-release.aar")

button-merchant/src/androidTest/java/com/usebutton/merchant/MainThreadExecutorTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
package com.usebutton.merchant;
2727

2828
import android.os.Looper;
29-
import android.support.test.InstrumentationRegistry;
3029

3130
import org.junit.Test;
3231

@@ -35,9 +34,11 @@
3534
import static org.junit.Assert.assertEquals;
3635
import static org.junit.Assert.assertTrue;
3736

37+
import androidx.test.platform.app.InstrumentationRegistry;
38+
3839
public class MainThreadExecutorTest {
3940

40-
private Executor executor = new MainThreadExecutor();
41+
private final Executor executor = new MainThreadExecutor();
4142

4243
@Test
4344
public void executor_shouldExecute() {

button-merchant/src/main/java/com/usebutton/merchant/ActivityReportingTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
package com.usebutton.merchant;
2727

28-
import android.support.annotation.Nullable;
28+
import androidx.annotation.Nullable;
2929

3030
import com.usebutton.merchant.module.Features;
3131

button-merchant/src/main/java/com/usebutton/merchant/ButtonApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
package com.usebutton.merchant;
2727

28-
import android.support.annotation.Nullable;
29-
import android.support.annotation.WorkerThread;
28+
import androidx.annotation.Nullable;
29+
import androidx.annotation.WorkerThread;
3030

3131
import com.usebutton.merchant.exception.ButtonNetworkException;
3232

button-merchant/src/main/java/com/usebutton/merchant/ButtonApiImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
package com.usebutton.merchant;
2727

28-
import android.support.annotation.Nullable;
29-
import android.support.annotation.VisibleForTesting;
30-
import android.support.annotation.WorkerThread;
28+
import androidx.annotation.Nullable;
29+
import androidx.annotation.VisibleForTesting;
30+
import androidx.annotation.WorkerThread;
3131
import android.util.Log;
3232

3333
import com.usebutton.merchant.exception.ButtonNetworkException;

0 commit comments

Comments
 (0)