File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3263,8 +3263,11 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
32633263 cmdline.push_back (apk_build_command);
32643264 }
32653265
3266+ String addons_directory = ProjectSettings::get_singleton ()->globalize_path (" res://addons" );
3267+
32663268 cmdline.push_back (" -p" ); // argument to specify the start directory.
32673269 cmdline.push_back (build_path); // start directory.
3270+ cmdline.push_back (" -Paddons_directory=" + addons_directory); // path to the addon directory as it may contain jar or aar dependencies
32683271 cmdline.push_back (" -Pexport_package_name=" + package_name); // argument to specify the package name.
32693272 cmdline.push_back (" -Pexport_version_code=" + version_code); // argument to specify the version code.
32703273 cmdline.push_back (" -Pexport_version_name=" + version_name); // argument to specify the version name.
Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ dependencies {
6363 implementation files(pluginsBinaries)
6464 }
6565
66+ // Automatically pick up local dependencies in res://addons
67+ String addonsDirectory = getAddonsDirectory()
68+ if (addonsDirectory != null && ! addonsDirectory. isBlank()) {
69+ implementation fileTree(dir : " $addonsDirectory " , include : [' *.jar' , ' *.aar' ])
70+ }
71+
6672 // .NET dependencies
6773 String jar = ' ../../../../modules/mono/thirdparty/libSystem.Security.Cryptography.Native.Android.jar'
6874 if (file(jar). exists()) {
Original file line number Diff line number Diff line change @@ -408,3 +408,8 @@ ext.shouldUseLegacyPackaging = { ->
408408 // Default behavior for minSdk >= 23
409409 return false
410410}
411+
412+ ext. getAddonsDirectory = { ->
413+ String addonsDirectory = project. hasProperty(" addons_directory" ) ? project. property(" addons_directory" ) : " "
414+ return addonsDirectory
415+ }
You can’t perform that action at this time.
0 commit comments