Skip to content

Commit

Permalink
fixed to temporarily generate Assets/Plugins/Android/WebViewPlugin.aa…
Browse files Browse the repository at this point in the history
…r instead of Temp/StagingArea/aar/WebViewPlugin.aar. (gree#1028)
  • Loading branch information
KojiNakamaru authored Dec 23, 2023
1 parent 1235da5 commit ce53acc
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions plugins/Editor/UnityWebViewPostprocessBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ public void OnPreprocessBuild(BuildTarget buildTarget, string path) {
rel = "Assets/Plugins/Android/WebViewPlugin-release.aar.tmpl";
}
var src = (EditorUserBuildSettings.development) ? dev : rel;
Directory.CreateDirectory("Temp/StagingArea/aar");
File.Copy(src, "Temp/StagingArea/aar/WebViewPlugin.aar");
//Directory.CreateDirectory("Temp/StagingArea/aar");
//File.Copy(src, "Temp/StagingArea/aar/WebViewPlugin.aar");
Directory.CreateDirectory("Assets/Plugins/Android");
File.Copy(src, "Assets/Plugins/Android/WebViewPlugin.aar");
}
}

Expand Down Expand Up @@ -145,7 +147,17 @@ private string GetGradlePropertiesPath(string basePath) {

[PostProcessBuild(100)]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
#if !UNITY_2018_1_OR_NEWER
#if UNITY_2018_1_OR_NEWER
try {
File.Delete("Assets/Plugins/Android/WebViewPlugin.aar");
File.Delete("Assets/Plugins/Android/WebViewPlugin.aar.meta");
Directory.Delete("Assets/Plugins/Android");
File.Delete("Assets/Plugins/Android.meta");
Directory.Delete("Assets/Plugins");
File.Delete("Assets/Plugins.meta");
} catch (Exception) {
}
#else
if (buildTarget == BuildTarget.Android) {
string manifest = Path.Combine(Application.dataPath, "Plugins/Android/AndroidManifest.xml");
if (!File.Exists(manifest)) {
Expand Down

0 comments on commit ce53acc

Please sign in to comment.