public class ProjectBuilder
{
static string[] SCENES = FindEnabledEditorScenes();
static string TARGET_DIR = "test";
[MenuItem("Custom/CI/Build IOS")]
static void PerformIOSBuild()
{
BuildOptions opt = BuildOptions.SymlinkLibraries |
BuildOptions.Development |
BuildOptions.ConnectWithProfiler |
BuildOptions.AllowDebugging |
BuildOptions.Development |
BuildOptions.None;
PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK;
PlayerSettings.iOS.targetOSVersion = iOSTargetOSVersion.iOS_4_3;
PlayerSettings.statusBarHidden = true;
char sep = Path.DirectorySeparatorChar;
string buildDirectory = Path.GetFullPath(".") + sep + TARGET_DIR;
Directory.CreateDirectory(buildDirectory);
string BUILD_TARGET_PATH = buildDirectory + "/ios";
//string BUILD_TARGET_PATH = TARGET_DIR + "/ios";
Directory.CreateDirectory(BUILD_TARGET_PATH);
GenericBuild(SCENES, BUILD_TARGET_PATH, BuildTarget.iPhone, opt);
}
private static string[] FindEnabledEditorScenes()
{
List<string> EditorScenes = new List<string>();
foreach(EditorBuildSettingsScene scene in EditorBuildSettings.scenes)
{
if(!scene.enabled) continue;
EditorScenes.Add(scene.path);
}
return EditorScenes.ToArray();
}
static void GenericBuild(string[] scenes, string target_path, BuildTarget build_target, BuildOptions build_options)
{
EditorUserBuildSettings.SwitchActiveBuildTarget(build_target);
string res = BuildPipeline.BuildPlayer(scenes, target_path, build_target, build_options);
if(res.Length > 0)
{
throw new Exception("zzzzzzzzzzzzzzz ...BuildPlayer Failure: " + res);
}
}
}
'낙서장' 카테고리의 다른 글
휴대폰 이메일 동기화 (0) | 2014.04.10 |
---|---|
키보드 LED 개조 (0) | 2014.03.28 |
개발하는데 유용한 툴들 (0) | 2014.03.21 |
기본 css (0) | 2014.03.10 |
호선별 데이트장소 (0) | 2013.05.27 |