diff --git a/app/build.gradle b/app/build.gradle index 4328b96d..951736ff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "org.blitzortung.android.app" minSdkVersion 21 targetSdkVersion 34 - versionCode 322 - versionName '2.2.5' + versionCode 323 + versionName '2.2.6' multiDexEnabled false testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -93,41 +93,31 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent tasks.withType(Test) { jacoco.includeNoLocationClasses = true jacoco.excludes = ['jdk.internal.*'] - testLogging { - // Enables easier debugging of tests in Github Actions CI - events TestLogEvent.FAILED - exceptionFormat TestExceptionFormat.FULL - showExceptions true - showCauses true - showStackTraces true - } - maxHeapSize = "4g" } task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) { - reports { xml.required.set(true) html.required.set(true) } - getReports().getXml().setDestination(file("${project.buildDir}/reports/jacoco/jacocoRootReport/merged.xml")) + // Add files that should not be listed in the report (e.g. generated Files from dagger) + def fileFilter = ['**/*Dagger.*'] + + def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter) + + def mainSrc = "$projectDir/src/main/java" + sourceDirectories.from = files([mainSrc]) + classDirectories.from = files([kotlinDebugTree]) - def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*', '**/*$ViewBinder*.*'] - def debugTree = fileTree(dir: "$project.buildDir/intermediates/javac/debug/classes", excludes: fileFilter) - def kotlinDebugTree = fileTree(dir: "${project.buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter) - def mainSrc = "$project.projectDir/src/main/java" + // Make sure the path is correct (if not run the unit tests and try find the .exec file that is generated after the unit tests are finished should be similar to that one) + executionData.from = fileTree(dir: "$buildDir", includes: ["outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec"]) - sourceDirectories.setFrom(files([mainSrc])) - classDirectories.setFrom(files([debugTree, kotlinDebugTree])) - executionData.setFrom(fileTree(dir: project.buildDir, includes: [ - 'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec' - ])) } sonar { properties { property "sonar.junit.reportPaths", "build/test-results/testDebugUnitTest/" - property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/jacocoRootReport/merged.xml" + property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml" } } 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 777463db..5f2db243 100644 --- a/app/src/main/java/org/blitzortung/android/map/MapFragment.kt +++ b/app/src/main/java/org/blitzortung/android/map/MapFragment.kt @@ -72,15 +72,13 @@ class MapFragment : Fragment(), OnSharedPreferenceChangeListener { centered.setBoolean(mScaleBarOverlay, true) mapView.overlays.add(this.mScaleBarOverlay) - //built in zoom controls - mapView.zoomController.setVisibility(CustomZoomButtonsController.Visibility.SHOW_AND_FADEOUT) + // disable built in zoom controls + mapView.zoomController.setVisibility(CustomZoomButtonsController.Visibility.NEVER) - setZoomControllerBottomOffset(bottomOffset + 10) - - //needed for pinch zooms + // enable pinch zoom mapView.setMultiTouchControls(true) - //scales tiles to the current screen's DPI, helps with readability of labels + // scales tiles to the current screen's DPI, helps with readability of labels mapView.isTilesScaledToDpi = true //the rest of this is restoring the last map location the user looked at @@ -103,13 +101,6 @@ class MapFragment : Fragment(), OnSharedPreferenceChangeListener { onSharedPreferenceChanged(preferences, PreferenceKey.MAP_TYPE, PreferenceKey.MAP_SCALE) } - private fun setZoomControllerBottomOffset(bottomOffset: Int) { - val f: Field = CustomZoomButtonsController::class.java.getDeclaredField("mDisplay") - f.isAccessible = true // Abracadabra - val zoomDisplay = f.get(mapView.zoomController) as CustomZoomButtonsDisplay - zoomDisplay.setAdditionalPixelMargins(0f, 0f, 0f, bottomOffset.toFloat()) - } - fun updateForgroundColor(fgcolor: Int) { mScaleBarOverlay.barPaint = mScaleBarOverlay.barPaint.apply { color = fgcolor } mScaleBarOverlay.textPaint = mScaleBarOverlay.textPaint.apply { color = fgcolor } diff --git a/build.gradle b/build.gradle index 4ed2b36f..95b389a9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.6.1' apply false - id 'com.android.library' version '8.6.1' apply false + id 'com.android.application' version '8.7.0' apply false + id 'com.android.library' version '8.7.0' apply false id 'org.jetbrains.kotlin.android' version '2.0.20' apply false id "org.sonarqube" version "5.1.0.4882" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 45181329..81a4301f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip