Skip to content

Commit

Permalink
Fixing break in build script for android tv-casting-app from project-…
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadb-amazon committed Jul 20, 2022
1 parent 4cdecc9 commit a8ecc2f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 43 deletions.
18 changes: 9 additions & 9 deletions examples/tv-casting-app/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ the TV.

<hr>

- [Requirements for building](#requirements)
- [ABIs and TARGET_CPU](#abi)
- [Gradle & JDK Version](#jdk)
- [Preparing for build](#preparing)
- [Building & Installing the app](#building-installing)
- [Running the app on Android](#running-the-app-on-android)
- [Matter TV Casting Android App Example](#matter-tv-casting-android-app-example)
- [Requirements for building](#requirements-for-building)
- [ABIs and TARGET_CPU](#abis-and-target_cpu)
- [Gradle & JDK Version](#gradle--jdk-version)
- [Preparing for build](#preparing-for-build)
- [Building & Installing the app](#building--installing-the-app)

<hr>

Expand Down Expand Up @@ -79,17 +79,17 @@ This is the simplest option. In the command line, run the following command from
the top Matter directory:

```shell
./scripts/build/build_examples.py --target android-arm64-chip-tv-casting-app build
./scripts/build/build_examples.py --target android-arm64-tv-casting-app build
```

See the table above for other values of `TARGET_CPU`.

The debug Android package `app-debug.apk` will be generated at
`out/android-$TARGET_CPU-chip-tv-casting-app/outputs/apk/debug/`, and can be
`out/android-$TARGET_CPU-tv-casting-app/outputs/apk/debug/`, and can be
installed with

```shell
adb install out/android-$TARGET_CPU-chip-tv-casting-app/outputs/apk/debug/app-debug.apk
adb install out/android-$TARGET_CPU-tv-casting-app/outputs/apk/debug/app-debug.apk
```

You can use Android Studio to edit the Android app itself and run it after
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ def AndroidTargets():
yield target.Extend('arm-tv-server', board=AndroidBoard.ARM, app=AndroidApp.TV_SERVER)
yield target.Extend('x86-tv-server', board=AndroidBoard.X86, app=AndroidApp.TV_SERVER)
yield target.Extend('x64-tv-server', board=AndroidBoard.X64, app=AndroidApp.TV_SERVER)
yield target.Extend('arm64-tv-casting-app', board=AndroidBoard.ARM64, app=AndroidApp.TV_SERVER)
yield target.Extend('arm-tv-casting-app', board=AndroidBoard.ARM, app=AndroidApp.TV_SERVER)
yield target.Extend('arm64-tv-casting-app', board=AndroidBoard.ARM64, app=AndroidApp.TV_CASTING_APP)
yield target.Extend('arm-tv-casting-app', board=AndroidBoard.ARM, app=AndroidApp.TV_CASTING_APP)


def MbedTargets():
Expand Down
50 changes: 18 additions & 32 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null'
python3 third_party/android_deps/set_up_android_deps.py

# Generating android-arm-tv-casting-app
gn gen --check --fail-on-unused-args {out}/android-arm-tv-casting-app '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' --root={root}/examples/tv-app/android/
gn gen --check --fail-on-unused-args {out}/android-arm-tv-casting-app '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' --root={root}/examples/tv-casting-app/android/

# Accepting NDK licenses @ tools
bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null'
Expand Down Expand Up @@ -98,7 +98,7 @@ bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null'
python3 third_party/android_deps/set_up_android_deps.py

# Generating android-arm64-tv-casting-app
gn gen --check --fail-on-unused-args {out}/android-arm64-tv-casting-app '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' --root={root}/examples/tv-app/android/
gn gen --check --fail-on-unused-args {out}/android-arm64-tv-casting-app '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' --root={root}/examples/tv-casting-app/android/

# Accepting NDK licenses @ tools
bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null'
Expand Down Expand Up @@ -1262,27 +1262,20 @@ cp {out}/android-arm-chip-tool/lib/src/platform/android/AndroidPlatform.jar {roo
ninja -C {out}/android-arm-tv-casting-app

# Prepare Native libs android-arm-tv-casting-app
mkdir -p {root}/examples/tv-app/android/App/app/libs/jniLibs/armeabi-v7a

cp {out}/android-arm-tv-casting-app/lib/jni/armeabi-v7a/libSetupPayloadParser.so {root}/examples/tv-app/android/App/app/libs/jniLibs/armeabi-v7a/libSetupPayloadParser.so

cp {out}/android-arm-tv-casting-app/lib/jni/armeabi-v7a/libc++_shared.so {root}/examples/tv-app/android/App/app/libs/jniLibs/armeabi-v7a/libc++_shared.so

cp {out}/android-arm-tv-casting-app/lib/jni/armeabi-v7a/libTvApp.so {root}/examples/tv-app/android/App/app/libs/jniLibs/armeabi-v7a/libTvApp.so
mkdir -p {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/armeabi-v7a

cp {out}/android-arm-tv-casting-app/lib/third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar {root}/examples/tv-app/android/App/app/libs/SetupPayloadParser.jar
cp {out}/android-arm-tv-casting-app/lib/jni/armeabi-v7a/libc++_shared.so {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/armeabi-v7a/libc++_shared.so

cp {out}/android-arm-tv-casting-app/lib/third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar {root}/examples/tv-app/android/App/app/libs/AndroidPlatform.jar
cp {out}/android-arm-tv-casting-app/lib/jni/armeabi-v7a/libTvCastingApp.so {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/armeabi-v7a/libTvCastingApp.so

cp {out}/android-arm-tv-casting-app/lib/third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar {root}/examples/tv-app/android/App/app/libs/CHIPAppServer.jar
cp {out}/android-arm-tv-casting-app/lib/third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar {root}/examples/tv-casting-app/android/App/app/libs/AndroidPlatform.jar

cp {out}/android-arm-tv-casting-app/lib/TvApp.jar {root}/examples/tv-app/android/App/app/libs/TvApp.jar
cp {out}/android-arm-tv-casting-app/lib/third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar {root}/examples/tv-casting-app/android/App/app/libs/CHIPAppServer.jar

# Building Example android-arm-tv-casting-app, module platform-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm-tv-casting-app -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-tv-casting-app/platform-app :platform-app:assembleDebug
cp {out}/android-arm-tv-casting-app/lib/TvCastingApp.jar {root}/examples/tv-casting-app/android/App/app/libs/TvCastingApp.jar

# Building Example android-arm-tv-casting-app, module content-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm-tv-casting-app -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-tv-casting-app/content-app :content-app:assembleDebug
# Building Example android-arm-tv-casting-app
{root}/examples/tv-casting-app/android/App/gradlew -p {root}/examples/tv-casting-app/android/App/ -PmatterBuildSrcDir={out}/android-arm-tv-casting-app -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-tv-casting-app assembleDebug

# Building JNI android-arm-tv-server
ninja -C {out}/android-arm-tv-server
Expand Down Expand Up @@ -1356,27 +1349,20 @@ cp {out}/android-arm64-chip-tool/lib/src/platform/android/AndroidPlatform.jar {r
ninja -C {out}/android-arm64-tv-casting-app

# Prepare Native libs android-arm64-tv-casting-app
mkdir -p {root}/examples/tv-app/android/App/app/libs/jniLibs/arm64-v8a

cp {out}/android-arm64-tv-casting-app/lib/jni/arm64-v8a/libSetupPayloadParser.so {root}/examples/tv-app/android/App/app/libs/jniLibs/arm64-v8a/libSetupPayloadParser.so

cp {out}/android-arm64-tv-casting-app/lib/jni/arm64-v8a/libc++_shared.so {root}/examples/tv-app/android/App/app/libs/jniLibs/arm64-v8a/libc++_shared.so

cp {out}/android-arm64-tv-casting-app/lib/jni/arm64-v8a/libTvApp.so {root}/examples/tv-app/android/App/app/libs/jniLibs/arm64-v8a/libTvApp.so
mkdir -p {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/arm64-v8a

cp {out}/android-arm64-tv-casting-app/lib/third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar {root}/examples/tv-app/android/App/app/libs/SetupPayloadParser.jar
cp {out}/android-arm64-tv-casting-app/lib/jni/arm64-v8a/libc++_shared.so {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/arm64-v8a/libc++_shared.so

cp {out}/android-arm64-tv-casting-app/lib/third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar {root}/examples/tv-app/android/App/app/libs/AndroidPlatform.jar
cp {out}/android-arm64-tv-casting-app/lib/jni/arm64-v8a/libTvCastingApp.so {root}/examples/tv-casting-app/android/App/app/libs/jniLibs/arm64-v8a/libTvCastingApp.so

cp {out}/android-arm64-tv-casting-app/lib/third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar {root}/examples/tv-app/android/App/app/libs/CHIPAppServer.jar
cp {out}/android-arm64-tv-casting-app/lib/third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar {root}/examples/tv-casting-app/android/App/app/libs/AndroidPlatform.jar

cp {out}/android-arm64-tv-casting-app/lib/TvApp.jar {root}/examples/tv-app/android/App/app/libs/TvApp.jar
cp {out}/android-arm64-tv-casting-app/lib/third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar {root}/examples/tv-casting-app/android/App/app/libs/CHIPAppServer.jar

# Building Example android-arm64-tv-casting-app, module platform-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm64-tv-casting-app -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm64-tv-casting-app/platform-app :platform-app:assembleDebug
cp {out}/android-arm64-tv-casting-app/lib/TvCastingApp.jar {root}/examples/tv-casting-app/android/App/app/libs/TvCastingApp.jar

# Building Example android-arm64-tv-casting-app, module content-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm64-tv-casting-app -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm64-tv-casting-app/content-app :content-app:assembleDebug
# Building Example android-arm64-tv-casting-app
{root}/examples/tv-casting-app/android/App/gradlew -p {root}/examples/tv-casting-app/android/App/ -PmatterBuildSrcDir={out}/android-arm64-tv-casting-app -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm64-tv-casting-app assembleDebug

# Building JNI android-arm64-tv-server
ninja -C {out}/android-arm64-tv-server
Expand Down

0 comments on commit a8ecc2f

Please sign in to comment.