1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Add support for adding extra Android assets

This commit is contained in:
hogliux 2017-02-17 09:34:16 +00:00
parent 9593557aa7
commit 2e0e984145
2 changed files with 14 additions and 1 deletions

View file

@ -88,7 +88,7 @@ public:
//==============================================================================
CachedValue<String> androidScreenOrientation, androidActivityClass, androidActivitySubClassName,
androidVersionCode, androidMinimumSDK, androidTheme,
androidSharedLibraries, androidStaticLibraries;
androidSharedLibraries, androidStaticLibraries, androidExtraAssetsFolder;
CachedValue<bool> androidInternetNeeded, androidMicNeeded, androidBluetoothNeeded;
CachedValue<String> 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<String> (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.");
}
//==============================================================================

View file

@ -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);