在android源码中编译jar,包含java、aidl
代码结构如下:
需要配置Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# The name of the jar file to create
LOCAL_MODULE := libCus
# Build all java files in the java subdirectory
LOCAL_SRC_FILES := $(call all-subdir-java-files)
aidl_dirs = src/aidl
LOCAL_SRC_FILES += \
src/aidl/com/cus/service/ICusCallBack.aidl \
src/aidl/com/cus/service/ICusManager.aidl
LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/$(aidl_dirs)
# LOCAL_STATIC_ANDROID_LIBRARIES += androidx.appcompat_appcompat com.google.android.material_material
# androidx-constraintlayout_constraintlayout com.google.android.material_material
# Build a static jar file.
include $(BUILD_STATIC_JAVA_LIBRARY)
make libCus开始编译