Android.mk里的LOCAL_SRC_FILES

简介: Android.mk里的LOCAL_SRC_FILES

写法:

LOCAL_SRC_FILES 变量代表需要编译的文件,all-subdir-java-files 函数返回 LOCAL_PATH 子目录的所有 java文件。


LOCAL_SRC_FILES := $(call all-subdir-java-files)


也可以直接写出需要编译的文件路径:


LOCAL_SRC_FILES :=src/com/example/test/MainActivity.java \
                  src/com/example/test/Demo1.java \
                  src/com/example/test/Demo2.java 
// 需要在文件最后面加上以下语句,指明 LOCAL_PATH 目录。              
include $(call all-java-file-under,$(LOCAL_PATH))


每个文件路径下都加上 LOCAL_PATH :


LOCAL_SRC_FILES :=$(LOCAL_PATH)/src/com/example/test/MainActivity.java \
                  $(LOCAL_PATH)/src/com/example/test/Demo1.java \
                  $(LOCAL_PATH)/src/com/example/test/Demo2.java 


几个常用的获取源文件的方法:包名之外的路径(com之前的)

$(call all-java-files-under, src) :获取指定目录下的所有 Java 文件。

$(call all-c-files-under, src) :获取指定目录下的所有 C 语言文件。

$(call all-Iaidl-files-under, src) :获取指定目录下的所有 AIDL 文件。

$(call all-makefiles-under, folder):获取指定目录下的所有 Make 文件


目录
相关文章
|
5月前
|
开发工具 Android开发
解决Android运行出现NDK at /Library/Android/sdk/ndk-bundle did not have a source.properties file
解决Android运行出现NDK at /Library/Android/sdk/ndk-bundle did not have a source.properties file
214 4
解决Android运行出现NDK at /Library/Android/sdk/ndk-bundle did not have a source.properties file
|
5月前
|
Android开发 iOS开发
[ionic]解决运行Android、IOS出现Could not find the web assets directory
[ionic]解决运行Android、IOS出现Could not find the web assets directory
47 1
|
Android开发
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
471 0
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
|
开发工具
Dex Loader] Failed to load D:\adt-bundle-windows-x86_64-20190307\sdk\build-tools\28.0.3\lib\dx.jar
Dex Loader] Failed to load D:\adt-bundle-windows-x86_64-20190307\sdk\build-tools\28.0.3\lib\dx.jar
114 0
|
开发工具 Android开发
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
581 0
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
|
Java Android开发
【错误记录】Android 应用配置第三方 so 动态库 ( /data/app/comxxx==/base.apk/lib/arm64-v8a]couldn‘t find “libx.so“ )
【错误记录】Android 应用配置第三方 so 动态库 ( /data/app/comxxx==/base.apk/lib/arm64-v8a]couldn‘t find “libx.so“ )
705 0
【错误记录】Android 应用配置第三方 so 动态库 ( /data/app/comxxx==/base.apk/lib/arm64-v8a]couldn‘t find “libx.so“ )
|
XML 存储 Android开发
解决 Android N 上报错:android.os.FileUriExposedException: file:///storage/emulated/0/
解决 Android N 上报错:android.os.FileUriExposedException: file:///storage/emulated/0/
1674 0
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
原文:No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android 今天把ndk升级了,但之前的串口通信的例子却无法编译了,一直报错 No toolchains found ...
2299 0
|
Android开发 开发工具
Android NDK:/../build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s): m...
异常 D:/Program/android/sdk/ndk-bundle/build//../build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s):...
1307 0
|
存储 Android开发
Android Studio 解决 Error: /data/local/tmp/com.mazaiting.imgtomp4test安装失败问题
问题异常: $ adb push F:\test\ImgToMp4Test\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.mazaiting.imgtomp4test 问题原因: /data/local/tmp 文件夹下存储已满,删除其数据,即可正常安装。
882 0