예제 #1
0
        private bool LoadConfig(string configPath)
        {
            _curConfigPath = configPath;
            _curConfig     = QuickBuild.LoadConfig(configPath);

            return(_curConfig != null);
        }
예제 #2
0
        public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
        {
            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(pathToBuiltProject);

            // 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)
            {
                UnityEngine.Debug.Log("ProjMod File: " + file);
                project.ApplyMod(file);
            }

            // Finally save the xcode project
            project.Save();

            if (QuickBuild.ExportIPA)
            {
                QuickBuild.ExportLastBuildIpa();
            }
        }
예제 #3
0
        void OnGUI()
        {
            if (_curConfig == null)
            {
                return;
            }

            _buildAction = null;
            _errorText   = null;

            GUI.enabled = !_curConfig.IsLock;

            EditorHelper.VecticalLayout(() =>
            {
                EditorGUI.BeginChangeCheck();

                DrawDefineList(_curConfig.DefineList, ref _objectScrollPosition);

                EditorHelper.SpaceLayout(3);

                DrawProductInfo();

                DrawBuildOptions();

                GUI.enabled = true;

                DrawLocker();

                CheckEditorChange();

                if (_hasDirtyFlag)
                {
                    DrawSaveButton();
                }
                else
                {
                    DrawOutputFolder();

                    DrawConfigManage();

                    DrawBuildButton();
                }


                EditorHelper.SpaceLayout(1);

                GUIHelper.DrawButton("Apply Define Symbol", () => { QuickBuild.ApplyDefineSymbol(_curConfig); },
                                     Color.white, -1, 50);

                DrawErrorInfo();
            });

            // Execute build action at last progress due to avoid some OnGUI error
            if (_buildAction != null)
            {
                _buildAction();
            }
        }
예제 #4
0
 private void DrawConfigList()
 {
     foreach (var path in QuickBuild.GetAllConfigPathList())
     {
         if (path != _curConfigPath)
         {
             GUIHelper.DrawButton(string.Format("Load '{0}'", path), () => { LoadConfig(path); }, Color.white);
         }
     }
 }
예제 #5
0
        private void Setup()
        {
            // Load default config
            if (!LoadConfig(DefaultConfigPath))
            {
                // Create default config
                QuickBuild.CreateConfig(DefaultConfigPath);

                LoadConfig(DefaultConfigPath);
            }
        }
예제 #6
0
        private void DrawDefineList(List <BuildConfig.DefineSymbol> list, ref Vector2 scrollPos)
        {
            EditorGUILayout.LabelField("Define Symbol List");

            EditorGUILayout.BeginVertical();

            // Display list
            scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandHeight(false));

            for (int i = 0; i < list.Count; i++)
            {
                DrawItem(list[i]);
            }

            EditorGUILayout.EndScrollView();

            GUIHelper.DrawButton("New Define", () =>
            {
                BuildConfig.DefineSymbol newSymbol = new BuildConfig.DefineSymbol();
                AddDefineSymbolWizard.DisplayWizard(newSymbol, () =>
                {
                    // Check duplicate
                    if (_curConfig.DefineList.Find(i => i.Name == newSymbol.Name) != null)
                    {
                        return;
                    }

                    _curConfig.DefineList.Add(newSymbol);
                    _dataChanged = true;
                });
            }, Color.white);

            GUIHelper.DrawButton("Sync Define Symbols", () =>
            {
                if (QuickBuild.SyncAllDefineSymbols())
                {
                    _dataChanged = true;
                }
            }, Color.white);

            EditorGUILayout.EndVertical();

            DeletePendingDefineItem();
        }
예제 #7
0
        private void DrawBuildButton()
        {
            EditorHelper.HorizontalLayout(() =>
            {
                GUIHelper.DrawButton("BuildWin64",
                                     () => { _buildAction = () => { QuickBuild.BuildWin(_curConfig, _buildComment); }; }, Color.green);

                GUIHelper.DrawButton("BuildAndroid",
                                     () => { _buildAction = () => { QuickBuild.BuildAndroid(_curConfig, _buildComment); }; },
                                     Color.green);

                GUIHelper.DrawButton("BuildIOS",
                                     () => { _buildAction = () => { QuickBuild.BuildIOS(_curConfig, _buildComment); }; }, Color.green);
            });

            EditorHelper.HorizontalLayout(() =>
            {
                EditorGUILayout.LabelField("ExportIPA: ", GUILayout.Width(70));
                QuickBuild.ExportIPA = EditorGUILayout.Toggle(QuickBuild.ExportIPA, GUILayout.Width(30));

                _buildComment = EditorHelper.DrawStringField("BuildComment", _buildComment, 120);
            });
        }
예제 #8
0
        private void DrawConfigManage()
        {
            // Set path text front
            var boldtext = new GUIStyle(GUI.skin.label)
            {
                fontStyle = FontStyle.Bold,
                fontSize  = 15
            };

            EditorGUILayout.LabelField(string.Format("Current config path : {0}", _curConfigPath), boldtext,
                                       GUILayout.Height(25));

            // Create new config button
            GUIHelper.DrawButton("New Config", () =>
            {
                NewConfigWizard.DisplayWizard((configName) =>
                {
                    var newConfigPath = string.Format("{0}{1}.asset", QuickBuild.ConfigFolder, configName);
                    QuickBuild.CreateConfig(newConfigPath);
                    LoadConfig(newConfigPath);
                });
            }, Color.blue);

            // Save current config as new
            GUIHelper.DrawButton("Save as New..", () =>
            {
                NewConfigWizard.DisplayWizard((configName) =>
                {
                    string newConfigPath = string.Format("{0}{1}.asset", QuickBuild.ConfigFolder, configName);
                    QuickBuild.CreateConfig(newConfigPath, _curConfig);
                    LoadConfig(newConfigPath);
                });
            }, Color.blue);

            DrawConfigList();
        }
예제 #9
0
        public static string GetCustomPackName()
        {
            string customPackName = QuickBuild.FindParam("CustomPackName");

            return(customPackName);
        }
예제 #10
0
        public static bool IsCustomPackName()
        {
            bool isCustomPackName = Boolean.Parse(QuickBuild.FindParam("IsCustomPackName"));

            return(isCustomPackName);
        }
예제 #11
0
        public static bool EnableDevBuild()
        {
            bool enableDevBuild = Boolean.Parse(QuickBuild.FindParam("EnableDevelopBuild"));

            return(enableDevBuild);
        }