@@ -17,6 +17,8 @@ import("//build_overrides/chip.gni")
17
17
import (" ${ build_root } /config/android_abi.gni" )
18
18
import (" ${ chip_root } /build/chip/java/rules.gni" )
19
19
20
+ build_java_matter_controller = true
21
+
20
22
shared_library (" jni" ) {
21
23
output_name = " libCHIPController"
22
24
@@ -62,19 +64,17 @@ shared_library("jni") {
62
64
output_dir = " ${ root_out_dir } /lib/jni/${ android_abi } "
63
65
64
66
ldflags = [ " -Wl,--gc-sections" ]
67
+
68
+ data_deps = [
69
+ " ${ chip_root } /build/chip/java:shared_cpplib" ,
70
+ ]
65
71
}
66
72
67
73
android_library (" java" ) {
68
74
output_name = " CHIPController.jar"
69
75
70
- deps = [
71
- " :android" ,
72
- " ${ chip_root } /third_party/android_deps:annotation" ,
73
- ]
74
-
75
76
data_deps = [
76
77
" :jni" ,
77
- " ${ chip_root } /build/chip/java:shared_cpplib" ,
78
78
]
79
79
80
80
sources = [
@@ -122,12 +122,47 @@ android_library("java") {
122
122
" zap-generated/chip/devicecontroller/ClusterWriteMapping.java" ,
123
123
]
124
124
125
+ if (build_java_matter_controller ) {
126
+ sources += [
127
+ " stub_src/android/annotations/Nullable.java" ,
128
+ " stub_src/android/bluetooth/BluetoothGatt.java" ,
129
+ " stub_src/android/bluetooth/BluetoothGattCallback.java" ,
130
+ " stub_src/android/bluetooth/BluetoothGattCharacteristic.java" ,
131
+ " stub_src/android/bluetooth/BluetoothGattDescriptor.java" ,
132
+ " stub_src/android/bluetooth/BluetoothGattService.java" ,
133
+ " stub_src/android/bluetooth/BluetoothProfile.java" ,
134
+ " stub_src/android/os/Build.java" ,
135
+ " stub_src/android/os/Parcelable.java" ,
136
+ " stub_src/android/os/Parcel.java" ,
137
+ " stub_src/android/util/Log.java" ,
138
+ ]
139
+ deps = [
140
+ " :json" ,
141
+ ]
142
+ }
143
+ else
144
+ {
145
+ deps = [
146
+ " :android" ,
147
+ " ${ chip_root } /third_party/android_deps:annotation" ,
148
+ ]
149
+ }
150
+
125
151
javac_flags = [ " -Xlint:deprecation" ]
126
152
127
153
# TODO: add classpath support (we likely need to add something like
128
154
# ..../platforms/android-21/android.jar to access BLE items)
129
155
}
130
156
131
- java_prebuilt (" android" ) {
132
- jar_path = " ${ android_sdk_root } /platforms/android-21/android.jar"
157
+ if (build_java_matter_controller ) {
158
+ java_prebuilt (" json" ) {
159
+ jar_path = " json-20220924.jar"
160
+ }
161
+ }
162
+ else
163
+ {
164
+ java_prebuilt (" android" ) {
165
+ jar_path = " ${ android_sdk_root } /platforms/android-21/android.jar"
166
+ }
167
+
133
168
}
0 commit comments