Replace the android.defaultConfig.applicationId in build.gradle with the package/unique_name.
This commit is contained in:
parent
edf2ed5e50
commit
50ab6decfe
@ -1984,10 +1984,13 @@ public:
|
|||||||
|
|
||||||
build_command = build_path.plus_file(build_command);
|
build_command = build_path.plus_file(build_command);
|
||||||
|
|
||||||
|
String package_name = get_package_name(p_preset->get("package/unique_name"));
|
||||||
|
|
||||||
List<String> cmdline;
|
List<String> cmdline;
|
||||||
cmdline.push_back("build");
|
cmdline.push_back("build");
|
||||||
cmdline.push_back("-p");
|
cmdline.push_back("-Pexport_package_name=" + package_name); // argument to specify the package name.
|
||||||
cmdline.push_back(build_path);
|
cmdline.push_back("-p"); // argument to specify the start directory.
|
||||||
|
cmdline.push_back(build_path); // start directory.
|
||||||
/*{ used for debug
|
/*{ used for debug
|
||||||
int ec;
|
int ec;
|
||||||
String pipe;
|
String pipe;
|
||||||
|
@ -51,7 +51,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// Feel free to modify the application id to your own.
|
// Feel free to modify the application id to your own.
|
||||||
applicationId "com.godot.game"
|
applicationId getExportPackageName()
|
||||||
minSdkVersion versions.minSdk
|
minSdkVersion versions.minSdk
|
||||||
targetSdkVersion versions.targetSdk
|
targetSdkVersion versions.targetSdk
|
||||||
//CHUNK_ANDROID_DEFAULTCONFIG_BEGIN
|
//CHUNK_ANDROID_DEFAULTCONFIG_BEGIN
|
||||||
|
@ -10,3 +10,13 @@ ext.versions = [
|
|||||||
ext.libraries = [
|
ext.libraries = [
|
||||||
androidGradlePlugin : "com.android.tools.build:gradle:$versions.androidGradlePlugin"
|
androidGradlePlugin : "com.android.tools.build:gradle:$versions.androidGradlePlugin"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
ext.getExportPackageName = { ->
|
||||||
|
// Retrieve the app id from the project property set by the Godot build command.
|
||||||
|
String appId = project.hasProperty("export_package_name") ? project.property("export_package_name") : ""
|
||||||
|
// Check if the app id is valid, otherwise use the default.
|
||||||
|
if (appId == null || appId.isEmpty()) {
|
||||||
|
appId = "com.godot.game"
|
||||||
|
}
|
||||||
|
return appId
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user