Add Travis CI support

This commit is contained in:
Javier Serrano Polo
2020-05-23 16:30:02 +02:00
parent 942b7b8609
commit c8f6e3c3f5
8 changed files with 76 additions and 1 deletions

11
.travis.yml Normal file
View File

@@ -0,0 +1,11 @@
dist: bionic
sudo: required
matrix:
include:
- env: TARGET_OS=
before_install:
- "$TRAVIS_BUILD_DIR/travis/$TRAVIS_OS_NAME.$TARGET_OS.before_install"
install:
- "$TRAVIS_BUILD_DIR/travis/$TRAVIS_OS_NAME.$TARGET_OS.install"
script:
- "$TRAVIS_BUILD_DIR/travis/$TRAVIS_OS_NAME.$TARGET_OS.script"

View File

@@ -305,7 +305,8 @@ public final class MainActivity
t = Toast.makeText(this, msg, duration);
lastToast = new WeakReference<Toast>(t);
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && t.getView().isShown()) {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && t.getView().isShown()) {
if (Build.VERSION.SDK_INT >= 28 && t.getView().isShown()) {
t.cancel();
}
t.setText(msg);

2
travis/linux..before_install Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
sudo apt-get update -qq

9
travis/linux..install Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
sudo apt-get install -y \
android-sdk \
android-sdk-platform-23 \
apksigner \
default-jdk-headless \
gettext \
gradle \
libgradle-android-plugin-java

30
travis/linux..script Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
set -e
cd AndorsTrail
ln -s ../travis/support/build.gradle ../travis/support/gradle.properties \
../travis/support/local.properties .
mkdir -p src/main/assets/translation src/main/java
ln -s ../../AndroidManifest.xml ../../res src/main
ln -s ../../com src/main/java
for po in assets/translation/*.po
do
msgfmt -o src/main/${po%.po}.mo $po
done
gradle assembleRelease
keytool -genkeypair -v -keystore keystore.p12 -storepass changeit \
-keypass changeit -storetype pkcs12 -alias self -keyalg RSA \
-validity 10000 -dname \
"CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown"
VERSION=$(grep android:versionCode AndroidManifest.xml | cut -d \" -f 2)
APK=com.gpl.rpg.AndorsTrail_$VERSION.apk
apksigner sign --out $APK -v --ks keystore.p12 --ks-pass pass:changeit \
build/outputs/apk/AndorsTrail-release-unsigned.apk
apksigner verify $APK

View File

@@ -0,0 +1,20 @@
buildscript {
repositories {
maven { url "file:///usr/share/maven-repo" }
}
dependencies {
classpath "com.android.tools.build:gradle:debian"
}
}
apply plugin: "com.android.application"
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
}
dependencies {
compile files("libs/android-support-v4.jar")
}

View File

@@ -0,0 +1 @@
android.disableResourceValidation=true

View File

@@ -0,0 +1 @@
sdk.dir=/usr/lib/android-sdk