diff --git a/.travis.yml b/.travis.yml index a067f413..aca77f5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,12 +18,12 @@ android: # Specify at least one system image, # if you need to run emulator(s) during your tests - - sys-img-armeabi-v7a-android-30 - - sys-img-x86-android-30 + - sys-img-armeabi-v7a-android-31 + - sys-img-x86-android-31 env: global: - - TARGET_VERSION=30 - - ANDROID_BUILD_TOOLS_VERSION=30.0.3 + - TARGET_VERSION=31 + - ANDROID_BUILD_TOOLS_VERSION=31.0.0 - ANDROID_HOME=~/android-sdk before_install: - touch $HOME/.android/repositories.cfg @@ -32,4 +32,4 @@ before_install: - yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager "platforms;android-${TARGET_VERSION}" --sdk_root=$ANDROID_HOME - yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" --sdk_root=$ANDROID_HOME after_success: - - ./gradlew jacocoTestReport coveralls + - ./gradlew createDebugCoverageReport coveralls diff --git a/README.md b/README.md index e386adc6..f5a2f181 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/wuan/bo-android.svg?branch=master)](https://travis-ci.org/wuan/bo-android) [![Coverage Status](https://coveralls.io/repos/github/wuan/bo-android/badge.svg?branch=master)](https://coveralls.io/github/wuan/bo-android?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/fbab98f82eed4a9e9b0cd4af593dbe73)](https://app.codacy.com/app/wuan/bo-android?utm_source=github.com&utm_medium=referral&utm_content=wuan/bo-android&utm_campaign=Badge_Grade_Dashboard) +[![Build Status](https://travis-ci.com/wuan/bo-android.svg?branch=master)](https://travis-ci.com/wuan/bo-android) [![Coverage Status](https://coveralls.io/repos/github/wuan/bo-android/badge.svg?branch=master)](https://coveralls.io/github/wuan/bo-android?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/fbab98f82eed4a9e9b0cd4af593dbe73)](https://app.codacy.com/app/wuan/bo-android?utm_source=github.com&utm_medium=referral&utm_content=wuan/bo-android&utm_campaign=Badge_Grade_Dashboard) # About diff --git a/app/build.gradle b/app/build.gradle index 4ed968a6..b46d78d2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,17 +1,20 @@ -apply plugin: 'com.android.application' -apply plugin: 'com.hiya.jacoco-android' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'com.github.kt3k.coveralls' +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'kotlin-kapt' + id 'jacoco' + id 'com.github.kt3k.coveralls' version '2.12.0' +} android { - compileSdkVersion 30 + compileSdk 31 + defaultConfig { applicationId "org.blitzortung.android.app" minSdkVersion 15 - targetSdkVersion 30 - versionCode 279 - versionName '2.1.7' + targetSdkVersion 31 + versionCode 280 + versionName '2.1.8' multiDexEnabled false testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -34,47 +37,32 @@ android { kotlinOptions { jvmTarget = JavaVersion.VERSION_11 } - lintOptions { - abortOnError false - checkReleaseBuilds false - } testOptions { unitTests.returnDefaultValues = true } - buildToolsVersion = '30.0.3' + buildToolsVersion = '31.0.0' useLibrary 'android.test.base' -} - -jacoco { - toolVersion = '0.8.7' -} - -tasks.withType(Test) { - jacoco.includeNoLocationClasses = true - jacoco.excludes = ['jdk.internal.*'] -} - -jacocoAndroidUnitTestReport { - csv.enabled false - html.enabled false - xml.enabled true - excludes += ['**/AutoValue_*.*', - '**/*JavascriptBridge.class'] + lint { + abortOnError false + checkReleaseBuilds false + } + jacoco { + version "0.8.7" + } } coveralls { - jacocoReportPath 'build/reports/jacoco/jacocoTestReleaseUnitTestReport/jacocoTestReleaseUnitTestReport.xml' + jacocoReportPath 'build/reports/coverage/androidTest/debug/report.xml' } -def dagger_version = '2.38.1' +def dagger_version = '2.41' dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.4.0-alpha03' - implementation 'androidx.media:media:1.4.1' - implementation 'androidx.core:core-ktx:1.7.0-alpha01' + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'androidx.media:media:1.5.0' + implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' - implementation 'androidx.work:work-runtime-ktx:2.7.0-alpha05' + implementation 'androidx.work:work-runtime-ktx:2.7.1' implementation 'org.osmdroid:osmdroid-android:6.1.11' // Dagger2 @@ -85,11 +73,11 @@ dependencies { compileOnly 'javax.annotation:jsr250-api:1.0' testImplementation 'junit:junit:4.13.2' - testImplementation 'org.assertj:assertj-core:3.20.2' - testImplementation 'io.mockk:mockk:1.12.0' - testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" - testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - testImplementation 'org.robolectric:robolectric:4.6.1' + testImplementation 'org.assertj:assertj-core:3.22.0' + testImplementation 'io.mockk:mockk:1.12.3' +// testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +// testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + testImplementation 'org.robolectric:robolectric:4.7.3' testImplementation 'androidx.test:core:1.4.0' androidTestImplementation 'androidx.test:runner:1.4.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dc9c6537..01b87187 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,7 +24,8 @@ + android:label="@string/app_name" + android:exported="true"> @@ -36,7 +37,8 @@ android:label="@string/preferences" /> + android:enabled="false" + android:exported="false"> diff --git a/app/src/main/java/org/blitzortung/android/map/MapFragment.kt b/app/src/main/java/org/blitzortung/android/map/MapFragment.kt index 63a18dd3..dc3772f3 100644 --- a/app/src/main/java/org/blitzortung/android/map/MapFragment.kt +++ b/app/src/main/java/org/blitzortung/android/map/MapFragment.kt @@ -45,7 +45,7 @@ class MapFragment : Fragment(), OnSharedPreferenceChangeListener { override fun onActivityCreated(savedInstanceState: Bundle?) { super.onActivityCreated(savedInstanceState) - val context = this.activity!! + val context = this.requireActivity() val dm = context.resources.displayMetrics val preferences = PreferenceManager.getDefaultSharedPreferences(context) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4d967837..da633037 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -28,7 +28,7 @@ Polish by Jakub Świątkiewicz (kuba.dex@gmail.com), Agnieszka Cieślak (aga_04@ Italian by Michele Locati (michele@locati.it)\n Russian by Ivan Karev (karev.ivan@gmail.com)\n - © 2011–2021, Andreas Würl + © 2011–2022, Andreas Würl blitzortung@tryb.de Legend Grid diff --git a/build.gradle b/build.gradle index 10804d5f..0ccd671e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,32 +1,10 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '1.5.21' - repositories { - google() - mavenCentral() - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath 'com.android.tools.build:gradle:7.0.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.hiya:jacoco-android:0.2" - classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - mavenCentral() - } +plugins { + id 'com.android.application' version '7.1.2' apply false + id 'com.android.library' version '7.1.2' apply false + id 'org.jetbrains.kotlin.android' version '1.6.10' apply false } task clean(type: Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index dbb7bf70..cd0519bb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,23 @@ -android.enableJetifier=true +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1f2832da..d307682f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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-7.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip diff --git a/settings.gradle b/settings.gradle index e7b4def4..bb7b4c98 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,16 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "bo-android" include ':app'