blob: 9893907f8588ba92af6d8406fa44b256586f8c64 [file] [log] [blame]
# Copyright (c) 2020-2021 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("${chip_root}/src/platform/device.gni")
import("${build_root}/config/android_abi.gni")
import("${chip_root}/build/chip/java/rules.gni")
assert(chip_device_platform == "android")
source_set("tracing") {
sources = [
"tracing.cpp",
"tracing.h",
]
deps = [
"${chip_root}/src/lib/support",
"${chip_root}/src/tracing",
"${chip_root}/src/tracing/perfetto:event_storage",
"${chip_root}/src/tracing/perfetto:simple_initialization",
]
}
static_library("logging") {
sources = [ "Logging.cpp" ]
deps = [
"${chip_root}/src/lib/core:chip_config_header",
"${chip_root}/src/lib/support:attributes",
"${chip_root}/src/lib/support:logging_constants",
"${chip_root}/src/platform:platform_config_header",
"${chip_root}/src/platform/logging:headers",
]
libs = [ "log" ]
}
static_library("android") {
output_name = "libAndroidPlatform"
sources = [
"../DeviceSafeQueue.cpp",
"../DeviceSafeQueue.h",
"../SingletonConfigurationManager.cpp",
"AndroidChipPlatform-JNI.cpp",
"AndroidConfig.cpp",
"AndroidConfig.h",
"BLEManagerImpl.cpp",
"BLEManagerImpl.h",
"BleConnectCallback-JNI.cpp",
"BlePlatformConfig.h",
"CHIPDevicePlatformEvent.h",
"CommissionableDataProviderImpl.cpp",
"CommissionableDataProviderImpl.h",
"ConfigurationManagerImpl.cpp",
"ConfigurationManagerImpl.h",
"ConnectivityManagerImpl.cpp",
"ConnectivityManagerImpl.h",
"DeviceInstanceInfoProviderImpl.cpp",
"DeviceInstanceInfoProviderImpl.h",
"DiagnosticDataProviderImpl.cpp",
"DiagnosticDataProviderImpl.h",
"DnssdImpl.cpp",
"DnssdImpl.h",
"KeyValueStoreManagerImpl.cpp",
"KeyValueStoreManagerImpl.h",
"PlatformManagerImpl.cpp",
"PlatformManagerImpl.h",
]
deps = [
":tracing",
"${chip_root}/src/lib/dnssd:platform_header",
"${chip_root}/src/setup_payload",
]
public_deps = [ "${chip_root}/src/platform:platform_base" ]
public_configs = []
}
source_set("inet") {
sources = [ "InetInterfaceImpl.cpp" ]
deps = [
"${chip_root}/src/inet:impl_header",
"${chip_root}/src/lib/support",
]
}
android_library("java") {
output_name = "AndroidPlatform.jar"
deps = [
":android_sdk",
"${chip_root}/third_party/android_deps:annotation",
]
data_deps = [ ":android" ]
sources = [
"java/chip/platform/AndroidBleManager.java",
"java/chip/platform/AndroidChipLogging.java",
"java/chip/platform/AndroidChipPlatform.java",
"java/chip/platform/AndroidChipPlatformException.java",
"java/chip/platform/BleCallback.java",
"java/chip/platform/BleConnectCallback.java",
"java/chip/platform/BleManager.java",
"java/chip/platform/ChipMdnsCallback.java",
"java/chip/platform/ChipMdnsCallbackImpl.java",
"java/chip/platform/ConfigurationManager.java",
"java/chip/platform/DiagnosticDataProvider.java",
"java/chip/platform/DiagnosticDataProviderImpl.java",
"java/chip/platform/KeyValueStoreManager.java",
"java/chip/platform/NetworkInterface.java",
"java/chip/platform/NsdManagerServiceBrowser.java",
"java/chip/platform/NsdManagerServiceResolver.java",
"java/chip/platform/NsdServiceFinderAndResolver.java",
"java/chip/platform/PreferencesConfigurationManager.java",
"java/chip/platform/PreferencesKeyValueStoreManager.java",
"java/chip/platform/ServiceBrowser.java",
"java/chip/platform/ServiceResolver.java",
]
javac_flags = [
"-Xlint:deprecation",
"-parameters", # Store infomation about method parameters
]
}
java_prebuilt("android_sdk") {
jar_path = "${android_sdk_root}/platforms/android-26/android.jar"
}