mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Force ZIM_FILE_SIZE literal to be a long.
By default, literal numbers are `int`. If the size of a zim doesn't fit in a `int`, java will complains. By appending a `L` at the end of the literal number, java will interpret it as a `long` and will accept it.
This commit is contained in:
parent
06a41daae4
commit
e510b4bef2
@ -229,10 +229,10 @@ android {
|
||||
buildConfigField "String", "ZIM_FILE_NAME", "\"$filename\""
|
||||
if (project.hasProperty('zim_file_size')) {
|
||||
def length = Long.parseLong(project.property('zim_file_size'))
|
||||
buildConfigField "long", "ZIM_FILE_SIZE", "$length"
|
||||
buildConfigField "long", "ZIM_FILE_SIZE", "${length}L"
|
||||
} else {
|
||||
long length = sourceFile.length()
|
||||
buildConfigField "long", "ZIM_FILE_SIZE", "$length"
|
||||
buildConfigField "long", "ZIM_FILE_SIZE", "${length}L"
|
||||
}
|
||||
if (project.hasProperty('version_code')) {
|
||||
def version_code = project.property('version_code')
|
||||
|
@ -5,7 +5,7 @@ public class Constants {
|
||||
public static final String CUSTOM_APP_ID = "~package~";
|
||||
public static final boolean CUSTOM_APP_HAS_EMBEDDED_ZIM = ~embed_zim~;
|
||||
public static final String CUSTOM_APP_ZIM_FILE_NAME = "~zim_name~";
|
||||
public static final long CUSTOM_APP_ZIM_FILE_SIZE = ~zim_size~;
|
||||
public static final long CUSTOM_APP_ZIM_FILE_SIZE = ~zim_size~L;
|
||||
public static final String CUSTOM_APP_VERSION_NAME = "~version_name~";
|
||||
public static final int CUSTOM_APP_VERSION_CODE = ~version_code~;
|
||||
public static final int CUSTOM_APP_CONTENT_VERSION_CODE = ~content_version_code~;
|
||||
|
Loading…
x
Reference in New Issue
Block a user