Error building AIDL files as part of build
Created by: amitkot
I have a couple of AIDL files in a directory that contains both them and Java files. Following the AntennaPod tutorial, I created the following BUCK file for my project:
import re
jar_deps = []
for jarfile in glob(['libs/*.jar']):
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
jar_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
android_library(
name = 'all-jars',
exported_deps = jar_deps,
)
proj_gen_aidls = []
for aidlfile in glob(['src/main/java/**/*.aidl']):
name = 'proj_aidls__' + re.sub(r'^.*/([^/]+)\.aidl$', r'\1', aidlfile)
proj_gen_aidls.append(':' + name)
gen_aidl(
name = name,
aidl = aidlfile,
import_path = 'src',
)
android_library(
name = 'proj-aidls',
srcs = proj_gen_aidls,
)
android_build_config(
name = 'build-config',
package = 'com.mobile.proj',
)
android_resource(
name = 'res',
package = 'com.mobile.proj',
res = 'res',
assets = 'assets',
deps = [
]
)
android_library(
name = 'main-lib',
srcs = glob(['src/main/java/**/*.java']),
deps = [
':all-jars',
':proj-aidls',
':build-config',
':res',
],
)
keystore(
name = 'debug_keystore',
store = 'keystore/debug.keystore',
properties = 'keystore/debug.keystore.properties',
)
android_binary(
name = 'proj',
manifest = 'AndroidManifest.xml',
target = 'android-10',
keystore = ':debug_keystore',
deps = [
':main-lib',
],
)
When I run buck build proj
I get the following errors:
src/main/java/com/mobile/proj/domain/VehicleState.aidl:4 aidl can only generate code for interfaces, not parcelables or flattenables,
src/main/java/com/mobile/proj/domain/VehicleState.aidl:4 .aidl files that only declare parcelables or flattenablesmay not go in the Makefile.
src/main/java/com/mobile/proj/be/api/ControlService.aidl:3: couldn't find import for class com.mobile.proj.domain.TripState
src/main/java/com/mobile/proj/be/api/ControlService.aidl:4: couldn't find import for class com.mobile.proj.domain.BackendServiceState
src/main/java/com/mobile/proj/be/api/ControlService.aidl:5: couldn't find import for class com.mobile.proj.domain.VehicleState
src/main/java/com/mobile/proj/domain/BackendServiceState.aidl:4 aidl can only generate code for interfaces, not parcelables or flattenables,
src/main/java/com/mobile/proj/domain/BackendServiceState.aidl:4 .aidl files that only declare parcelables or flattenablesmay not go in the Makefile.
src/main/java/com/mobile/proj/domain/TripState.aidl:4 aidl can only generate code for interfaces, not parcelables or flattenables,
src/main/java/com/mobile/proj/domain/TripState.aidl:4 .aidl files that only declare parcelables or flattenablesmay not go in the Makefile.
BUILD FAILED: //:proj_aidls__VehicleState failed with exit code 1:
aidl
Any ideas?