Merge pull request #1 from iSoron/dev

merge upstream changes
pull/619/head
Christoph Hennemann 6 years ago committed by GitHub
commit 84e9adea24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

29
.gitignore vendored

@ -1,27 +1,16 @@
*.ap_
*.apk
*.class
*.dex
*.iml *.iml
*.local *.pbxuser
*.local.* *.perspective
*.perspectivev3
*.swp *.swp
*.trace *~.nib
*~
.DS_Store .DS_Store
.classpath .externalNativeBuild
.gradle .gradle
.idea .idea
.project build
Thumbs.db
art/
bin/
build/ build/
captures/ captures
docs/
gen/
local.properties local.properties
crowdin.yaml node_modules
local *xcuserdata*
tmp/
secret/

@ -1,5 +1,14 @@
# Changelog # Changelog
### 1.7.11 (Aug 10, 2019)
* Fix bug that produced corrupted CSV files in some countries
### 1.7.10 (June 15, 2019)
* Fix bug that prevented some devices from showing notifications.
* Update targetSdk to Android Pie (API level 28)
### 1.7.8 (April 21, 2018) ### 1.7.8 (April 21, 2018)
* Add support for adaptive icons (Oreo) * Add support for adaptive icons (Oreo)

@ -1,16 +1,6 @@
# Loop Habit Tracker # Loop Habit Tracker
<a href="https://build.loophabits.org/project.html?projectId=LoopHabitTracker&tab=projectOverview&guest=1"> Loop is a mobile app that helps you create and maintain good habits,
<img src="https://img.shields.io/teamcity/https/build.loophabits.org/s/release.svg">
</a>
<a href="https://build.loophabits.org/project.html?projectId=LoopHabitTracker&tab=preport_project1_Coverage__core_&guest=1">
<img src="https://build.loophabits.org/app/rest/builds/buildType(id:release)/artifacts/content/coverage-badge.svg?guest=1" />
</a>
<a href="https://github.com/iSoron/uhabits/releases/latest">
<img src="https://img.shields.io/badge/apk-stable-FF4081.svg" />
</a>
Loop is a simple Android app that helps you create and maintain good habits,
allowing you to achieve your long-term goals. Detailed graphs and statistics allowing you to achieve your long-term goals. Detailed graphs and statistics
show you how your habits improved over time. It is completely ad-free and open show you how your habits improved over time. It is completely ad-free and open
source. source.
@ -95,7 +85,7 @@ contribute, even if you are not a software developer.
<img align="right" src="https://www.gnu.org/graphics/gplv3-88x31.png"> <img align="right" src="https://www.gnu.org/graphics/gplv3-88x31.png">
Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com> Copyright (C) 2016-2019 Álinson Santos Xavier <isoron@gmail.com>
Loop Habit Tracker is free software: you can redistribute it and/or modify Loop Habit Tracker is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the it under the terms of the GNU General Public License as published by the

27
android/.gitignore vendored

@ -0,0 +1,27 @@
*.ap_
*.apk
*.class
*.dex
*.iml
*.local
*.local.*
*.swp
*.trace
*~
.DS_Store
.classpath
.gradle
.idea
.project
Thumbs.db
art/
bin/
build/
captures/
docs/
gen/
local.properties
crowdin.yaml
local
tmp/
secret/

@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion COMPILE_SDK_VERSION as Integer compileSdkVersion COMPILE_SDK_VERSION as Integer
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK_VERSION as Integer minSdkVersion MIN_SDK_VERSION as Integer
@ -30,7 +29,6 @@ android {
abortOnError false abortOnError false
} }
buildToolsVersion '26.0.2'
} }
dependencies { dependencies {

@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion COMPILE_SDK_VERSION as Integer compileSdkVersion COMPILE_SDK_VERSION as Integer
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK_VERSION as Integer minSdkVersion MIN_SDK_VERSION as Integer
@ -18,7 +17,6 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
buildToolsVersion '26.0.2'
compileOptions { compileOptions {
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8

@ -0,0 +1,21 @@
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:$BUILD_TOOLS_VERSION"
classpath "com.neenbedankt.gradle.plugins:android-apt:1.8"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
classpath "org.ajoberstar:grgit:1.5.0"
}
}
allprojects {
repositories {
google()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
}

@ -121,20 +121,15 @@ uninstall_apk() {
install_test_butler() { install_test_butler() {
log_info "Installing Test Butler" log_info "Installing Test Butler"
$ADB uninstall com.linkedin.android.testbutler $ADB uninstall com.linkedin.android.testbutler
$ADB install tools/test-butler-app-1.3.1.apk $ADB install tools/test-butler-app-2.0.2.apk
} }
install_apk() { install_apk() {
if [ ! -z $UNINSTALL_FIRST ]; then
uninstall_apk
fi
log_info "Installing APK" log_info "Installing APK"
if [ ! -z $RELEASE ]; then if [ ! -z $RELEASE ]; then
$ADB install -r ${OUTPUTS_DIR}/apk/release/uhabits-android-release.apk || fail $ADB install -r ${OUTPUTS_DIR}/apk/release/uhabits-android-release.apk || fail
else else
$ADB install -r ${OUTPUTS_DIR}/apk/debug/uhabits-android-debug.apk || fail $ADB install -t -r ${OUTPUTS_DIR}/apk/debug/uhabits-android-debug.apk || fail
fi fi
} }
@ -147,9 +142,10 @@ install_test_apk() {
} }
run_instrumented_tests() { run_instrumented_tests() {
SIZE=$1
log_info "Running instrumented tests" log_info "Running instrumented tests"
$ADB shell am instrument \ $ADB shell am instrument \
-r -e coverage true -e size medium \ -r -e coverage true -e size $SIZE \
-w ${PACKAGE_NAME}.test/android.support.test.runner.AndroidJUnitRunner \ -w ${PACKAGE_NAME}.test/android.support.test.runner.AndroidJUnitRunner \
| tee ${OUTPUTS_DIR}/instrument.txt | tee ${OUTPUTS_DIR}/instrument.txt
@ -180,7 +176,7 @@ fetch_artifacts() {
} }
fetch_logcat() { fetch_logcat() {
log_info "Fetching logcat" log_info "Fetching logcat to ${OUTPUTS_DIR}/logcat.txt"
$ADB logcat -d > ${OUTPUTS_DIR}/logcat.txt $ADB logcat -d > ${OUTPUTS_DIR}/logcat.txt
} }
@ -215,13 +211,14 @@ accept_images() {
rsync -av tmp/test-screenshots/ uhabits-android/src/androidTest/assets/ rsync -av tmp/test-screenshots/ uhabits-android/src/androidTest/assets/
} }
run_local_tests() { run_tests() {
#clean_output_dir SIZE=$1
run_adb_as_root run_adb_as_root
install_test_butler install_test_butler
uninstall_apk
install_apk install_apk
install_test_apk install_test_apk
run_instrumented_tests run_instrumented_tests $SIZE
parse_instrumentation_results parse_instrumentation_results
fetch_artifacts fetch_artifacts
fetch_logcat fetch_logcat
@ -249,7 +246,7 @@ case "$1" in
build_apk build_apk
build_instrumentation_apk build_instrumentation_apk
run_jvm_tests run_jvm_tests
generate_coverage_badge #generate_coverage_badge
;; ;;
ci-tests) ci-tests)
@ -274,14 +271,19 @@ case "$1" in
ADB="${ADB} -s emulator-${AVD_SERIAL}" ADB="${ADB} -s emulator-${AVD_SERIAL}"
start_emulator start_emulator
run_local_tests run_tests medium
stop_emulator stop_emulator
stop_gradle_daemon stop_gradle_daemon
;; ;;
local-tests) medium-tests)
shift; parse_opts $* shift; parse_opts $*
run_local_tests run_tests medium
;;
large-tests)
shift; parse_opts $*
run_tests large
;; ;;
fetch-images) fetch-images)
@ -311,7 +313,6 @@ case "$1" in
accept-images Copies fetched images to corresponding assets folder accept-images Copies fetched images to corresponding assets folder
Options: Options:
-u --uninstall-first Uninstall existing APK first
-r --release Build and install release version, instead of debug -r --release Build and install release version, instead of debug
END END
exit 1 exit 1

@ -0,0 +1,16 @@
VERSION_CODE = 39
VERSION_NAME = 1.8.0
MIN_SDK_VERSION = 19
TARGET_SDK_VERSION = 29
COMPILE_SDK_VERSION = 29
DAGGER_VERSION = 2.25.2
KOTLIN_VERSION = 1.3.50
SUPPORT_LIBRARY_VERSION = 28.0.0
AUTO_FACTORY_VERSION = 1.0-beta6
BUILD_TOOLS_VERSION = 3.5.2
org.gradle.parallel=false
org.gradle.daemon=true
org.gradle.jvmargs=-Xms2048m -Xmx2048m -XX:MaxPermSize=2048m

@ -1,6 +1,6 @@
#Sun Sep 24 06:01:27 CDT 2017 #Wed Sep 04 13:05:58 MSK 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

Before

Width:  |  Height:  |  Size: 926 B

After

Width:  |  Height:  |  Size: 926 B

@ -2,8 +2,6 @@ apply plugin: 'idea'
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'jacoco'
apply plugin: 'com.github.triplet.play'
import org.ajoberstar.grgit.Grgit import org.ajoberstar.grgit.Grgit
ext { ext {
@ -14,7 +12,6 @@ ext {
android { android {
compileSdkVersion COMPILE_SDK_VERSION as Integer compileSdkVersion COMPILE_SDK_VERSION as Integer
buildToolsVersion BUILD_TOOLS_VERSION
if(project.hasProperty("LOOP_STORE_FILE")) { if(project.hasProperty("LOOP_STORE_FILE")) {
signingConfigs { signingConfigs {
@ -28,12 +25,6 @@ android {
buildTypes.release.signingConfig signingConfigs.release buildTypes.release.signingConfig signingConfigs.release
} }
playAccountConfigs {
defaultAccountConfig {
jsonFile = file('../secret/playstore.json')
}
}
defaultConfig { defaultConfig {
versionCode VERSION_CODE as Integer versionCode VERSION_CODE as Integer
versionName "$VERSION_NAME ($GIT_BRANCH $GIT_COMMIT)" versionName "$VERSION_NAME ($GIT_BRANCH $GIT_COMMIT)"
@ -42,14 +33,6 @@ android {
applicationId "org.isoron.uhabits" applicationId "org.isoron.uhabits"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
playAccountConfig = playAccountConfigs.defaultAccountConfig
} }
buildTypes { buildTypes {
@ -80,17 +63,12 @@ android {
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
showStandardStreams = true showStandardStreams = true
} }
jacoco {
includeNoLocationClasses = true
}
} }
} }
sourceSets { sourceSets {
main.assets.srcDirs += '../uhabits-core/src/main/resources/' main.assets.srcDirs += '../uhabits-core/src/main/resources/'
} }
buildToolsVersion '26.0.2'
} }
dependencies { dependencies {
@ -108,24 +86,25 @@ dependencies {
implementation "org.apmem.tools:layouts:1.10" implementation "org.apmem.tools:layouts:1.10"
implementation "com.google.code.gson:gson:2.7" implementation "com.google.code.gson:gson:2.7"
implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$KOTLIN_VERSION" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION"
compileOnly "javax.annotation:jsr250-api:1.0" compileOnly "javax.annotation:jsr250-api:1.0"
compileOnly "com.google.auto.factory:auto-factory:1.0-beta3" compileOnly "com.google.auto.factory:auto-factory:${AUTO_FACTORY_VERSION}"
kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION" kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
kapt "com.jakewharton:butterknife-compiler:8.6.1-SNAPSHOT" kapt "com.jakewharton:butterknife-compiler:9.0.0"
kapt "com.google.auto.factory:auto-factory:1.0-beta3" annotationProcessor "com.google.auto.factory:auto-factory:${AUTO_FACTORY_VERSION}"
androidTestImplementation "com.android.support.test.espresso:espresso-contrib:2.2.2" androidTestImplementation "com.android.support.test.espresso:espresso-contrib:2.2.2"
androidTestImplementation "com.android.support.test.espresso:espresso-core:2.2.2" androidTestImplementation "com.android.support.test.espresso:espresso-core:2.2.2"
androidTestImplementation "com.android.support.test.uiautomator:uiautomator-v18:2.1.1" androidTestImplementation "com.android.support.test.uiautomator:uiautomator-v18:2.1.1"
androidTestImplementation "com.google.dagger:dagger:$DAGGER_VERSION" androidTestImplementation "com.google.dagger:dagger:$DAGGER_VERSION"
androidTestImplementation "com.linkedin.testbutler:test-butler-library:1.3.1" androidTestImplementation "com.linkedin.testbutler:test-butler-library:1.3.1"
androidTestCompileOnly "com.google.auto.factory:auto-factory:1.0-beta3" androidTestCompileOnly "com.google.auto.factory:auto-factory:${AUTO_FACTORY_VERSION}"
androidTestAnnotationProcessor "com.google.auto.factory:auto-factory:${AUTO_FACTORY_VERSION}"
androidTestImplementation "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION" androidTestImplementation "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
androidTestImplementation "com.android.support.test:rules:0.5" androidTestImplementation "com.android.support.test:rules:0.5"
androidTestImplementation "com.android.support.test:runner:0.5" androidTestImplementation "com.android.support.test:runner:0.5"
androidTestImplementation "com.google.guava:guava:20.0" androidTestImplementation "com.google.guava:guava:24.1-android"
androidTestImplementation project(":uhabits-core") androidTestImplementation project(":uhabits-core")
kaptAndroidTest "com.google.dagger:dagger-compiler:$DAGGER_VERSION" kaptAndroidTest "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
@ -149,44 +128,10 @@ dependencies {
} }
repositories { repositories {
mavenCentral() google()
jcenter()
} }
kapt { kapt {
correctErrorTypes = true correctErrorTypes = true
} }
task coverageReport(type: JacocoReport) {
def excludes = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*',
'**/*Test*.*',
'**/*$Lambda$*',
'**/*$ViewBinder*',
'**/*MembersInjector*',
'**/*_Provide*',
'**/*Module_*',
'**/com/android/**/*',
'**/*Dagger*',
'**/*_Factory*'
]
def androidSrc = "${project.projectDir}/src/main/java"
def androidClasses = "${buildDir}/intermediates/classes/debug"
def jvmExecData = "${buildDir}/jacoco/testDebugUnitTest.exec"
def connectedExecData = "${buildDir}/outputs/code-coverage/connected/coverage.ec"
sourceDirectories = files(androidSrc)
classDirectories = files(fileTree(dir: androidClasses, excludes: excludes))
executionData = files(jvmExecData, connectedExecData)
jacocoClasspath = configurations['androidJacocoAnt']
reports {
html.enabled = true
xml.enabled = true
}
}
play {
track = 'alpha'
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save