From 29639ea0a8616d6130df433c7df35627d6015eb1 Mon Sep 17 00:00:00 2001 From: Harrison Hough Date: Tue, 9 Jan 2024 06:46:58 +0200 Subject: [PATCH 1/6] fix: remove editor conditional --- Editor/AndroidBuildProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Editor/AndroidBuildProcessor.cs b/Editor/AndroidBuildProcessor.cs index 85f635c..a9e06e7 100644 --- a/Editor/AndroidBuildProcessor.cs +++ b/Editor/AndroidBuildProcessor.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && !RPM_DISABLE_WEBVIEW_PERMISSIONS +#if !RPM_DISABLE_WEBVIEW_PERMISSIONS using System.IO; using System.Xml; using UnityEditor; From 824bf9e2a8cad5a7420f6a473f3accc9b6aa3052 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 9 Jan 2024 06:49:53 +0200 Subject: [PATCH 2/6] chore: update version --- .github/latest.md | 3 +-- CHANGELOG.md | 7 ++++++- package.json | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/latest.md b/.github/latest.md index 748f84b..97afc61 100644 --- a/.github/latest.md +++ b/.github/latest.md @@ -2,5 +2,4 @@ This release adds support for handling account linking and asset unlock events c ## Changelog -- scripting define symbol `RPM_DISABLE_WEBVIEW_PERMISSIONS` can now be used to disable Android permissions override @harrisonhough in [#26](https://github.com/readyplayerme/rpm-unity-sdk-webview/pull/26) - +- fixed a flaw in the logic for disabling android build processor diff --git a/CHANGELOG.md b/CHANGELOG.md index db08e77..c3c2d3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [2.1.0] - 2024.04.01 +## [2.1.1] - 2024.09.01 + +### Fixed +- fixed a flaw in the logic for disabling android build processor + +## [2.1.0] - 2024.08.01 ### Added - scripting define symbol `RPM_DISABLE_WEBVIEW_PERMISSIONS` can now be used to disable Android permissions override @harrisonhough in [#26](https://github.com/readyplayerme/rpm-unity-sdk-webview/pull/26) diff --git a/package.json b/package.json index 83fad81..a482cb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.readyplayerme.webview", - "version": "2.1.0", + "version": "2.1.1", "displayName": "Ready Player Me WebView", "description": "Ready Player Me WebView helps you display an in-engine browser that helps you load RPM website where you can create avatars and receive avatar URL at the end of the process.\nWebView is mobile only and works in Android and IOS builds.", "category": "tool", From f4a542e569857e2202f051f17283ede61a7141aa Mon Sep 17 00:00:00 2001 From: Harrison Hough Date: Tue, 9 Jan 2024 09:55:23 +0200 Subject: [PATCH 3/6] fix: fixes for editor scripts --- Editor/AndroidBuildProcessor.cs | 4 ++-- Editor/WebViewEditor.cs | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Editor/AndroidBuildProcessor.cs b/Editor/AndroidBuildProcessor.cs index a9e06e7..9c46461 100644 --- a/Editor/AndroidBuildProcessor.cs +++ b/Editor/AndroidBuildProcessor.cs @@ -1,4 +1,4 @@ -#if !RPM_DISABLE_WEBVIEW_PERMISSIONS +#if UNITY_ANDROID && !RPM_DISABLE_WEBVIEW_PERMISSIONS using System.IO; using System.Xml; using UnityEditor; @@ -6,7 +6,7 @@ using UnityEditor.Android; using UnityEditor.Callbacks; -namespace ReadyPlayerMe.WebView +namespace ReadyPlayerMe.WebView.Editor { /// /// Receives a callback after the Android Gradle project is generated, diff --git a/Editor/WebViewEditor.cs b/Editor/WebViewEditor.cs index 339153e..0cba95d 100644 --- a/Editor/WebViewEditor.cs +++ b/Editor/WebViewEditor.cs @@ -1,10 +1,9 @@ -#if UNITY_EDITOR using UnityEditor; using UnityEngine; -namespace ReadyPlayerMe.WebView +namespace ReadyPlayerMe.WebView.Editor { - public class WebViewEditor : Editor + public class WebViewEditor : UnityEditor.Editor { private const string WEB_VIEW_CANVAS_FILE_NAME = "WebView Canvas"; @@ -22,4 +21,3 @@ private static void LoadWebViewCanvas() } } } -#endif From ff8c5b6dd8d36c37cc45c389dbfe725041367c28 Mon Sep 17 00:00:00 2001 From: Harrison Hough Date: Tue, 9 Jan 2024 09:55:35 +0200 Subject: [PATCH 4/6] chore: readded ios post processor --- Editor/IOSBuildProcessor.cs | 24 ++++++++++++++++++++++++ Editor/IOSBuildProcessor.cs.meta | 11 +++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Editor/IOSBuildProcessor.cs create mode 100644 Editor/IOSBuildProcessor.cs.meta diff --git a/Editor/IOSBuildProcessor.cs b/Editor/IOSBuildProcessor.cs new file mode 100644 index 0000000..d295cf8 --- /dev/null +++ b/Editor/IOSBuildProcessor.cs @@ -0,0 +1,24 @@ +#if UNITY_IOS +using System.IO; +using UnityEditor; +using UnityEngine; +using UnityEditor.Callbacks; + +namespace ReadyPlayerMe.WebView.Editor +{ + public class IOSBuildProcessor + { + + [PostProcessBuildAttribute(100)] + public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) + { + if (BuildTarget.iOS != target) return; + var projectPath = $"{pathToBuiltProject}/Unity-iPhone.xcodeproj/project.pbxproj"; + PBXProject proj = new PBXProject(); + proj.ReadFromString(File.ReadAllText(projectPath)); + proj.AddFrameworkToProject(proj.TargetGuidByName("Unity-iPhone"), "WebKit.framework", false); + File.WriteAllText(projectPath, proj.WriteToString()); + } + } +} +#endif diff --git a/Editor/IOSBuildProcessor.cs.meta b/Editor/IOSBuildProcessor.cs.meta new file mode 100644 index 0000000..2b3ffb3 --- /dev/null +++ b/Editor/IOSBuildProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7815194cc95d1184b87a3c5afa9863eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 6ef421ca15b624c2b5422d42d484b5d1dd7e8453 Mon Sep 17 00:00:00 2001 From: Harrison Hough Date: Tue, 9 Jan 2024 10:01:35 +0200 Subject: [PATCH 5/6] chore: added assembly def to fix build errors --- Editor/ReadyPlayerMe.WebView.Editor.asmdef | 16 ++++++++++++++++ Editor/ReadyPlayerMe.WebView.Editor.asmdef.meta | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 Editor/ReadyPlayerMe.WebView.Editor.asmdef create mode 100644 Editor/ReadyPlayerMe.WebView.Editor.asmdef.meta diff --git a/Editor/ReadyPlayerMe.WebView.Editor.asmdef b/Editor/ReadyPlayerMe.WebView.Editor.asmdef new file mode 100644 index 0000000..bfd30a1 --- /dev/null +++ b/Editor/ReadyPlayerMe.WebView.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "ReadyPlayerMe.WebView.Editor", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Editor/ReadyPlayerMe.WebView.Editor.asmdef.meta b/Editor/ReadyPlayerMe.WebView.Editor.asmdef.meta new file mode 100644 index 0000000..199bfa7 --- /dev/null +++ b/Editor/ReadyPlayerMe.WebView.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cd6e68b4e29a75641843da0d43ce8a9e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From a797a9314575cf739d679e6f161679ffbb458586 Mon Sep 17 00:00:00 2001 From: Harrison Hough Date: Tue, 9 Jan 2024 10:05:49 +0200 Subject: [PATCH 6/6] chore: update changelog --- .github/latest.md | 1 + CHANGELOG.md | 1 + Editor/IOSBuildProcessor.cs | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/latest.md b/.github/latest.md index 97afc61..7ab5771 100644 --- a/.github/latest.md +++ b/.github/latest.md @@ -3,3 +3,4 @@ This release adds support for handling account linking and asset unlock events c ## Changelog - fixed a flaw in the logic for disabling android build processor +- an error causing android builds to fail \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c3c2d3f..03d7244 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - fixed a flaw in the logic for disabling android build processor +- an error causing android builds to fail ## [2.1.0] - 2024.08.01 diff --git a/Editor/IOSBuildProcessor.cs b/Editor/IOSBuildProcessor.cs index d295cf8..c0f6923 100644 --- a/Editor/IOSBuildProcessor.cs +++ b/Editor/IOSBuildProcessor.cs @@ -8,7 +8,6 @@ namespace ReadyPlayerMe.WebView.Editor { public class IOSBuildProcessor { - [PostProcessBuildAttribute(100)] public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) {