Skip to content

Commit

Permalink
Add Android x86 to all platforms build and update test
Browse files Browse the repository at this point in the history
  • Loading branch information
austinh0 committed Sep 21, 2021
1 parent a44b3d2 commit a88be7a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ ini
init
inlined
instantiation
installDebug
integrations
IntelliSense
InteractionModelVersion
Expand Down Expand Up @@ -519,6 +520,7 @@ ManualPairingCode
ManualTest
ManufacturingDate
masterkey
matterBuildSrcDir
matterc
matterd
MatterLock
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/android_chiptool_building.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,10 @@ allows us to directly edit core CHIP code in-IDE.

3. Open the project in Android Studio and run **Sync Project with Gradle
Files**.
![image](https://user-images.githubusercontent.com/77706079/133158760-021c8144-c314-4c5d-a2af-71a2dcdcfc0c.png)

4. Use one of the following options to build an Android package:

- Click **Make Project** in Android Studio.
![image](https://user-images.githubusercontent.com/77706079/133158991-943aeca7-eb1f-4abe-a28c-c80533faa0d5.png)
- Run the following command in the command line:

```shell
Expand Down
1 change: 1 addition & 0 deletions scripts/build/build/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def Create(self, runner, __board_key: Board, __app_key: Application,
_MATCHERS[Platform.ANDROID].AcceptBoard(Board.ARM, board=AndroidBoard.ARM)
_MATCHERS[Platform.ANDROID].AcceptBoard(Board.ARM64, board=AndroidBoard.ARM64)
_MATCHERS[Platform.ANDROID].AcceptBoard(Board.X64, board=AndroidBoard.X64)
_MATCHERS[Platform.ANDROID].AcceptBoard(Board.X86, board=AndroidBoard.X86)
_MATCHERS[Platform.ANDROID].AcceptApplication(Application.CHIP_TOOL)

_MATCHERS[Platform.INFINEON].AcceptApplication(
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 @@ -66,6 +66,7 @@ class Board(IntEnum):
ARM = auto()
ARM64 = auto()
X64 = auto()
X86 = auto()

# Infineon board
P6BOARD = auto()
Expand Down
27 changes: 24 additions & 3 deletions scripts/build/expected_all_platform_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ gn gen --check --fail-on-unused-args {out}/android-x64-chip_tool '--args=target_
# Accepting NDK licenses
bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null'

# Generating android-x86-chip_tool
gn gen --check --fail-on-unused-args {out}/android-x86-chip_tool '--args=target_os="android" target_cpu="x86" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning="true"'

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

# Generating infineon-p6board-lock
gn gen --check --fail-on-unused-args --root={root}/examples/lock-app/p6 '--args=p6_board="CY8CKIT-062S2-43012"' {out}/infineon-p6board-lock

Expand Down Expand Up @@ -220,7 +226,7 @@ cp {out}/android-arm-chip_tool/lib/jni/armeabi-v7a/libCHIPController.so {root}/s
cp {out}/android-arm-chip_tool/lib/jni/armeabi-v7a/libc++_shared.so {root}/src/android/CHIPTool/app/libs/jniLibs/armeabi-v7a/libc++_shared.so

# Building APP android-arm-chip_tool
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PchipSdkJarDir={out}/android-arm-chip_tool/lib -PbuildDir={out}/android-arm-chip_tool build
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PchipSdkJarDir={out}/android-arm-chip_tool/lib -PbuildDir={out}/android-arm-chip_tool assembleDebug

# Building JNI android-arm64-chip_tool
ninja -C {out}/android-arm64-chip_tool
Expand All @@ -235,7 +241,7 @@ cp {out}/android-arm64-chip_tool/lib/jni/arm64-v8a/libCHIPController.so {root}/s
cp {out}/android-arm64-chip_tool/lib/jni/arm64-v8a/libc++_shared.so {root}/src/android/CHIPTool/app/libs/jniLibs/arm64-v8a/libc++_shared.so

# Building APP android-arm64-chip_tool
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PchipSdkJarDir={out}/android-arm64-chip_tool/lib -PbuildDir={out}/android-arm64-chip_tool build
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PchipSdkJarDir={out}/android-arm64-chip_tool/lib -PbuildDir={out}/android-arm64-chip_tool assembleDebug

# Building JNI android-x64-chip_tool
ninja -C {out}/android-x64-chip_tool
Expand All @@ -250,7 +256,22 @@ cp {out}/android-x64-chip_tool/lib/jni/x86_64/libCHIPController.so {root}/src/an
cp {out}/android-x64-chip_tool/lib/jni/x86_64/libc++_shared.so {root}/src/android/CHIPTool/app/libs/jniLibs/x86_64/libc++_shared.so

# Building APP android-x64-chip_tool
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PchipSdkJarDir={out}/android-x64-chip_tool/lib -PbuildDir={out}/android-x64-chip_tool build
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PchipSdkJarDir={out}/android-x64-chip_tool/lib -PbuildDir={out}/android-x64-chip_tool assembleDebug

# Building JNI android-x86-chip_tool
ninja -C {out}/android-x86-chip_tool

# Prepare Native libs android-x86-chip_tool
mkdir -p {root}/src/android/CHIPTool/app/libs/jniLibs/x86

cp {out}/android-x86-chip_tool/lib/jni/x86/libSetupPayloadParser.so {root}/src/android/CHIPTool/app/libs/jniLibs/x86/libSetupPayloadParser.so

cp {out}/android-x86-chip_tool/lib/jni/x86/libCHIPController.so {root}/src/android/CHIPTool/app/libs/jniLibs/x86/libCHIPController.so

cp {out}/android-x86-chip_tool/lib/jni/x86/libc++_shared.so {root}/src/android/CHIPTool/app/libs/jniLibs/x86/libc++_shared.so

# Building APP android-x86-chip_tool
{root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PchipSdkJarDir={out}/android-x86-chip_tool/lib -PbuildDir={out}/android-x86-chip_tool assembleDebug

# Building infineon-p6board-lock
ninja -C {out}/infineon-p6board-lock
Expand Down

0 comments on commit a88be7a

Please sign in to comment.