Create version specific dir for generated libs.

Need to create version specific directory so that a client/VHAL
implementation can link against a previously released property
interface.

Otherwise we force all the current clients/servers that use the
generated libs to use the latest property interface library.

Test: Presubmit
Bug: 337328290
Change-Id: I07ee8d0c2c6fa5c1c21f93a54d8b7455a2fad6d7
This commit is contained in:
Yu Shan 2024-04-26 14:49:04 -07:00
parent c1bf1c88e8
commit 72594ce8fa
15 changed files with 37 additions and 24 deletions

View file

@ -49,7 +49,7 @@ android_test {
name: "VehiclePropertyAnnotationJavaTest",
srcs: [
"VehiclePropertyAnnotationJavaTest.java",
":IVehicleGeneratedJavaFiles",
":IVehicleGeneratedJavaFiles-V3",
],
static_libs: [
"android.hardware.automotive.vehicle-V3-java",

View file

@ -25,3 +25,11 @@ cc_library_headers {
export_include_dirs: ["."],
defaults: ["VehicleHalInterfaceDefaults"],
}
cc_library_headers {
name: "IVehicleGeneratedHeaders-V3",
vendor_available: true,
local_include_dirs: ["."],
export_include_dirs: ["."],
defaults: ["VehicleHalInterfaceDefaults"],
}

View file

@ -24,3 +24,10 @@ filegroup {
"*.java",
],
}
filegroup {
name: "IVehicleGeneratedJavaFiles-V3",
srcs: [
"*.java",
],
}

View file

@ -27,7 +27,7 @@ cc_library {
defaults: ["VehicleHalDefaults"],
static_libs: ["VehicleHalUtils"],
header_libs: [
"IVehicleGeneratedHeaders",
"IVehicleGeneratedHeaders-V3",
],
shared_libs: ["libjsoncpp"],
}
@ -44,7 +44,7 @@ cc_library {
defaults: ["VehicleHalDefaults"],
static_libs: ["VehicleHalUtils"],
header_libs: [
"IVehicleGeneratedHeaders",
"IVehicleGeneratedHeaders-V3",
"libbinder_headers",
],
cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"],
@ -59,7 +59,7 @@ cc_library_headers {
defaults: ["VehicleHalDefaults"],
static_libs: ["VehicleHalUtils"],
header_libs: [
"IVehicleGeneratedHeaders",
"IVehicleGeneratedHeaders-V3",
],
shared_libs: ["libjsoncpp"],
}

View file

@ -31,7 +31,7 @@ cc_test {
"libgtest",
],
header_libs: [
"IVehicleGeneratedHeaders",
"IVehicleGeneratedHeaders-V3",
],
shared_libs: [
"libjsoncpp",
@ -57,7 +57,7 @@ cc_test {
"-DENABLE_VEHICLE_HAL_TEST_PROPERTIES",
],
header_libs: [
"IVehicleGeneratedHeaders",
"IVehicleGeneratedHeaders-V3",
],
shared_libs: [
"libjsoncpp",

View file

@ -66,7 +66,7 @@ cc_library {
],
header_libs: [
"IVehicleHardware",
"IVehicleGeneratedHeaders",
"IVehicleGeneratedHeaders-V3",
],
shared_libs: [
"libbinder_ndk",

View file

@ -17,9 +17,9 @@
"""A script to generate Java files and CPP header files based on annotations in VehicleProperty.aidl
Need ANDROID_BUILD_TOP environmental variable to be set. This script will update
ChangeModeForVehicleProperty.h and AccessForVehicleProperty.h under generated_lib/cpp and
ChangeModeForVehicleProperty.h and AccessForVehicleProperty.h under generated_lib/version/cpp and
ChangeModeForVehicleProperty.java, AccessForVehicleProperty.java, EnumForVehicleProperty.java
UnitsForVehicleProperty.java under generated_lib/java.
UnitsForVehicleProperty.java under generated_lib/version/java.
Usage:
$ python generate_annotation_enums.py
@ -31,22 +31,20 @@ import re
import sys
import tempfile
# Keep this updated with the latest in-development property version.
PROPERTY_VERSION = '3'
PROP_AIDL_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl_property/android/hardware/' +
'automotive/vehicle/VehicleProperty.aidl')
CHANGE_MODE_CPP_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/' +
'ChangeModeForVehicleProperty.h')
ACCESS_CPP_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/' +
'AccessForVehicleProperty.h')
CHANGE_MODE_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' +
'ChangeModeForVehicleProperty.java')
ACCESS_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' +
'AccessForVehicleProperty.java')
ENUM_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' +
'EnumForVehicleProperty.java')
UNITS_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' +
'UnitsForVehicleProperty.java')
VERSION_CPP_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/' +
'VersionForVehicleProperty.h')
GENERATED_LIB = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/' + PROPERTY_VERSION +
'/')
CHANGE_MODE_CPP_FILE_PATH = GENERATED_LIB + '/cpp/ChangeModeForVehicleProperty.h'
ACCESS_CPP_FILE_PATH = GENERATED_LIB + '/cpp/AccessForVehicleProperty.h'
CHANGE_MODE_JAVA_FILE_PATH = GENERATED_LIB + '/java/ChangeModeForVehicleProperty.java'
ACCESS_JAVA_FILE_PATH = GENERATED_LIB + '/java/AccessForVehicleProperty.java'
ENUM_JAVA_FILE_PATH = GENERATED_LIB + '/java/EnumForVehicleProperty.java'
UNITS_JAVA_FILE_PATH = GENERATED_LIB + '/java/UnitsForVehicleProperty.java'
VERSION_CPP_FILE_PATH = GENERATED_LIB + '/cpp/VersionForVehicleProperty.h'
SCRIPT_PATH = 'hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py'
TAB = ' '

View file

@ -43,7 +43,7 @@ cc_test {
"vhalclient_defaults",
],
header_libs: [
"IVehicleGeneratedHeaders",
"IVehicleGeneratedHeaders-V3",
],
test_suites: [
"general-tests",