Skip to content

Commit

Permalink
chore: latest updates for Last Mile Fleet Solution Sample Apps.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 654159149
  • Loading branch information
google-lmfs-sample-apps-bot authored and yuethomas committed Jul 19, 2024
1 parent dff5045 commit 3739c5e
Show file tree
Hide file tree
Showing 21 changed files with 317 additions and 73 deletions.
9 changes: 8 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ updates:
interval: "weekly"
ignore:
# Spring 6 requires Java 17
- dependency-name: "spring*"
- dependency-name: "org.springframework:spring*"
versions: ["[6.0,)]"]

# Guice 7 requires javax -> jakarta upgrade
- dependency-name: "com.google.inject:guice"
versions: ["[7.0,)]"]
- dependency-name: "com.google.inject.extensions:guice-servlet"
versions: ["[7.0,)]"]
12 changes: 6 additions & 6 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Generate gradle wrapper
working-directory: ./android_driverapp_samples
run: |
gradle wrapper
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Build app
working-directory: ./android_driverapp_samples
run: ./gradlew build
12 changes: 6 additions & 6 deletions .github/workflows/backend-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Generate gradle wrapper
working-directory: ./backend
run: |
gradle wrapper
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Build backend
working-directory: ./backend
run: ./gradlew build
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ The scenario ingestion component allows the user to upload a delivery
configuration file, which contains definitions for delivery vehicles, stops, and
tasks to be performed at each stop. A task can be a pick-up or delivery of a
package. Upon receiving such a file, the component calls Fleet Engine to create
these vehicles, stops, and tasks.
these vehicles, stops, and tasks. Uploading the delivery configuration file also
triggers the creation of "Manifest" configs for each vehicle in the file.
These Manifests are a sample backend implementation and not a requirement for
LMFS itself. Restarting the backend removes the existing Manifests because they
exist only in RAM.


#### Delivery vehicle assignment

Expand All @@ -94,7 +99,8 @@ one of the defined (and available) delivery vehicles to the requester, and sends
the information to the app. The app uses the information to set up its internal
representations of these entities, and allows for simulation of a delivery
vehicle as it travels through its assigned stops and performs its assigned
tasks.
tasks. This means that your app's configured vehicle ID may not match the
assigned vehicle ID.

#### Vehicle and task updates

Expand Down
4 changes: 2 additions & 2 deletions android_driverapp_samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ from the backend.
This document assumes you have the following software set up on your
workstation:

- Java SDK 11 (support for newer SDKs is work in progress)
- Java SDK 17 (support for newer SDKs is work in progress)
- Android Studio (latest version)
- Android SDK (latest updates)
- Gradle 7 (latest version)
- Gradle 8 (latest version)

You also need to
[get access to the Driver SDK for Android](https://developers.google.com/maps/documentation/transportation-logistics/last-mile-fleet-solution/shipment-tracking/driver-sdk/driver_sdk_quickstart_android#get_access).
Expand Down
23 changes: 14 additions & 9 deletions android_driverapp_samples/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id "maven-publish"
id "com.google.cloud.artifactregistry.gradle-plugin" version "2.1.5"
id "com.android.application"
}
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.cloud.artifactregistry.gradle-plugin'

ext {
androidxVersion = "1.0.0"
}

task wrapper(type: Wrapper) {
gradleVersion = '7.4'
gradleVersion = '8.4'
}

android {
compileSdkVersion 31
namespace 'com.google.mapsplatform.transportation.delivery.sample.driver'
compileSdkVersion 33

defaultConfig {
applicationId "com.google.mapsplatform.transportation.delivery.sample.driver"
Expand All @@ -48,6 +47,10 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}

sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
Expand Down Expand Up @@ -85,7 +88,9 @@ repositories {
}

dependencies {
implementation 'com.google.android.libraries.mapsplatform.transportation:transportation-driver:4.+'
implementation 'com.google.android.libraries.mapsplatform.transportation:transportation-driver:5.+'
// Driver SDK depends on Navigation SDK; this demonstrates how to set an explicit version.
implementation 'com.google.android.libraries.navigation:navigation:5.3.2'

// And dependencies.
implementation "androidx.appcompat:appcompat:${androidxVersion}"
Expand Down Expand Up @@ -129,7 +134,7 @@ dependencies {
// Comment out this dependency if testing RCs from 1.8 or earlier.
api "org.chromium.net:cronet-fallback:71.3578.98"

coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'

// Test and instrumentation deps.
testImplementation 'junit:junit:4.12'
Expand Down
3 changes: 3 additions & 0 deletions android_driverapp_samples/app/proguard-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@
-dontwarn junit.**
-keep class org.junit.** { *; }
-dontwarn org.junit.**

# https://issuetracker.google.com/issues/279996549
-dontwarn org.kxml2.io.KXml**
8 changes: 7 additions & 1 deletion android_driverapp_samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.android.tools.build:gradle:8.3.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
id "maven-publish"
id "com.google.cloud.artifactregistry.gradle-plugin" version "2.1.5"
}

allprojects {
repositories {
google()
Expand Down
2 changes: 2 additions & 0 deletions android_driverapp_samples/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ org.gradle.jvmargs=-Xmx2048m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Known to cause issues, needs to be tested separately.
android.enableR8.fullMode=false
Binary file modified android_driverapp_samples/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions android_driverapp_samples/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
30 changes: 15 additions & 15 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript { // Configuration for building
mavenCentral()
}
dependencies {
classpath 'com.google.cloud.tools:appengine-gradle-plugin:2.4.2'
classpath 'com.google.cloud.tools:appengine-gradle-plugin:2.4.5'
}
}

Expand Down Expand Up @@ -54,30 +54,30 @@ dependencies {

// Fleet Engine Auth Library and its dependencies
implementation 'com.google.maps:fleetengine-auth:1.8.0'
implementation 'com.google.guava:guava:1.55.0'
implementation 'com.google.guava:guava:23.0'
implementation 'com.google.auth:google-auth-library-oauth2-http:0.26.0'

implementation 'com.auth0:java-jwt:3.10.2'
implementation 'com.google.inject:guice:5.1.0'
implementation 'com.google.inject.extensions:guice-servlet:5.1.0'
implementation 'com.auth0:java-jwt:4.4.0'
implementation 'com.google.inject:guice:6.0.0'
implementation 'com.google.inject.extensions:guice-servlet:6.0.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.google.auto.value:auto-value-annotations:1.10.1'
implementation 'io.grpc:grpc-protobuf:1.55.1'
implementation 'io.grpc:grpc-stub:1.55.1'
implementation 'io.grpc:grpc-netty:1.55.1'
implementation 'com.google.auto.value:auto-value-annotations:1.10.4'
implementation 'io.grpc:grpc-protobuf:1.62.2'
implementation 'io.grpc:grpc-stub:1.62.2'
implementation 'io.grpc:grpc-netty:1.62.2'
implementation 'javax.ws.rs:jsr311-api:1.1.1'
implementation 'com.google.protobuf:protobuf-java:3.23.1'
implementation 'com.google.protobuf:protobuf-java-util:3.23.1'
implementation 'com.google.protobuf:protobuf-java:3.25.3'
implementation 'com.google.protobuf:protobuf-java-util:3.25.3'
implementation 'javax.annotation:javax.annotation-api:1.2'
implementation 'io.netty:netty-tcnative-boringssl-static:2.0.49.Final'
annotationProcessor 'com.google.auto.value:auto-value:1.10.1'
annotationProcessor 'com.google.auto.value:auto-value:1.10.4'

testImplementation 'junit:junit:4.13.2'
testImplementation 'com.google.truth:truth:1.1.3'
testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation 'org.springframework:spring-core:5.3.10'
testImplementation 'org.springframework:spring-web:5.3.10'
testImplementation 'org.springframework:spring-test:5.3.10'
testImplementation 'org.springframework:spring-core:5.3.27'
testImplementation 'org.springframework:spring-web:5.3.27'
testImplementation 'org.springframework:spring-test:5.3.27'

testImplementation 'com.google.appengine:appengine-testing:+'
testImplementation 'com.google.appengine:appengine-api-stubs:+'
Expand Down
Binary file modified backend/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion backend/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 3739c5e

Please sign in to comment.