diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h index a62fa82efb..df61df31a9 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h @@ -88,7 +88,7 @@ public: //============================================================================== CachedValue androidScreenOrientation, androidActivityClass, androidActivitySubClassName, androidVersionCode, androidMinimumSDK, androidTheme, - androidSharedLibraries, androidStaticLibraries; + androidSharedLibraries, androidStaticLibraries, androidExtraAssetsFolder; CachedValue androidInternetNeeded, androidMicNeeded, androidBluetoothNeeded; CachedValue androidOtherPermissions; @@ -108,6 +108,7 @@ public: androidTheme (settings, Ids::androidTheme, nullptr), androidSharedLibraries (settings, Ids::androidSharedLibraries, nullptr, ""), androidStaticLibraries (settings, Ids::androidStaticLibraries, nullptr, ""), + androidExtraAssetsFolder (settings, Ids::androidExtraAssetsFolder, nullptr, ""), androidInternetNeeded (settings, Ids::androidInternetNeeded, nullptr, true), androidMicNeeded (settings, Ids::microphonePermissionNeeded, nullptr, false), androidBluetoothNeeded (settings, Ids::androidBluetoothNeeded, nullptr, true), @@ -216,6 +217,14 @@ public: } writeCmakeFile (appFolder.getChildFile ("CMakeLists.txt")); + + File extraAssets (getProject().getFile().getParentDirectory().getChildFile(androidExtraAssetsFolder.get())); + if (extraAssets.exists() && extraAssets.isDirectory()) + { + const File assetsFolder (appFolder.getChildFile ("src/main/assets")); + if (assetsFolder.deleteRecursively()) + extraAssets.copyDirectoryTo (assetsFolder); + } } void removeOldFiles (const File& targetFolder) const @@ -697,6 +706,9 @@ private: props.add (new TextWithDefaultPropertyComponent (androidMinimumSDK, "Minimum SDK version", 32), "The number of the minimum version of the Android SDK that the app requires"); + + props.add (new TextPropertyComponent (androidExtraAssetsFolder.getPropertyAsValue(), "Extra Android Assets", 256, false), + "A path to a folder (relative to the project folder) which conatins extra android assets."); } //============================================================================== diff --git a/extras/Projucer/Source/Utility/jucer_PresetIDs.h b/extras/Projucer/Source/Utility/jucer_PresetIDs.h index 31ef98eb45..40d0778fbb 100644 --- a/extras/Projucer/Source/Utility/jucer_PresetIDs.h +++ b/extras/Projucer/Source/Utility/jucer_PresetIDs.h @@ -167,6 +167,7 @@ namespace Ids DECLARE_ID (androidStaticLibraries); DECLARE_ID (androidSharedLibraries); DECLARE_ID (androidScreenOrientation); + DECLARE_ID (androidExtraAssetsFolder); DECLARE_ID (iosScreenOrientation); DECLARE_ID (iosInAppPurchases); DECLARE_ID (iosBackgroundAudio);