Skip to content

Commit 1ecf8b6

Browse files
authored
Update Buildscript (#138)
• Updates preprocessor checks on the iOS build script to increment the version • The PBXProject.GetFrameworksBuildPhaseTarget() function the script uses to get the framework GUID which is used to update the .xcodeproj, to link the correct frameworks
1 parent 18069c5 commit 1ecf8b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

OneSignalExample/Assets/OneSignal/Editor/PostProcessBuildPlayer_iOS.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using UnityEditor.iOS.Xcode;
1212
using System.Text;
1313

14-
#if UNITY_2017_1_OR_NEWER
14+
#if UNITY_2017_2_OR_NEWER
1515
using UnityEditor.iOS.Xcode.Extensions;
1616
#endif
1717

@@ -35,7 +35,7 @@ public static void OnPostProcessBuild(BuildTarget target, string path)
3535
// UserNotifications.framework is required by libOneSignal.a
3636
project.AddFrameworkToProject(targetGUID, "UserNotifications.framework", false);
3737

38-
#if UNITY_2017_1_OR_NEWER && !UNITY_CLOUD_BUILD
38+
#if UNITY_2017_2_OR_NEWER && !UNITY_CLOUD_BUILD
3939

4040
var extensionTargetName = "OneSignalNotificationServiceExtension";
4141
var pathToNotificationService = path + "/" + extensionTargetName;
@@ -123,7 +123,7 @@ public static void OnPostProcessBuild(BuildTarget target, string path)
123123
File.WriteAllText(projectPath, project.WriteToString());
124124
}
125125

126-
#if UNITY_2017_1_OR_NEWER && !UNITY_CLOUD_BUILD
126+
#if UNITY_2017_2_OR_NEWER && !UNITY_CLOUD_BUILD
127127

128128
// This function takes a static framework that is already linked to a different target in the project and links it to the specified target
129129
public static void InsertStaticFrameworkIntoTargetBuildPhaseFrameworks(string staticFrameworkName, string frameworkGuid, string target, ref string contents, PBXProject project) {
@@ -152,7 +152,7 @@ public static void InsertStaticFrameworkIntoTargetBuildPhaseFrameworks(string st
152152
//add the framework as an additional object in PBXBuildFile objects
153153
contents = contents.Replace("; fileRef = " + fileRef + " /* " + staticFrameworkName + ".a */; };", "; fileRef = " + fileRef + " /* " + staticFrameworkName + ".a */; };\n\t\t" + frameworkGuid + " /* " + staticFrameworkName + ".a in Frameworks */ = {isa = PBXBuildFile; fileRef = " + fileRef + " /* " + staticFrameworkName + ".a */; };");
154154

155-
//fild the build phase ID number
155+
//find the build phase ID number
156156
string targetBuildPhaseId = project.GetFrameworksBuildPhaseByTarget(target);
157157
string[] components = contents.Split(new string[] { targetBuildPhaseId + " /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = " }, StringSplitOptions.None);
158158

0 commit comments

Comments
 (0)