Gradle can build the majority of a custom app
@ -85,15 +85,43 @@ dependencies {
|
||||
buildConfigField "long", "ZIM_FILE_SIZE", "0"
|
||||
buildConfigField "int", "CONTENT_VERSION_CODE", "0"
|
||||
buildConfigField "String", "ENFORCED_LANG", "\"\""
|
||||
resValue "string", "app_name", "Kiwix"
|
||||
resValue "string", "app_search_string", "Search Kiwix"
|
||||
|
||||
}
|
||||
custom {
|
||||
applicationId "org.kiwix.kiwixcustomtest"
|
||||
if (project.hasProperty('jsonFile')) {
|
||||
def jsonFile = file(project.property('jsonFile'))
|
||||
def parsedJson = new groovy.json.JsonSlurper().parseText(jsonFile.text)
|
||||
applicationId "$parsedJson.package"
|
||||
buildConfigField "boolean", "IS_CUSTOM_APP", "true"
|
||||
buildConfigField "boolean", "HAS_EMBEDDED_ZIM", "$parsedJson.embed_zim"
|
||||
if (parsedJson.zim_file.lastIndexOf('/') >= 0) {
|
||||
buildConfigField "String", "ZIM_FILE_NAME", parsedJson.zim_file.substring(parsedJson.zim_file.lastIndexOf('/'))
|
||||
} else {
|
||||
buildConfigField "String", "ZIM_FILE_NAME", "\"$parsedJson.zim_file\""
|
||||
}
|
||||
File file = new File(parsedJson.zim_file)
|
||||
long length = file.length()
|
||||
buildConfigField "long", "ZIM_FILE_SIZE", "$length"
|
||||
if (parsedJson.content_version_code != null) {
|
||||
buildConfigField "int", "CONTENT_VERSION_CODE", "$parsedJson.content_version_code"
|
||||
} else {
|
||||
buildConfigField "int", "CONTENT_VERSION_CODE", "$parsedJson.version_code"
|
||||
}
|
||||
buildConfigField "String", "ENFORCED_LANG", "\"$parsedJson.enforced_lang\""
|
||||
resValue "string", "app_name", "$parsedJson.app_name"
|
||||
resValue "string", "app_search_string", 'Search ' + "$parsedJson.app_name"
|
||||
} else {
|
||||
buildConfigField "boolean", "IS_CUSTOM_APP", "false"
|
||||
buildConfigField "boolean", "HAS_EMBEDDED_ZIM", "false"
|
||||
buildConfigField "String", "ZIM_FILE_NAME", "\"\""
|
||||
buildConfigField "long", "ZIM_FILE_SIZE", "0"
|
||||
buildConfigField "int", "CONTENT_VERSION_CODE", "0"
|
||||
buildConfigField "String", "ENFORCED_LANG", "\"\""
|
||||
resValue "string", "app_name", "Custom"
|
||||
resValue "string", "app_search_string", "Search Custom"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
5
app/src/custom/AndroidManifest.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-permission android:name="android.permission.INTERNET" tools:node="remove"/>
|
||||
</manifest>
|
BIN
app/src/custom/res/drawable-hdpi/ic_kiwix_widget.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
app/src/custom/res/drawable-mdpi/ic_kiwix_widget.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
app/src/custom/res/drawable-xhdpi/ic_kiwix_widget.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
app/src/custom/res/drawable-xxhdpi/ic_kiwix_widget.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/custom/res/drawable-xxxhdpi/ic_kiwix_widget.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
app/src/custom/res/drawable/kiwix_icon_with_title.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
app/src/custom/res/mipmap-hdpi/kiwix_icon.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
app/src/custom/res/mipmap-mdpi/kiwix_icon.png
Executable file
After Width: | Height: | Size: 6.8 KiB |
BIN
app/src/custom/res/mipmap-xhdpi/kiwix_icon.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
app/src/custom/res/mipmap-xxhdpi/kiwix_icon.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/custom/res/mipmap-xxxhdpi/kiwix_icon.png
Normal file
After Width: | Height: | Size: 22 KiB |
@ -1,5 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<resources>
|
||||
<string name="app_name">Kiwix</string>
|
||||
<string name="app_search_string">Search Kiwix</string>
|
||||
</resources>
|