- Home /
Automate exclusion of specific Android plugin from build?
I am working on a project which makes use of several Android plugins for various purposes. The game will be deployed to several different marketplaces which have different requirements so somehow it would be useful if I could programmatically determine which plugins should be included at build time.
For instance, I would like to do the following:
Dynamically select which Android plugins should be included.
Dynamically select which manifest file should be used.
Here is some pseudo-code:
public static class CustomBuildProcess {
public enum BuildMode {
BuildForGooglePlay,
BuildForAmazonStore,
}
public static BuildMode CurrentMode { get; set; }
private static string[] FilterAndroidPlugins(string[] pluginFolderPaths) {
var paths = new List<string>(pluginFolderPaths);
switch (CurrentMode) {
case BuildMode.BuildForGooglePlay:
paths.Remove("Assets/Plugins/Android/Foo");
break;
case BuildMode.BuildForAmazonStore:
paths.Remove("Assets/Plugins/Android/Bar");
paths.Remove("Assets/Plugins/Android/Baz");
break;
}
}
private static string PickAndroidManifestPath() {
switch (CurrentMode) {
default:
// Just assume the standard one!
return "Assets/Plugins/Android/AndroidManifest.xml";
case BuildMode.BuildForAmazonStore:
// Need a specific manifest file for Amazon-specific plugin.
return "Assets/Plugins/Android/Alt/AmazonAndroidManifest.xml";
}
}
}
If you're using Unity Pro, you can use the BuildPipeline class (http://docs.unity3d.com/ScriptReference/BuildPipeline.html) to launch a build.
I am noew haveing similar problem with the new unity version 1018.3.02f personal. It wil sudenly not allow building on android if windowsForms.dll is included in a project. So , have you found a solution to exclude certain plugins from the build?
Your answer
Follow this Question
Related Questions
Fog not moving with camera on mobile build 0 Answers
Detect compilation errors in Editor script? 4 Answers
Unable to build to Android and iOS using BuildPipeline Failed to copy files 1 Answer
Object speed is much slower on iOS and Android build than on Editor 2 Answers
[Closed]How to Build and Deploy to the Android device from the script 1 Answer