Skip to content

Commit

Permalink
switch to target version 31 (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuan authored Apr 2, 2022
1 parent 5edf8ba commit 6e2f0fd
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 82 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
74 changes: 31 additions & 43 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
Expand All @@ -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
Expand All @@ -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'
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

<activity
android:name=".Main"
android:label="@string/app_name">
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand All @@ -36,7 +37,8 @@
android:label="@string/preferences" />
<receiver
android:name=".BootReceiver"
android:enabled="false">
android:enabled="false"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Polish by Jakub Świątkiewicz ([email protected]), Agnieszka Cieślak (aga_04@
Italian by Michele Locati ([email protected])\n
Russian by Ivan Karev ([email protected])\n
</string>
<string name="copyright" translatable="false">© 2011–2021, Andreas Würl</string>
<string name="copyright" translatable="false">© 2011–2022, Andreas Würl</string>
<string name="project_email" translatable="false">[email protected]</string>
<string name="legend">Legend</string>
<string name="legend_grid">Grid</string>
Expand Down
32 changes: 5 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
}
23 changes: 22 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 6e2f0fd

Please sign in to comment.