From d8578d6c6fcb23b66d925e363aeb20cbe88f90fc Mon Sep 17 00:00:00 2001 From: Fuling Date: Sun, 22 Sep 2019 11:35:32 +0800 Subject: [PATCH] update build.cs update build.cs for android, in unity 2019.2 or older, we can omit the step of open build.gradle of UnityExport module and remove bundle code --- example/unity/DemoApp/Assets/Editor/Build.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/example/unity/DemoApp/Assets/Editor/Build.cs b/example/unity/DemoApp/Assets/Editor/Build.cs index 281d5c8..5f7cded 100644 --- a/example/unity/DemoApp/Assets/Editor/Build.cs +++ b/example/unity/DemoApp/Assets/Editor/Build.cs @@ -58,6 +58,9 @@ public class Build : MonoBehaviour var build_file = Path.Combine(androidExportPath, "build.gradle"); var build_text = File.ReadAllText(build_file); build_text = build_text.Replace("com.android.application", "com.android.library"); + build_text = build_text.Replace("bundle {", "splits {"); + build_text = build_text.Replace("enableSplit = false", "enable false"); + build_text = build_text.Replace("enableSplit = true", "enable true"); build_text = build_text.Replace("implementation fileTree(dir: 'libs', include: ['*.jar'])", "implementation project(':unity-classes')"); build_text = Regex.Replace(build_text, @"\n.*applicationId '.+'.*\n", "\n"); File.WriteAllText(build_file, build_text); @@ -116,4 +119,4 @@ public class Build : MonoBehaviour return scenes; } -} \ No newline at end of file +}