Skip to content

Commit

Permalink
[hotfix] fix tv-server build failed issue on arm and added CI for it (#…
Browse files Browse the repository at this point in the history
…12618)

* fix tv-server build failed issue on arm and added CI for it

* fix restyled-io and ci errors
  • Loading branch information
xylophone21 authored and pull[bot] committed Aug 1, 2023
1 parent f7bd673 commit c98c3a7
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/tv-app/android/java/MediaPlaybackManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ EmberAfMediaPlaybackStatus MediaPlaybackManager::Request(MediaPlaybackRequest me
CHIP_ERROR err = CHIP_NO_ERROR;
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();

ChipLogProgress(Zcl, "MediaPlaybackManager::Request %d-%ld", mediaPlaybackRequest, deltaPositionMilliseconds);
ChipLogProgress(Zcl, "MediaPlaybackManager::Request %d-%ld", mediaPlaybackRequest,
static_cast<long>(deltaPositionMilliseconds));
VerifyOrExit(mMediaPlaybackManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE);
VerifyOrExit(mRequestMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE);
VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV);
Expand Down
1 change: 1 addition & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def AndroidTargets():
yield target.Extend('androidstudio-x86-chip-tool', board=AndroidBoard.AndroidStudio_X86, app=AndroidApp.CHIP_TOOL)
yield target.Extend('androidstudio-x64-chip-tool', board=AndroidBoard.AndroidStudio_X64, app=AndroidApp.CHIP_TOOL)
yield target.Extend('arm64-chip-tvserver', board=AndroidBoard.ARM64, app=AndroidApp.CHIP_TVServer)
yield target.Extend('arm-chip-tvserver', board=AndroidBoard.ARM64, app=AndroidApp.CHIP_TVServer)


def MbedTargets():
Expand Down
1 change: 1 addition & 0 deletions scripts/build/testdata/all_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ android-androidstudio-arm64-chip-tool
android-androidstudio-x64-chip-tool
android-androidstudio-x86-chip-tool
android-arm-chip-tool
android-arm-chip-tvserver
android-arm64-chip-test
android-arm64-chip-tool
android-arm64-chip-tvserver
Expand Down
35 changes: 35 additions & 0 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ python3 build/chip/java/tests/generate_jars_for_test.py
# Setting up Android deps through Gradle
python3 third_party/android_deps/set_up_android_deps.py

# Generating android-arm-chip-tvserver
gn gen --check --fail-on-unused-args {out}/android-arm-chip-tvserver '--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/

# Accepting NDK licenses @ tools
bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null'

# Generating JARs for Java build rules test
python3 build/chip/java/tests/generate_jars_for_test.py

# Setting up Android deps through Gradle
python3 third_party/android_deps/set_up_android_deps.py

# Generating android-arm64-chip-test
gn gen --check --fail-on-unused-args {out}/android-arm64-chip-test '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" '

Expand Down Expand Up @@ -603,6 +615,29 @@ cp {out}/android-arm-chip-tool/lib/src/platform/android/AndroidPlatform.jar {roo
# Building APP android-arm-chip-tool
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PmatterBuildSrcDir={out}/android-arm-chip-tool -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-chip-tool assembleDebug

# Building JNI android-arm-chip-tvserver
ninja -C {out}/android-arm-chip-tvserver

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

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

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

cp {out}/android-arm-chip-tvserver/lib/jni/arm64-v8a/libTvApp.so {root}/examples/tv-app/android/App/app/libs/jniLibs/arm64-v8a/libTvApp.so

cp {out}/android-arm-chip-tvserver/lib/third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar {root}/examples/tv-app/android/App/app/libs/SetupPayloadParser.jar

cp {out}/android-arm-chip-tvserver/lib/third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar {root}/examples/tv-app/android/App/app/libs/AndroidPlatform.jar

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

cp {out}/android-arm-chip-tvserver/lib/TvApp.jar {root}/examples/tv-app/android/App/app/libs/TvApp.jar

# Building Example android-arm-chip-tvserver
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-chip-tvserver assembleDebug

# Building JNI android-arm64-chip-test
ninja -C {out}/android-arm64-chip-test

Expand Down
1 change: 1 addition & 0 deletions scripts/build/testdata/glob_star_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ android-androidstudio-arm64-chip-tool
android-androidstudio-x64-chip-tool
android-androidstudio-x86-chip-tool
android-arm-chip-tool
android-arm-chip-tvserver
android-arm64-chip-test
android-arm64-chip-tool
android-arm64-chip-tvserver
Expand Down

0 comments on commit c98c3a7

Please sign in to comment.