[ion] Android build: specify libepsilon libraries' name when building

the apk
This commit is contained in:
Émilie Feral
2020-03-24 14:13:43 +01:00
committed by Ecco
parent 62324b9cac
commit 43bf89c6e4
3 changed files with 10 additions and 7 deletions

View File

@@ -60,15 +60,15 @@ epsilon_apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mip
define rule_for_gradle
.PHONY: gradle_$1_$2
gradle_$1_$2: $$(epsilon_apk_deps) $$(patsubst %,$$(BUILD_DIR)/app/libs/%/libepsilon$2so,$(NDK_ABIS))
gradle_$1_$2.: $$(epsilon_apk_deps) $$(patsubst %,$$(BUILD_DIR)/app/libs/%/libepsilon$2.so,$(NDK_ABIS))
@echo "GRADLE ion/src/simulator/android/build.gradle"
$(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle $1
$(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) LIBEPSILON_NAME="epsilon$2" ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle $1
endef
$(eval $(call rule_for_gradle,assembleCodesigned,.))
$(eval $(call rule_for_gradle,assembleRelease,.))
$(eval $(call rule_for_gradle,assembleCodesigned,.official.))
$(eval $(call rule_for_gradle,assembleRelease,.official.))
$(eval $(call rule_for_gradle,assembleCodesigned,))
$(eval $(call rule_for_gradle,assembleRelease,))
$(eval $(call rule_for_gradle,assembleCodesigned,.official))
$(eval $(call rule_for_gradle,assembleRelease,.official))
DEFAULT = epsilon.apk

View File

@@ -58,6 +58,9 @@ android {
initWith buildTypes.release
signingConfig signingConfigs.environment
}
buildTypes.each {
it.buildConfigField "String", "LIBEPSILON_NAME", "\"${System.getenv('LIBEPSILON_NAME')}\""
}
}
sourceSets{
main {

View File

@@ -20,7 +20,7 @@ public class EpsilonActivity extends SDLActivity {
protected String[] getLibraries() {
return new String[] {
"epsilon"
BuildConfig.LIBEPSILON_NAME
};
}