From 5e799b1a1c275b94adaa110e9f951fffe3f131ae Mon Sep 17 00:00:00 2001 From: nicloay Date: Thu, 30 Nov 2017 14:02:53 +0100 Subject: [PATCH] refactoring --- Assets/Appirater/{Test.meta => Demo.meta} | 0 .../AppiraterDemotScene.unity} | Bin .../AppiraterDemotScene.unity.meta} | 0 Assets/Appirater/{Test => Demo}/MainController.cs | 0 .../{Test => Demo}/MainController.cs.meta | 0 .../Appirater/NativeLocale/Editor/PostProcess.cs | 14 +++++--------- 6 files changed, 5 insertions(+), 9 deletions(-) rename Assets/Appirater/{Test.meta => Demo.meta} (100%) rename Assets/Appirater/{Test/AppiraterTestScene.unity => Demo/AppiraterDemotScene.unity} (100%) rename Assets/Appirater/{Test/AppiraterTestScene.unity.meta => Demo/AppiraterDemotScene.unity.meta} (100%) rename Assets/Appirater/{Test => Demo}/MainController.cs (100%) rename Assets/Appirater/{Test => Demo}/MainController.cs.meta (100%) diff --git a/Assets/Appirater/Test.meta b/Assets/Appirater/Demo.meta similarity index 100% rename from Assets/Appirater/Test.meta rename to Assets/Appirater/Demo.meta diff --git a/Assets/Appirater/Test/AppiraterTestScene.unity b/Assets/Appirater/Demo/AppiraterDemotScene.unity similarity index 100% rename from Assets/Appirater/Test/AppiraterTestScene.unity rename to Assets/Appirater/Demo/AppiraterDemotScene.unity diff --git a/Assets/Appirater/Test/AppiraterTestScene.unity.meta b/Assets/Appirater/Demo/AppiraterDemotScene.unity.meta similarity index 100% rename from Assets/Appirater/Test/AppiraterTestScene.unity.meta rename to Assets/Appirater/Demo/AppiraterDemotScene.unity.meta diff --git a/Assets/Appirater/Test/MainController.cs b/Assets/Appirater/Demo/MainController.cs similarity index 100% rename from Assets/Appirater/Test/MainController.cs rename to Assets/Appirater/Demo/MainController.cs diff --git a/Assets/Appirater/Test/MainController.cs.meta b/Assets/Appirater/Demo/MainController.cs.meta similarity index 100% rename from Assets/Appirater/Test/MainController.cs.meta rename to Assets/Appirater/Demo/MainController.cs.meta diff --git a/Assets/Appirater/NativeLocale/Editor/PostProcess.cs b/Assets/Appirater/NativeLocale/Editor/PostProcess.cs index 4fe5392..6ebd262 100644 --- a/Assets/Appirater/NativeLocale/Editor/PostProcess.cs +++ b/Assets/Appirater/NativeLocale/Editor/PostProcess.cs @@ -6,6 +6,9 @@ public class PostProcess: MonoBehaviour { + private const string PluginHome = "Appirater/iOS"; + private const string SoreKitFramework = "StoreKit.framework"; + [PostProcessBuildAttribute(9999)] public static void OnPostProcessBuild(BuildTarget target, string path) { @@ -17,23 +20,16 @@ public static void OnPostProcessBuild(BuildTarget target, string path) private static void OnIOSBuild(BuildTarget target, string path) { - NativeLocale.AddLocalizedStringsIOS(path, Path.Combine(Application.dataPath, "Appirater/iOS")); + NativeLocale.AddLocalizedStringsIOS(path, Path.Combine(Application.dataPath, PluginHome)); AddStoreKitFramework(path); } - - private const string SoreKitFramework = "StoreKit.framework"; + private static void AddStoreKitFramework(string projectPath) { string projPath = projectPath + "/Unity-iPhone.xcodeproj/project.pbxproj"; PBXProject proj = new PBXProject(); proj.ReadFromFile(projPath); - -// if (!proj.ContainsFramework(proj.ProjectGuid(), SoreKitFramework)) -// { -// proj.AddFrameworkToProject(proj.ProjectGuid(), SoreKitFramework, false); -// } - foreach (string targetName in new string[] {PBXProject.GetUnityTargetName(), PBXProject.GetUnityTestTargetName()}) {