Skip to content

Commit

Permalink
222 (#223)
Browse files Browse the repository at this point in the history
* Use build-plugin 3.1.2

* Address lint issue

* Target SDK 27

* Migrate to androidx. Update gradle and other plugins.

* Automated build with github actions

* :Request for storage permission, bug fixs for #216 and #220

* Resources for release version and other build flavors because of upgrade to AndroidX

* Update kontinuum config

* f

* update gradle and compile withCloud flavorr

* use LegacyExternalStorage path

* fixed some compile warning.

* wrong use of golink_path ?

* Fix lint errors

Co-authored-by: 徐鸿(XuHong) <[email protected]>
  • Loading branch information
ligi and icehong authored Mar 7, 2021
1 parent 6364fbe commit 2e448e1
Show file tree
Hide file tree
Showing 100 changed files with 527 additions and 506 deletions.
21 changes: 19 additions & 2 deletions .ci/kontinuum.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
{
"type":"android",
"stages":["spoon","lint","test","assemble"]
"type": "android",
"stages": [
{
"name": "spoon",
"needsEmulator": true
},
{
"name": "lint",
"needsEmulator": false
},
{
"name": "test",
"needsEmulator": false
},
{
"name": "assembleRelease",
"needsEmulator": false
}
]
}
23 changes: 23 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Android CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: sudo ./gradlew assemble
- name: Upload APK
uses: actions/upload-artifact@v2
with:
path: ./**/*.apk
if-no-files-found: warn

140 changes: 53 additions & 87 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.getkeepsafe.dexcount'

repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
Expand All @@ -19,27 +20,21 @@ android {
withAnalytics {
dimension "analytics"
}

noAnalytics {
dimension "analytics"
}

withCloud {
dimension "cloud"
}

noCloud {
dimension "cloud"
}

withAutostart {
dimension "autostart"
}

noAutostart {
dimension "autostart"
}

}

android.variantFilter { variant ->
Expand All @@ -52,14 +47,14 @@ android {

}

compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 30
buildToolsVersion '29.0.3'

defaultConfig {
versionCode 259
versionName "2.5.9"
minSdkVersion 9
targetSdkVersion 25
minSdkVersion 21
targetSdkVersion 30
applicationId "org.ligi.gobandroid_hd"
testInstrumentationRunner "org.ligi.gobandroid_hd.AppReplacingRunner"
archivesBaseName = "Gobandroid-$versionName"
Expand All @@ -86,10 +81,10 @@ android {
}

testOptions {
animationsDisabled = true
unitTests.returnDefaultValues = true
}


buildTypes {
release {
minifyEnabled true
Expand All @@ -98,96 +93,67 @@ android {
}

debug {
debuggable true
// to avoid MultiDex http://stackoverflow.com/questions/38329248/dexindexoverflowexception-when-running-androidtests
minifyEnabled true
useProguard false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-project.txt'
minifyEnabled false
}
}

} // android

spoon {
debug = true
}


configurations {

// http://stackoverflow.com/questions/30578243/why-would-adding-espresso-contrib-cause-an-inflateexception
androidTestCompile.exclude group: 'com.android.support', module: 'appcompat-v7'
androidTestCompile.exclude group: 'com.android.support', module: 'design'
androidTestCompile.exclude group: 'com.android.support', module: 'support-v4'
androidTestCompile.exclude group: 'com.android.support', module: 'support-annotations'
androidTestCompile.exclude group: 'com.android.support', module: 'preference-v7'
androidTestCompile.exclude module: 'recyclerview-v7'
androidTestCompile.exclude module: 'kotlin-stdlib'
}

configurations {

// http://stackoverflow.com/questions/30578243/why-would-adding-espresso-contrib-cause-an-inflateexception
androidTestCompile.exclude group: 'com.android.support', module: 'appcompat-v7'
androidTestCompile.exclude group: 'com.android.support', module: 'design'
androidTestCompile.exclude group: 'com.android.support', module: 'support-v4'
androidTestCompile.exclude group: 'com.android.support', module: 'support-annotations'
androidTestCompile.exclude group: 'com.android.support', module: 'preference-v7'
androidTestCompile.exclude module: 'recyclerview-v7'
all {
exclude module: 'commons-logging'
exclude module: 'httpclient'
}
}

dependencies {
compile 'com.github.hotchemi:permissionsdispatcher:2.3.2'
kapt 'com.github.hotchemi:permissionsdispatcher-processor:2.3.2'

compile 'com.github.salomonbrys.kodein:kodein:3.3.0'

compile "com.android.support:appcompat-v7:$support_version"
compile "com.android.support:recyclerview-v7:$support_version"
compile "com.android.support:cardview-v7:$support_version"
compile "com.android.support:design:$support_version"
compile "com.android.support:preference-v7:$support_version"

compile 'com.github.ligi:KAXT:0.20'
compile 'com.github.ligi:tracedroid:1.4'

compile 'com.github.ligi.snackengage:snackengage-playrate:0.15'

compile 'com.github.ligi:ExtraCompats:0.4'

compile 'net.sourceforge.jchardet:jchardet:1.0'
compile 'com.squareup.okhttp3:okhttp:3.10.0'
compile 'com.n3twork.druid:alphanum:1.0.3'
compile "com.android.support:support-annotations:$support_version"

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

compile("com.chibatching.kotpref:kotpref:$kotpref_version")
compile("com.chibatching.kotpref:initializer:$kotpref_version")

withAnalyticsCompile "com.google.android.gms:play-services-analytics:$play_version"

withCloudCompile "com.google.android.gms:play-services-games:$play_version"
withCloudCompile "com.google.android.gms:play-services-plus:$play_version"
withCloudCompile "com.google.android.gms:play-services-gcm:$play_version"
withCloudCompile "com.google.android.gms:play-services-plus:$play_version"

withCloudCompile ('com.google.apis:google-api-services-games:v1-rev214-1.22.0') {
implementation "org.permissionsdispatcher:permissionsdispatcher:4.8.0"
kapt "org.permissionsdispatcher:permissionsdispatcher-processor:4.8.0"
implementation 'com.github.salomonbrys.kodein:kodein:4.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.github.ligi:KAXT:0.20'
implementation 'com.github.ligi:tracedroid:3.0'
implementation 'com.github.ligi.snackengage:snackengage-playrate:0.15'
implementation 'com.github.ligi:ExtraCompats:0.4'
implementation 'jchardet:jchardet:1.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.n3twork.druid:alphanum:1.0.3'
implementation 'androidx.annotation:annotation:1.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.chibatching.kotpref:kotpref:$kotpref_version"
implementation "com.chibatching.kotpref:initializer:$kotpref_version"
withAnalyticsImplementation "com.google.android.gms:play-services-analytics:17.0.0"
withCloudImplementation "com.google.android.gms:play-services-games:19.0.0"
withCloudImplementation "com.google.android.gms:play-services-plus:17.0.0"
withCloudImplementation "com.google.android.gms:play-services-gcm:17.0.0"
withCloudImplementation('com.google.apis:google-api-services-games:v1-rev98-1.20.0') {
exclude module: 'jsr305'
}
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'com.github.ligi:trulesk:0.31'
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation 'com.squareup.assertj:assertj-android:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
testImplementation 'com.squareup.assertj:assertj-android:1.2.0'
testImplementation 'androidx.annotation:annotation:1.1.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'com.squareup.spoon:spoon-client:1.7.1'
androidTestImplementation 'com.jraska:falcon:2.1.1'
androidTestImplementation 'com.jraska:falcon-spoon-compat:1.0.4'
implementation 'com.google.android:flexbox:0.2.6'
implementation 'org.greenrobot:eventbus:3.0.0'

androidTestCompile 'com.github.ligi:trulesk:0.19'

androidTestCompile "com.android.support:support-annotations:$support_version"
androidTestCompile 'com.squareup.assertj:assertj-android:1.1.1'

testCompile 'com.squareup.assertj:assertj-android:1.1.1'
testCompile "com.android.support:support-annotations:$support_version"
testCompile 'junit:junit:4.12'

androidTestCompile 'com.squareup.spoon:spoon-client:1.7.1'

compile 'com.google.android:flexbox:0.2.6'
compile 'org.greenrobot:eventbus:3.0.0'
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.ligi.gobandroid_hd.test_helper_functions

import android.support.test.InstrumentationRegistry.getInstrumentation
import androidx.test.InstrumentationRegistry.getInstrumentation
import org.ligi.gobandroid_hd.logic.sgf.SGFReader

fun readAsset(fileName: String) = readAsset(getInstrumentation().context, fileName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.ligi.gobandroid_hd.test_helper_functions

import android.support.test.espresso.UiController
import android.support.test.espresso.ViewAction
import android.support.test.espresso.action.CoordinatesProvider
import android.support.test.espresso.action.GeneralClickAction
import android.support.test.espresso.action.Press
import android.support.test.espresso.action.Tap
import android.support.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.UiController
import androidx.test.espresso.ViewAction
import androidx.test.espresso.action.CoordinatesProvider
import androidx.test.espresso.action.GeneralClickAction
import androidx.test.espresso.action.Press
import androidx.test.espresso.action.Tap
import androidx.test.espresso.matcher.ViewMatchers
import android.view.View
import android.widget.SeekBar

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.ligi.gobandroid_hd.uitest

import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.action.ViewActions.click
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.*
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import com.github.salomonbrys.kodein.instance
import com.github.salomonbrys.kodein.lazy
import com.squareup.spoon.Spoon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.ligi.gobandroid_hd.uitest

import android.os.SystemClock
import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.action.ViewActions.*
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.*
import android.support.test.runner.AndroidJUnit4
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.runner.AndroidJUnit4
import com.github.salomonbrys.kodein.instance
import com.github.salomonbrys.kodein.lazy
import com.squareup.spoon.Spoon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.ligi.gobandroid_hd.uitest

import android.os.SystemClock
import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.action.ViewActions.scrollTo
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.*
import android.support.test.runner.AndroidJUnit4
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.scrollTo
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.runner.AndroidJUnit4
import com.github.salomonbrys.kodein.instance
import com.github.salomonbrys.kodein.lazy
import com.squareup.spoon.Spoon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.ligi.gobandroid_hd.uitest

import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.action.ViewActions.click
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.*
import android.support.test.runner.AndroidJUnit4
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.runner.AndroidJUnit4
import com.squareup.spoon.Spoon
import org.hamcrest.CoreMatchers.not
import org.hamcrest.Matchers.containsString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.ligi.gobandroid_hd.uitest

import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.isDisplayed
import android.support.test.espresso.matcher.ViewMatchers.withId
import android.support.test.runner.AndroidJUnit4
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.runner.AndroidJUnit4
import com.jraska.falcon.FalconSpoon
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.ligi.gobandroid_hd.uitest

import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.isDisplayed
import android.support.test.espresso.matcher.ViewMatchers.withId
import android.support.test.runner.AndroidJUnit4
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.runner.AndroidJUnit4
import com.github.salomonbrys.kodein.instance
import com.github.salomonbrys.kodein.lazy
import com.squareup.spoon.Spoon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.ligi.gobandroid_hd.uitest

import android.content.Intent
import android.net.Uri
import android.support.test.runner.AndroidJUnit4
import androidx.test.runner.AndroidJUnit4
import com.jraska.falcon.FalconSpoon
import org.junit.Rule
import org.junit.Test
Expand Down
Loading

0 comments on commit 2e448e1

Please sign in to comment.