Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ def getGitHash = providers.exec {

android {
buildToolsVersion = rootProject.ext.buildToolsVersion
namespace 'org.runnerup'
namespace = 'org.runnerup'

compileOptions {
sourceCompatibility JavaVersion.toVersion("17")
targetCompatibility JavaVersion.toVersion("17")
sourceCompatibility = JavaVersion.toVersion("17")
targetCompatibility = JavaVersion.toVersion("17")
}

sourceSets {
Expand Down Expand Up @@ -44,13 +44,13 @@ android {
flavorDimensions = [ "all" ]
productFlavors {
latest {
dimension "all"
dimension = "all"
// multidexing support, min play support
minSdk rootProject.ext.minSdk
compileSdk rootProject.ext.compileSdk
targetSdk rootProject.ext.targetSdk
versionName rootProject.ext.versionName
versionCode rootProject.ext.latestBaseVersionCode + rootProject.ext.versionCode
minSdk = rootProject.ext.minSdk
compileSdk = rootProject.ext.compileSdk
targetSdk = rootProject.ext.targetSdk
versionName = rootProject.ext.versionName
versionCode = rootProject.ext.latestBaseVersionCode + rootProject.ext.versionCode
}
}

Expand All @@ -60,7 +60,7 @@ android {
// enable rootProject.ext.allowNonFree && gradle.startParameter.taskNames.contains("assembleLatestRelease")
// relevant archs only - these are the only available anyway for newer NDK
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
universalApk true
universalApk = true
}
}

Expand All @@ -86,22 +86,22 @@ android {
versionNameSuffix = "-${getGitHash}"
}
release {
debuggable false
applicationIdSuffix ""
debuggable = false
applicationIdSuffix = ""

minifyEnabled rootProject.ext.allowNonFree
shrinkResources rootProject.ext.allowNonFree
minifyEnabled = rootProject.ext.allowNonFree
shrinkResources = rootProject.ext.allowNonFree
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard.txt'
signingConfig signingConfigs.release
signingConfig = signingConfigs.release
}
}
lint {
baseline file('lint-baseline.xml')
checkReleaseBuilds true
lintConfig file('lint.xml')
showAll true
//textOutput 'stdout'
textReport true
baseline = file('lint-baseline.xml')
checkReleaseBuilds = true
lintConfig = file('lint.xml')
showAll = true
//textOutput = 'stdout'
textReport = true
}
bundle {
language {
Expand All @@ -110,21 +110,21 @@ android {
}
}
buildFeatures {
aidl true
buildConfig true
aidl = true
buildConfig = true
}
androidResources {
generateLocaleConfig true
generateLocaleConfig = true
}
}

repositories {
google()
mavenCentral() //MapBox GraphView
maven { url "https://oss.sonatype.org/content/groups/public/" } //pebblekit
maven { url = "https://oss.sonatype.org/content/groups/public/" } //pebblekit
if (rootProject.ext.useMapBox) {
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
url = 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
Expand All @@ -144,10 +144,10 @@ repositories {
// Duplicate class kotlin.collections.jdk8 (from MapBox?)
dependencies {
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.2.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.2.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
Expand All @@ -163,7 +163,7 @@ dependencies {
implementation "androidx.viewpager2:viewpager2:1.1.0"
implementation "androidx.constraintlayout:constraintlayout:2.2.1"

latestImplementation "com.google.android.material:material:1.12.0"
latestImplementation "com.google.android.material:material:1.13.0"
if (rootProject.ext.enableWear) {
// Build Wear separately, do not include in phone apk
// latestWearApp project(':wear')
Expand All @@ -172,7 +172,7 @@ dependencies {
latestImplementation "com.google.android.gms:play-services-wearable:${rootProject.ext.googlePlayServicesWearableVersion}"
}

implementation "com.squareup.okhttp3:okhttp:5.1.0"
implementation "com.squareup.okhttp3:okhttp:5.3.2"
latestImplementation 'com.getpebble:pebblekit:4.0.1'
if (rootProject.ext.allowNonFree) {
// MapBox uses telemetry, without Play there may be exceptions from mapbox (OK to ignore)
Expand Down
17 changes: 14 additions & 3 deletions app/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.11.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.11.1)" variant="all" version="8.11.1">
<issues format="6" by="lint 8.12.3" type="baseline" client="gradle" dependencies="false" name="AGP (8.12.3)" variant="all" version="8.12.3">

<issue
id="MissingPermission"
message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
errorLine1=" Location tmp = lm.getLastKnownLocation(s);"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/org/runnerup/tracker/component/TrackerGPS.java"
line="123"
column="22"/>
</issue>

<issue
id="UnusedAttribute"
Expand Down Expand Up @@ -60,14 +71,14 @@
id="Aligned16KB"
message="The native library `arm64-v8a/libmapbox-gl.so` (from `com.mapbox.mapboxsdk:mapbox-android-sdk-gl-core:5.2.2`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.13/transforms/374b0f5ddf7a7b7bd2585a649e851b6e/transformed/jetified-mapbox-android-sdk-gl-core-5.2.2/jni/arm64-v8a/libmapbox-gl.so"/>
file="$GRADLE_USER_HOME/caches/8.13/transforms/42de1f8347fab8a0bff82f7b8295106e/transformed/jetified-mapbox-android-sdk-gl-core-5.2.2/jni/arm64-v8a/libmapbox-gl.so"/>
</issue>

<issue
id="Aligned16KB"
message="The native library `arm64-v8a/libmapbox-gl.so` (from `com.mapbox.mapboxsdk:mapbox-android-sdk-gl-core:5.2.2`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.13/transforms/374b0f5ddf7a7b7bd2585a649e851b6e/transformed/jetified-mapbox-android-sdk-gl-core-5.2.2/jni/arm64-v8a/libmapbox-gl.so"/>
file="$GRADLE_USER_HOME/caches/8.13/transforms/42de1f8347fab8a0bff82f7b8295106e/transformed/jetified-mapbox-android-sdk-gl-core-5.2.2/jni/arm64-v8a/libmapbox-gl.so"/>
</issue>

<issue
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.11.1'
classpath 'com.android.tools.build:gradle:8.13.2'
}
}

Expand All @@ -15,9 +15,9 @@ repositories {
project.ext {
//Common settings for most builds
//Note that Android Studio does not know about the 'ext' module and will warn
buildToolsVersion = '36.0.0' //Update Travis manually
compileSdk = 35 //Update Travis manually
targetSdk = 35
buildToolsVersion = '36.1.0' //Update Travis manually
compileSdk = 36.1 //Update Travis manually
targetSdk = 36.1
minSdk = 21

appcompat_version = "1.7.1"
Expand All @@ -28,7 +28,7 @@ project.ext {
googleWearVersion = '2.9.0'

junitVersion = '4.13.2'
mockitoVersion = '5.18.0'
mockitoVersion = '5.21.0'

//The Git tag for the release must be identical for F-Droid
versionName = '2.9.0.6'
Expand Down
38 changes: 19 additions & 19 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apply plugin: 'com.android.library'

android {
namespace 'org.runnerup'
compileSdk rootProject.ext.compileSdk
buildToolsVersion rootProject.ext.buildToolsVersion
namespace = 'org.runnerup'
compileSdk = rootProject.ext.compileSdk
buildToolsVersion = rootProject.ext.buildToolsVersion

compileOptions {
sourceCompatibility JavaVersion.toVersion("17")
targetCompatibility JavaVersion.toVersion("17")
sourceCompatibility = JavaVersion.toVersion("17")
targetCompatibility = JavaVersion.toVersion("17")
}

defaultConfig {
minSdk rootProject.ext.minSdk
targetSdk rootProject.ext.targetSdk
minSdk = rootProject.ext.minSdk
targetSdk = rootProject.ext.targetSdk
// Default, needed by test
buildConfigField ('String', 'applicationIdFull', '"' + rootProject.ext.applicationId + '"')
}
Expand All @@ -26,27 +26,27 @@ android {
resValue "string", "app_name", "dRunnerUp"
}
release {
debuggable false
debuggable = false
buildConfigField ('String', 'applicationIdFull', '"' + rootProject.ext.applicationId + '"')
resValue "string", "applicationIdFull", rootProject.ext.applicationId

minifyEnabled false
minifyEnabled = false
}
}
}
lint {
showAll true
showAll = true
warning 'MissingTranslation'
baseline file('lint-baseline.xml')
lintConfig file('lint.xml')
checkReleaseBuilds true
lintConfig file('lint.xml')
//textOutput 'stdout'
textReport true
baseline = file('lint-baseline.xml')
lintConfig = file('lint.xml')
checkReleaseBuilds = true
lintConfig = file('lint.xml')
//textOutput = 'stdout'
textReport = true
}
namespace 'org.runnerup.common'
namespace = 'org.runnerup.common'
buildFeatures {
buildConfig true
buildConfig = true
}

sourceSets {
Expand All @@ -67,7 +67,7 @@ repositories {
dependencies {
implementation "androidx.annotation:annotation:${rootProject.ext.annotation_version}"

testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.hamcrest:hamcrest:3.0'
testImplementation "junit:junit:${rootProject.ext.junitVersion}"
testImplementation "org.mockito:mockito-core:${rootProject.ext.mockitoVersion}"

Expand Down
13 changes: 12 additions & 1 deletion common/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 7.4.1" type="baseline" client="gradle" dependencies="false" name="AGP (7.4.1)" variant="all" version="7.4.1">
<issues format="6" by="lint 8.13.2" type="baseline" client="gradle" dependencies="false" name="AGP (8.13.2)" variant="all" version="8.13.2">

<issue
id="AndroidGradlePluginVersion"
message="A newer version of Gradle than 8.13 is available: 8.14.3"
errorLine1="distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="../gradle/wrapper/gradle-wrapper.properties"
line="3"
column="17"/>
</issue>

<issue
id="IconMissingDensityFolder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
Expand Down Expand Up @@ -71,7 +71,7 @@ public void shouldNotCallListenerIfValueIsNull() {

sut.set(null);

verify(listener, never()).onValueChanged(eq(sut), anyObject(), anyObject());
verify(listener, never()).onValueChanged(eq(sut), any(), any());
}

@Test
Expand All @@ -82,7 +82,7 @@ public void shouldNotCallListenerIfListenerIsRemoved() {
sut.unregisterChangeListener(listener);
sut.set(newValue);

verify(listener, never()).onValueChanged(eq(sut), anyObject(), anyObject());
verify(listener, never()).onValueChanged(eq(sut), any(), any());
}

@Test
Expand Down Expand Up @@ -112,9 +112,9 @@ public void shouldNotCallListenersIfClearIsCalled() {

sut.set(newValue);

verify(listener1, never()).onValueChanged(eq(sut), anyObject(), anyObject());
verify(listener2, never()).onValueChanged(eq(sut), anyObject(), anyObject());
verify(listener3, never()).onValueChanged(eq(sut), anyObject(), anyObject());
verify(listener1, never()).onValueChanged(eq(sut), any(), any());
verify(listener2, never()).onValueChanged(eq(sut), any(), any());
verify(listener3, never()).onValueChanged(eq(sut), any(), any());
}

@Test
Expand Down
43 changes: 24 additions & 19 deletions common/src/wear/java/org/runnerup/wear/WearableClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;

import androidx.annotation.NonNull;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.wearable.DataClient;
Expand All @@ -24,28 +28,29 @@ public WearableClient(Context context) {
}

public void readData(String path, Consumer<DataItem> consumer) {
mDataClient.getDataItems(new Uri.Builder()
.scheme(WEAR_URI_SCHEME)
.path(path)
.build())
.addOnCompleteListener(new OnCompleteListener<DataItemBuffer>() {
@Override
public void onComplete(Task<DataItemBuffer> task) {
if (task.isSuccessful()) {
DataItemBuffer dataItems = task.getResult();
if (dataItems.getCount() == 0) {
consumer.accept(null);
} else {
for (DataItem dataItem : dataItems) {
consumer.accept(dataItem);
mDataClient
.getDataItems(new Uri.Builder().scheme(WEAR_URI_SCHEME).path(path).build())
.addOnCompleteListener(
new OnCompleteListener<DataItemBuffer>() {
@Override
public void onComplete(@NonNull Task<DataItemBuffer> task) {
if (task.isSuccessful()) {
DataItemBuffer dataItems = task.getResult();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
if (dataItems.getCount() == 0) {
consumer.accept(null);
} else {
for (DataItem dataItem : dataItems) {
consumer.accept(dataItem);
}
}
}
dataItems.release();
} else {
System.out.println("task.getException(): " + task.getException());
}
dataItems.release();
} else {
System.out.println("task.getException(): " + task.getException());
}
}
});
});
}

public Task<DataItem> putData(String path) {
Expand Down
Loading