본문 바로가기
낙서장

젠킨스 맥버전 스크립트 파일

by violetoz 2014. 6. 30.




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(SCENESBUILD_TARGET_PATHBuildTarget.iPhoneopt);
    }

    private static string[] FindEnabledEditorScenes()
    {
        List<stringEditorScenes = new List<string>();
        foreach(EditorBuildSettingsScene scene in EditorBuildSettings.scenes)
        {
            if(!scene.enabledcontinue;
            EditorScenes.Add(scene.path);
        }

        return EditorScenes.ToArray();
    }

    static void GenericBuild(string[] scenesstring target_pathBuildTarget build_targetBuildOptions build_options)
    {
        EditorUserBuildSettings.SwitchActiveBuildTarget(build_target);
        string res = BuildPipeline.BuildPlayer(scenestarget_pathbuild_targetbuild_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