Skip to content

Commit

Permalink
Merge branch 'master' into dns_sd_changes_final
Browse files Browse the repository at this point in the history
  • Loading branch information
nivi-apple authored Mar 29, 2024
2 parents 797ddae + c5fba0c commit 0b28c78
Show file tree
Hide file tree
Showing 26 changed files with 476 additions and 283 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/full-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ jobs:
"ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test"
- name: Clean out build output
run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar
# - name: Build Android Studio build (arm64 only)
# run: |
# ./scripts/run_in_build_env.sh \
# "./scripts/build/build_examples.py --target android-androidstudio-arm64-chip-tool build"
- name: Build Android arm64-chip-test
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target android-arm64-chip-test build"
- name: Clean out build output
run: rm -rf ./out examples/android/CHIPTest/app/libs/jniLibs/* examples/android/CHIPTest/app/libs/*.jar
25 changes: 25 additions & 0 deletions examples/android/CHIPTest/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
import("//args.gni")
}
83 changes: 83 additions & 0 deletions examples/android/CHIPTest/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

import("${build_root}/config/android_abi.gni")
import("${chip_root}/build/chip/chip_build.gni")
import("${chip_root}/build/chip/java/rules.gni")
import("${chip_root}/build/chip/tools.gni")

shared_library("jni") {
output_name = "libCHIPTest"

sources = [ "app/src/main/cpp/CHIPTest-JNI.cpp" ]

deps = [
"${chip_root}/src:tests",
"${chip_root}/src/controller/java",
"${chip_root}/src/controller/java:onboarding_payload",
"${chip_root}/src/lib",
"${chip_root}/src/lib/support",
"${chip_root}/src/lib/support:pw_tests_wrapper",
"${chip_root}/src/lib/support:test_utils",
"${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/lib/support/jsontlv",
"${chip_root}/src/platform",
"${chip_root}/src/platform/android",
"${chip_root}/src/platform/android:java",
"${chip_root}/src/platform/logging:android",
"${chip_root}/src/platform/tests:tests",
"${chip_root}/third_party/inipp",
"${chip_root}/third_party/nlfaultinjection:nlfaultinjection",
]

cflags = [ "-Wconversion" ]

output_dir = "${root_out_dir}/lib/jni/${android_abi}"

ldflags = [ "-Wl,--gc-sections" ]

libs = [ "log" ]
}

android_library("java") {
output_name = "CHIPTest.jar"

deps = [
":android",
"${chip_root}/third_party/android_deps:annotation",
]

data_deps = [
":jni",
"${chip_root}/build/chip/java:shared_cpplib",
]

sources = [ "app/src/main/java/com/tcl/chip/chiptest/TestEngine.java" ]

javac_flags = [ "-Xlint:deprecation" ]
}

java_prebuilt("android") {
jar_path = "${android_sdk_root}/platforms/android-26/android.jar"
}

group("default") {
deps = [
":java",
":jni",
]
}
25 changes: 11 additions & 14 deletions examples/android/CHIPTest/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ android {

externalNativeBuild {
cmake {
arguments "-DMATTER_SDK_SOURCE_BUILD="+matterSdkSourceBuild \
, "-DMATTER_SDK_BUILD_ROOT="+matterBuildSrcDir \
, "-DMATTER_SDK_UTEST_LIB="+matterUTestLib
targets "default"
}
}
}
Expand All @@ -52,23 +50,22 @@ android {
jvmTarget = '1.8'
}

externalNativeBuild {
cmake {
path file('src/main/cpp/CMakeLists.txt')
version '3.10.2'
}
}

buildFeatures {
viewBinding true
}
sourceSets {
main {
jniLibs.srcDirs = ['libs/jniLibs']
java.srcDirs = [
'src/main/java',
'src/main/jni',
]
}
}
}

dependencies {
if(!matterSdkSourceBuild.toBoolean()) {
implementation fileTree(dir: "libs", include: ["*.jar"])
}

implementation fileTree(dir: "libs", include: ["*.jar", "*.so"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
Expand Down
Loading

0 comments on commit 0b28c78

Please sign in to comment.