Ninja build. Add files to Android apk from jar file to root of the apk file.

90 views
Skip to first unread message

ayde...@gmail.com

unread,
Nov 23, 2017, 3:56:06 AM11/23/17
to Chromium-dev
We have a special case, when we need to add folder with files to the root of the apk. It is used not by us but is needed to be there. Gradle build copies those folders from jar to the root of the apk, how to do it using ninja build. Should I add extra script and maybe add the folder before zipping and signing. Anyway I can not find the way to do it. Please help.

Mikhail Lopatkin

unread,
Nov 23, 2017, 4:13:04 AM11/23/17
to ayde...@gmail.com, Chromium-dev
If your jar is pre-built then you can specify include_java_resources = true in gn file. With this all APKs that depend on this JAR will include non-.class files from the APK (all but the ones under META-INF/). You can check how it is done for emma.jar here: https://cs.chromium.org/chromium/src/build/secondary/third_party/android_tools/support/BUILD.gn?l=30&rcl=905d45082e9c2b6b03103b405b63c47c9e5ebc57
Note that for now it is all-or-nothing, so you cannot specify what files from the jar to include.
 
Hope it helps.
 
-- 
Mikhail Lopatkin.
 
 
 
23.11.2017, 11:56, "ayde...@gmail.com" <ayde...@gmail.com>:
We have a special case, when we need to add folder with files to the root of the apk. It is used not by us but is needed to be there. Gradle build copies those folders from jar to the root of the apk, how to do it using ninja build. Should I add extra script and maybe add the folder before zipping and signing. Anyway I can not find the way to do it. Please help.

 

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/c766420b-17e4-408d-a3a8-54e17aaf50ea%40chromium.org.

ayde...@gmail.com

unread,
Dec 12, 2017, 1:18:24 PM12/12/17
to Chromium-dev
Sorry for delay. Your solution worked fine. Thank you very much!

четверг, 23 ноября 2017 г., 12:13:04 UTC+3 пользователь Mikhail Lopatkin написал:
Reply all
Reply to author
Forward
0 new messages