Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new Unity build pipeline #138

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions source/Editor/PostBuildTriggerGA.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace UnityEditor.iOS.Xcode is define in "unityEditor.iOS.Extensions.xcode.dll" which is only installed when you also have IOSSupport playbackEngine installed. So you will want to add #if UNITY_IOS guards.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologies you're right. I will correct it asap.


public class PostBuildTriggerGA {

[PostProcessBuildAttribute(1)]
public static void OnPostProcessBuild(BuildTarget target, string path)
{
Debug.Log( "GAv4 Unity: Post build script starts");
if (target == BuildTarget.iOS)
{

// Get target for Xcode project
string projPath = PBXProject.GetPBXProjectPath(path);
Debug.Log( "GAv4 Unity: Project path is " + projPath);

PBXProject proj = new PBXProject();
proj.ReadFromString(File.ReadAllText(projPath));

string targetName = PBXProject.GetUnityTargetName();
string projectTarget = proj.TargetGuidByName(targetName);

// Add dependencies
Debug.Log( "GAv4 Unity: Adding frameworks");

proj.AddFrameworkToProject(projectTarget, "AdSupport.framework", false);
proj.AddFrameworkToProject(projectTarget, "CoreData.framework", false);
proj.AddFrameworkToProject(projectTarget, "SystemConfiguration.framework", false);
proj.AddFrameworkToProject(projectTarget, "libz.dylib", false);
proj.AddFrameworkToProject(projectTarget, "libsqlite3.tbd", false);

File.WriteAllText(projPath, proj.WriteToString());

}
}
}
11 changes: 0 additions & 11 deletions source/Editor/PostprocessBuildPlayer

This file was deleted.