Esempio n. 1
0
        public static void ExportForiOS(ProjectBuildData data)
        {
            if (Directory.Exists(BuildPaths.ProjectPath))
            {
                Directory.Delete(BuildPaths.ProjectPath, true);
            }

            if (data.ScriptingImpl == ScriptingImpl.Mono2x)
            {
                BuildForiOSBaseOnMono();
            }
            else
            {
                if (data.Architecture == ArchitectureType.ARM64)
                {
                    BuildForiOSBaseOnIL2CPP64();
                }
                else
                {
                    BuildForiOSBaseOnIL2CPP32_64();
                }
            }

            XCodePostProcess.OnPostProcessBuild(BuildTarget.iOS, BuildPaths.ProjectPath, data.Channel, data);
        }
        private static void OverWriteInfoPlist(ProjectBasicConfig config, string xcodeProjectPath, ProjectBuildData data)
        {
            XCPlist plist = new XCPlist(xcodeProjectPath + "Info.plist");

            Dictionary <string, object> configItems = new Dictionary <string, object>
            {
                { XCPlist.CFBundleDisplayName, config.DisplayName },
                { XCPlist.CFBundleShortVersionString, data.IdentityVersion },
                { XCPlist.CFBundleVersion, data.IdentityBuild }
            };

            plist.OverWriteItems(configItems);
        }
        public static void OnPostProcessBuild(BuildTarget target, string xcodeProjectPath, PackageChannel channel, ProjectBuildData data)
        {
            if (target != BuildTarget.iOS)
            {
                Debug.LogWarning("Target is not iPhone. XCodePostProcess will not run");
                return;
            }

            // Create a new project object from build target
            XCProject project = new XCProject(xcodeProjectPath + "Unity-iPhone.xcodeproj");

            // Find and run through all projmods files to patch the project.
            // Please pay attention that ALL projmods files in your project folder will be excuted!
            string[] files = Directory.GetFiles(Application.dataPath, "*.projmods", SearchOption.AllDirectories);

            foreach (string file in files)
            {
                Debug.Log("ProjMod File: " + file);
                project.ApplyMod(file);
            }

            ProjectBasicConfig config = new ProjectBasicConfigLoader().GetConfig(channel);

            OverWriteBuildSetting(config, project);

            OverWriteInfoPlist(config, xcodeProjectPath, data);

            project.overwriteBuildSetting("ENABLE_BITCODE", "NO");

            // Finally save the xcode project
            project.Save();
        }
Esempio n. 4
0
        public static void BuildForiOS(ProjectBuildData data)
        {
            ExportForiOS(data);

            BuildiOSPorject();
        }