Exemplo n.º 1
1
        public void ImportSettings(BuildType buildType)
        {
            using (new WurmAssistantGateway(AppContext.WaGatewayErrorMessage))
            {
                using (var tempDirMan = new TempDirManager())
                {
                    var tempDir = tempDirMan.GetHandle();
                    var dataDir = new DirectoryInfo(DataDirPath);

                    var tempBackupDir = new DirectoryInfo(Path.Combine(tempDir.FullName, dataDir.Name));
                    DirectoryEx.DirectoryCopyRecursive(dataDir.FullName, tempBackupDir.FullName);

                    try
                    {
                        dataDir.Delete(true);
                        var otherBuildDirPath = AppContext.GetDataDir(buildType);
                        DirectoryEx.DirectoryCopyRecursive(otherBuildDirPath, dataDir.FullName);
                    }
                    catch (Exception)
                    {
                        TransientHelper.Compensate(() => dataDir.Delete(true),
                            retryDelay: TimeSpan.FromSeconds(5));
                        TransientHelper.Compensate(() => DirectoryEx.DirectoryCopyRecursive(tempBackupDir.FullName, dataDir.FullName),
                            retryDelay: TimeSpan.FromSeconds(5));
                        throw;
                    }
                }
            }
        }
Exemplo n.º 2
1
        public WaUpdaterViewModel(BuildType buildType)
        {
            if (buildType == BuildType.Stable)
            {
                manager = new StableWaUpdateManager();
            }
            else if (buildType == BuildType.Beta)
            {
                manager = new BetaWaUpdateManager();
            }
            else
            {
                throw new LauncherException("Unknown build type");
            }

            Settings = App.PersistentFactory.Create<UpdaterSettings>("UpdaterSettings" + buildType);
            Settings.Data.PropertyChanged += (sender, args) =>
                Settings.RequireSave();
            Application.Current.Exit += (sender, args) =>
                Settings.Save();

            UpdateCommand = new AwaitableDelegateCommand(async () =>
            {
                try
                {
                    await manager.UpdateAsync();
                    NewVersionAvailable = false;
                    nextUpdateCheck = DateTime.Now;
                }
                catch (Exception exception)
                {
                    App.Logger.LogError("update error", this, exception);
                    ErrorManager.ShowWarning("update error: " + exception.Message, exception);
                }
                manager.StatusReset();
            }, () => !UpdateInProgress);

            ReinstallCommand = new AwaitableDelegateCommand(async () =>
            {
                try
                {
                    manager.StatusReset();
                    AvailabilityStatus = string.Empty;
                    await manager.UninstallAsync();
                    await UpdateCommand.ExecuteAsync(null);
                }
                catch (Exception exception)
                {
                    App.Logger.LogError("reinstall error", this, exception);
                    ErrorManager.ShowWarning("reinstall error: " + exception.Message, exception);
                }
            });

            manager.UpdateStatusChanged += (sender, args) =>
            {
                UpdateStatus = args.Status;
                UpdateInProgress = args.IsRunning;
                UpdateProgressIndeterminate = args.ProgressIndeterminate;
                UpdateProgress = args.Progress;
            };

            AvailabilityStatus = "Checking for updates...";

            timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };

            timer.Tick += async (s, a) =>
            {
                timer.Interval = TimeSpan.FromSeconds(10);

                if (!initialNewsLoad)
                {
                    initialNewsLoad = true;
                    RefreshWaNews();
                }

                Settings.Update();
                if (!UpdateInProgress && DateTime.Now > nextUpdateCheck)
                {
                    nextUpdateCheck = DateTime.Now + TimeSpan.FromHours(6);

                    try
                    {
                        CheckingVersion = true;
                        AvailabilityStatus = "Checking for updates...";
                        await CheckForNewVersion();
                        CheckingVersion = false;

                        if (newVersionAvailable)
                        {
                            RefreshWaNews();
                            manager.StatusReset();
                            AvailabilityStatus = string.Empty;
                            // run auto update if applicable
                            if (Settings.Data.NotifyOnNewVersion)
                            {
                                // todo show baloon, max once each 16 hours
                                if (DateTime.Now > nextUpdateReminder)
                                {
                                    var message = string.Format("New {0} Wurm Assistant version is available!", buildType);
                                    App.LauncherTaskbarIcon.ShowBalloonTip("Rejoice!", message, BalloonIcon.Info);
                                    nextUpdateReminder = DateTime.Now + TimeSpan.FromHours(16);
                                }
                            }
                            if (Settings.Data.AutoUpdate)
                            {
                                try
                                {
                                    await manager.UpdateAsync();
                                    NewVersionAvailable = false;
                                    nextUpdateCheck = DateTime.Now;
                                    var message =
                                        string.Format("{0} Wurm Assistant has just been updated to new version!",
                                            buildType);
                                    // show tray pop
                                    App.LauncherTaskbarIcon.ShowBalloonTip("Rejoice!", message, BalloonIcon.Info);
                                }
                                catch (Exception exception)
                                {
                                    // handle exceptions silently
                                    App.Logger.LogError("auto update failed, " + buildType, this, exception);
                                }
                                manager.StatusReset();
                            }
                        }
                        else
                        {
                            manager.StatusReset();
                            AvailabilityStatus = "WA-" + buildType + " is up to date";
                        }
                    }
                    catch (Exception exception)
                    {
                        App.Logger.LogError("Update error", this, exception);
                        AvailabilityStatus = "Error: " + exception.Message +
                            ". Try checking internet connection, firewall settings or restarting the launcher."
                            + " Version check will retry in 5 minutes.";
                        nextUpdateCheck = DateTime.Now + TimeSpan.FromMinutes(5);
                    }
                }
            };
        }
Exemplo n.º 3
0
        public WaLaunchViewModel(BuildType buildType)
        {
            if (buildType == BuildType.Stable)
            {
                manager = new StableWaLaunchManager();
            }
            else if (buildType == BuildType.Beta)
            {
                manager = new BetaWaLaunchManager();
            }
            else
            {
                throw new LauncherException("Unknown build type");
            }

            LaunchCommand = new DelegateCommand(() =>
            {
                try
                {
                    manager.Launch();
                }
                catch (Exception exception)
                {
                    ErrorManager.ShowWarning(exception.Message, exception);
                }
            });

            App.LauncherTaskbarIcon.ContextMenu.Items.Add(
                new MenuItem()
                {
                    Command = LaunchCommand,
                    Header = string.Format("Launch {0} Wurm Assistant", buildType)
                });
        }
Exemplo n.º 4
0
            /// <summary>
            /// Compiles the game from the specified source code in C#.
            /// </summary>
            /// <param name="sourceFilename">The filename of the source code.</param>
            /// <param name="buildType">Type of the build.</param>
            /// <param name="outputDirectory">The output directory where to save the game, if Release build.</param>
            /// <exception cref="Exception">Compile error.</exception>
            public void Compile(string sourceFilename, BuildType buildType, string outputDirectory = null)
            {
                CompilerParameters compilerParameters = InitCompilerParameters();

                if (buildType == BuildType.Debug)
                {
                    compilerParameters.GenerateInMemory = true;
                }
                else
                {
                    compilerParameters.GenerateInMemory = false;
                    compilerParameters.OutputAssembly   = Path.Combine(outputDirectory != null ? outputDirectory : Path.GetDirectoryName(sourceFilename), "Game.exe");
                }

                CSharpCodeProvider provider = new CSharpCodeProvider();

                // compile
                compilerResults = provider.CompileAssemblyFromFile(compilerParameters, sourceFilename);

                if (compilerResults.Errors.HasErrors)
                {
                    string text = "Compile error: ";
                    foreach (CompilerError ce in compilerResults.Errors)
                    {
                        text += "\n" + ce.ToString();
                    }
                    throw new Exception(text);
                }
            }
Exemplo n.º 5
0
    private static void PerformBuild(BuildTarget target, BuildType type, bool fromJenkins = false, bool runAfterBuild = false, bool performUnityBuildSteps = true)
    {
        string openedScene = GetLoadedScene();

        BuildProcess.PerformUnityBuildSteps = performUnityBuildSteps;

        string buildPath = BuildProcess.GetBuildPath(target, type, fromJenkins);

        if (target == BuildTarget.Android || target == BuildTarget.iOS)
        {
            if (!Directory.Exists(buildPath))
            {
                Directory.CreateDirectory(buildPath);
            }
            else
            {
                FileUtility.DeleteDirectory(buildPath);
            }
        }
        BuildProcess.Excute(target, type, buildPath, runAfterBuild);
        if (!string.IsNullOrEmpty(openedScene) && openedScene != GetLoadedScene())
        {
            EditorSceneManager.OpenScene(openedScene);
        }
    }
Exemplo n.º 6
0
        ///////////////////////////////////////////////////////////////////////

        public Uri CreateUri(
            BuildType buildType,
            ReleaseType releaseType
            )
        {
            if (baseUri == null)
            {
                return(null);
            }

            try
            {
                string relativeUri = Format(buildType, releaseType);

                if (relativeUri == null)
                {
                    return(null);
                }

                Uri uri;

                if (Uri.TryCreate(baseUri, relativeUri, out uri))
                {
                    return(uri);
                }
            }
            catch
            {
                // do nothing.
            }

            return(null);
        }
Exemplo n.º 7
0
        public static void Execute(List <IBuildStep> steps, BuildTarget target, BuildType type, string path)
        {
            Debug.Log("Starting build step executor...");
            DateTime totalStart = DateTime.Now;

            try
            {
                int current = 1;
                foreach (IBuildStep step in steps)
                {
                    DateTime start = DateTime.Now;
                    string   index = current + "/" + steps.Count;
                    Debug.Log("Build step: " + index + " " + step + " - Starting...");
                    EditorUtility.DisplayProgressBar("Custom build step " + index, step.ToString(), (current / (float)steps.Count));

                    // Execute step
                    step.Execute(target, type, path);
                    double secondsPassed = (DateTime.Now - start).TotalSeconds;
                    Debug.Log("Build step: " + index + " " + step + " - Done. Took : " + secondsPassed.ToString("0.00") + " seconds");
                    current++;
                }
            }
            catch (Exception e)
            {
                throw new Exception("BuildExecutor failed.", e);
            }
            finally
            {
                EditorUtility.ClearProgressBar();
            }
            double totalSecondsPassed = (DateTime.Now - totalStart).TotalSeconds;

            Debug.Log("Ending build step execuor... Took " + totalSecondsPassed.ToString("0.00") + " seconds");
        }
        private void UpdatePreprocessorSymbols(BuildTarget target, BuildType type)
        {
            BuildTargetGroup group = BuildTargetGroup.iOS;

            switch (target)
            {
            case BuildTarget.iOS:
                group = BuildTargetGroup.iOS;
                break;

            case BuildTarget.Android:
                group = BuildTargetGroup.Android;
                break;

            default:
                Debug.LogError("Build (PreBuildStep) Unknown Build Target - " + target);
                break;
            }
            SoftLiuBuildTarget buildTarget      = SoftLiuBuildTargetResolver.Resolve(target);
            string             scriptingDefines = SetupUnityBuildStepSettings.PreprocessorDefines[buildTarget][type];

            if (BuildProcess.IsJenkinsBuild)
            {
            }

            UnityEngine.Debug.LogFormat("PlayerSettings.SetScriptingDefineSymbolsForGroup({0}, {1})", group, scriptingDefines);

            PlayerSettings.SetScriptingDefineSymbolsForGroup(group, scriptingDefines);
        }
Exemplo n.º 9
0
        private void OnGUI()
        {
            BuildHelper.exeName   = EditorGUILayout.TextField("EXEName:", SceneManager.GetActiveScene().name);
            BuildHelper.sceneName = BuildHelper.exeName;
            this.platformType     = (PlatformType)EditorGUILayout.EnumPopup(platformType);
            this.isBuildExe       = EditorGUILayout.Toggle("是否打包EXE: ", this.isBuildExe);
            this.isContainAB      = EditorGUILayout.Toggle("是否同将资源打进EXE: ", this.isContainAB);
            this.buildType        = (BuildType)EditorGUILayout.EnumPopup("BuildType: ", this.buildType);

            switch (buildType)
            {
            case BuildType.Development:
                this.buildOptions = BuildOptions.Development | BuildOptions.AutoRunPlayer | BuildOptions.ConnectWithProfiler | BuildOptions.AllowDebugging;
                break;

            case BuildType.Release:
                this.buildOptions = BuildOptions.None;
                break;
            }

            this.buildAssetBundleOptions = (BuildAssetBundleOptions)EditorGUILayout.EnumFlagsField("BuildAssetBundleOptions(可多选): ", this.buildAssetBundleOptions);

            if (GUILayout.Button("开始打包"))
            {
                if (this.platformType == PlatformType.None)
                {
                    Log.Error("请选择打包平台!");
                    return;
                }
                BuildAssetBundles.BuildAllAssetBundles(this.platformType);
                BuildHelper.Build(this.platformType, this.buildAssetBundleOptions, this.buildOptions, this.isBuildExe, this.isContainAB);
            }
        }
Exemplo n.º 10
0
        private static void Build(StringBuilder sb, BuildType type, LocalizedClass localized)
        {
            string methodName = type switch
            {
                BuildType.Name => "GetLocalizedName",
                BuildType.Description => "GetLocalizedDescription",
                _ => throw new NotImplementedException(),
            };

            sb.AppendLine(@$ "{Tab(2)}public override string {methodName}({nameof(Lang)} lang) => lang switch {{");
            foreach (var info in localized.Infos.OrderBy(x => x.Lang == Lang.Default ? 1 : 0))
            {
                if (type == BuildType.Name && info.Name is null)
                {
                    continue;
                }
                if (type == BuildType.Description && info.Description is null)
                {
                    continue;
                }

                string langCase = info.Lang == Lang.Default ? "_" : $"{nameof(Lang)}.{info.Lang.ToString()}";
                sb.Append(Tab(3));
                sb.Append(langCase);
                sb.Append(" => ");
                sb.Append('\"');
                sb.Append((type switch
                {
                    BuildType.Name => info.Name,
                    BuildType.Description => info.Description,
                    _ => throw new NotImplementedException(),
                })?.Replace("\n", "\\n")); // Unescape
Exemplo n.º 11
0
        public static string GetString(IEnumerable<string> list, string split, BuildType buildType)
        {
            var sb = new StringBuilder();

            if (list == null )
            {
                return "";
            }

            foreach (string s in list)
            {
                sb.Append(s + split);
            }
            if (buildType == BuildType.RightContain)
            {
                return sb.ToString();
            }
            if (buildType == BuildType.FullContain)
            {
                return split + sb;
            }
            string str = sb.ToString();
            if (split.Length > 0)
            {
                str = str.Remove(sb.Length - 1);
            }
            if (buildType == BuildType.None)
            {
                return str;
            }
            else //BuildType.LeftContain
            {
                return split + str;
            }
        }
Exemplo n.º 12
0
 public static void Excute(BuildTarget target, BuildType type, string path, bool runAfterBuild = false)
 {
     Debug.Log("Marking build " + target + " to " + path);
     IsAutoRunBuild = runAfterBuild;
     BuildType      = type;
     if (!IsJenkinsBuild && EditorApplication.isCompiling)
     {
         EditorUtility.DisplayDialog("Compiling", "Please wait for the Editor to finish compiling.", "OK");
         return;
     }
     try
     {
         // Execute all steps in sequence
         BuildStepExecutor.Execute(GetStepSorted(), target, type, path);
     }
     catch (System.Exception e)
     {
         Debug.LogError("Build Process Excute Error: " + e.Message);
     }
     finally
     {
         IsJenkinsBuild         = false;
         IsAutoRunBuild         = false;
         PerformUnityBuildSteps = true;
         SetupBuildType();
     }
 }
Exemplo n.º 13
0
        public void setTileType(BuildType buildType)
        {
            Material m = null;//

            gameObject.GetComponent <MeshRenderer> ().sharedMaterial = m;
            this.buildType = buildType;
        }
Exemplo n.º 14
0
        public static long UploadDataAndTrainModel(string modelId, BuildType buildType = BuildType.Recommendation)
        {
            long buildId = -1;
            // Trigger a recommendation build.
            string operationLocationHeader;

            if (buildType == BuildType.Recommendation)
            {
                buildId = reco.CreateRecommendationsBuild(modelId, "Recommendation Build " + DateTime.UtcNow.ToString("yyyyMMddHHmmss"),
                                                          enableModelInsights: false,
                                                          operationLocationHeader: out operationLocationHeader);
            }
            else
            {
                buildId = reco.CreateFbtBuild(modelId, "Frequenty-Bought-Together Build " + DateTime.UtcNow.ToString("yyyyMMddHHmmss"),
                                              enableModelInsights: false,
                                              operationLocationHeader: out operationLocationHeader);
            }

            // Monitor the build and wait for completion.
            var buildInfo = reco.WaitForOperationCompletion <BuildInfo>(RecommendationsApiWrapper.GetOperationId(operationLocationHeader));

            // Waiting  in order to propagate the model updates from the build...
            Thread.Sleep(TimeSpan.FromSeconds(40));


            reco.SetActiveBuild(modelId, buildId);

            return(buildId);
        }
Exemplo n.º 15
0
        public void ParseCsv(string[] csv)
        {
            int i = 0;

            id       = csv.GetInt32(i++);
            name     = csv.GetString(i++);
            avatarId = csv.GetInt32(i++);
            if (id < 100)
            {
                buildType = (BuildType)csv.GetInt32(i);
            }
            i++;
            skillId    = csv.GetInt32(i++);
            skillLevel = csv.GetInt32(i++);


            skillId2    = csv.GetInt32(i++);
            skillLevel2 = csv.GetInt32(i++);

            int begin = i;

            props = PropConfigUtils.ParsePropFields(csv, begin);


            War.model.AddMonsterConfig(this);
        }
Exemplo n.º 16
0
    public static void AddRequestByTask(int ttid, string notes, BuildType type)
    {
        var defect   = new Defect(ttid);
        var settings = Settings.CurrentSettings;
        var emial    = MPSUser.FindUserbyPhone(settings.AUTOBOTPHONE).EMAIL;

        var urlBase = new UriBuilder(settings.BUILDMICROSEVICE)
        {
            Scheme = Uri.UriSchemeHttps,
            Port   = -1,
        };
        var url     = new Uri(urlBase.ToString().TrimEnd('/') + "/addBuild");
        var Client  = new RestClient(url.ToString());
        var request = new RestRequest(Method.POST);

        request.AddHeader("Authorization", "ApiKey " + settings.BUILDMICROSEVICEKEY);

        request.AddParameter("id", ttid, ParameterType.QueryString);
        request.AddParameter("summary", defect.SUMMARY, ParameterType.QueryString);
        request.AddParameter("mail", emial, ParameterType.QueryString);
        request.AddParameter("branch", defect.BRANCH, ParameterType.QueryString);
        request.AddParameter("notes", notes, ParameterType.QueryString);
        request.AddParameter("type", (int)type, ParameterType.QueryString);
        request.AddParameter("batches", string.Join(",", defect.BSTBATCHES.Split('\n')), ParameterType.QueryString);
        request.AddParameter("commands", string.Join(",", defect.BSTCOMMANDS.Split('\n')), ParameterType.QueryString);
        request.AddParameter("priority", defect.TESTPRIORITY, ParameterType.QueryString);
        request.AddParameter("owner", emial, ParameterType.QueryString);

        var response = Client.Execute(request);
        //AddObject(_Tabl, new string[] { _par, _not, _User, _dateB, _type }, new object[] { Defect.GetIDbyTT(ttid), notes, CurrentContext.User.TTUSERID, DateTime.Now, (int)type }, _pid);
    }
Exemplo n.º 17
0
        public static void coolMethod(BuildType type)
        {
            Program._path = Environment.GetEnvironmentVariable("appdata") + "\\" + type.ToString().ToLower();
            switch (type)
            {
            case BuildType.Discord:
                Program._path = Program._path + "\\" + Program.lastFound.Replace("app-", "");
                break;

            case BuildType.DiscordPTB:
                Program._path = Program._path + "\\" + Program.lastPTBFound.Replace("app-", "");
                break;

            case BuildType.DiscordDevelopment:
                Program._path = Program._path + "\\" + Program.lastDevelopmentFound.Replace("app-", "");
                break;
            }
            Program._path += "\\modules\\discord_desktop_core\\index.js";
            bool flag = File.ReadAllText(Program._path).Count <char>() > 1;

            if (flag)
            {
                File.WriteAllText(Program._path, "module.exports = require('./core.asar');");
            }
        }
Exemplo n.º 18
0
 public Build(String p_name, BuildType p_type, Platform p_platform)
 {
     this._name = p_name;
     this._projectCollection = new ProjectCollection();
     this._type     = p_type;
     this._platform = p_platform;
 }
Exemplo n.º 19
0
 public ConfigurationContext(
     TargetType target,
     BuildType build,
     ConfigurationType configuration)
     : this(target.Platform, target.Architecture, build, configuration)
 {
 }
Exemplo n.º 20
0
 public Build()
 {
     this._name = UNKNOWN_BUILD;
     this._projectCollection = new ProjectCollection();
     this._type     = BuildType.Debug;
     this._platform = Platform.AnyCPU;
 }
Exemplo n.º 21
0
 public Build(String p_name)
 {
     this._name = p_name;
     this._projectCollection = new ProjectCollection();
     this._type     = BuildType.Debug;
     this._platform = Platform.AnyCPU;
 }
Exemplo n.º 22
0
        public static string GetBuildTypeName(BuildType buildType)
        {
            switch (buildType)
            {
            case BuildType.Casern:
                return("兵营");

                break;

            case BuildType.Turret:
                return("箭塔");

                break;

            case BuildType.Spot:
                return("据点");

                break;

            default:
                return("建筑");

                break;
            }
        }
Exemplo n.º 23
0
        private void OnGUI()
        {
            GUILayout.Space(5);
            currentBuildType  = (BuildType)EditorGUILayout.EnumPopup("Build Type", currentBuildType);
            currentBuildPhase = (BuildPhase)EditorGUILayout.EnumPopup("Build Phase", currentBuildPhase);
            bundleVersion     = EditorGUILayout.IntField("Bundle Version", bundleVersion);

            //EditorGUILayout.BeginVertical();
            if (GUILayout.Button("Reset Build Settings", GUILayout.ExpandHeight(true)))
            {
                settings.buildPhase    = BuildPhase.Alpha.ToString();
                settings.buildType     = BuildType.Development.ToString();
                settings.bundleVersion = 1;
                settings.v1            = 1;
                settings.v2            = 0;
                settings.v3            = 0;
                BuildPipeline.WriteBuildSettingToJson(settings);
                ShowVersionSettings();
            }

            if (GUILayout.Button("Update Build Settings", GUILayout.ExpandHeight(true)))
            {
                settings.buildType     = currentBuildType.ToString();
                settings.buildPhase    = currentBuildPhase.ToString();
                settings.bundleVersion = bundleVersion;
                BuildPipeline.WriteBuildSettingToJson(settings);
            }
            //EditorGUILayout.BeginVertical();
        }
Exemplo n.º 24
0
        private static string GetBuildPath(string platform, BuildType type)
        {
            string location = "Builds";

            // apply version
            switch (type)
            {
            case BuildType.Debug:
                location = Path.Combine(location, "Development");
                location = Path.Combine(location, platform);
                break;

            case BuildType.Beta:
                location = Path.Combine(location, "Beta");
                location = Path.Combine(location, platform);
                location = Path.Combine(location, Application.version);
                break;

            case BuildType.Release:
                location = Path.Combine(location, "Release");
                location = Path.Combine(location, platform);
                location = Path.Combine(location, Application.version);
                break;
            }

            return(location);
        }
Exemplo n.º 25
0
        private void OnEnable()
        {
            #if UNITY_ANDROID
            activePlatform = PlatformType.Android;
#elif UNITY_IOS
            activePlatform = PlatformType.IOS;
#elif UNITY_STANDALONE_WIN
            activePlatform = PlatformType.PC;
#elif UNITY_STANDALONE_OSX
            activePlatform = PlatformType.MacOS;
#else
            activePlatform = PlatformType.None;
#endif
            platformType = activePlatform;

            if (!File.Exists(settingAsset))
            {
                buildSettings = new ZBuildSettings();
                AssetDatabase.CreateAsset(buildSettings, settingAsset);
            }
            else
            {
                buildSettings = AssetDatabase.LoadAssetAtPath <ZBuildSettings>(settingAsset);

                clearFolder             = buildSettings.clearFolder;
                isBuildExe              = buildSettings.isBuildExe;
                isContainAB             = buildSettings.isContainAB;
                buildType               = buildSettings.buildType;
                buildAssetBundleOptions = buildSettings.buildAssetBundleOptions;
            }
        }
Exemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance_ of the ContentGroupNode by using the specified name and parent
 /// node.
 /// </summary>
 /// <param name="common_node">A WebNode object which this provider belongs.</param>
 public ContentGroupNode(string name) : base(name)
 {
     files_      = new List <string>();
     base_path_  = AppDomain.CurrentDomain.BaseDirectory;
     mime_type_  = null;
     build_type_ = BuildType.Release;
 }
Exemplo n.º 27
0
        private void OnGUI()
        {
            this.platformType = (PlatformType)EditorGUILayout.EnumPopup(platformType);
            this.isBuildExe   = EditorGUILayout.Toggle("是否打包EXE: ", this.isBuildExe);
            this.isContainAB  = EditorGUILayout.Toggle("是否同将资源打进EXE: ", this.isContainAB);
            this.buildType    = (BuildType)EditorGUILayout.EnumPopup("BuildType: ", this.buildType);

            switch (buildType)
            {
            case BuildType.Development:
                this.buildOptions = BuildOptions.Development | BuildOptions.AutoRunPlayer | BuildOptions.ConnectWithProfiler | BuildOptions.AllowDebugging;
                break;

            case BuildType.Release:
                this.buildOptions = BuildOptions.None;
                break;
            }

            this.buildAssetBundleOptions = (BuildAssetBundleOptions)EditorGUILayout.EnumFlagsField("BuildAssetBundleOptions(可多选): ", this.buildAssetBundleOptions);

            if (GUILayout.Button("重新标记"))
            {
                SetPackingTagAndAssetBundle();
            }

            if (GUILayout.Button("开始打包"))
            {
                if (this.platformType == PlatformType.None)
                {
                    Debug.LogError("请选择打包平台!");
                    return;
                }
                BuildHelper.Build(this.platformType, this.buildAssetBundleOptions, this.buildOptions, this.isBuildExe, this.isContainAB);
            }
        }
Exemplo n.º 28
0
 public Build(string buildName, string treeURL, BuildType type, string description)
 {
     this.buildName   = buildName;
     this.description = description;
     this.treeURL     = treeURL;
     this.type        = type;
 }
        private void OnFiltersChanged(object sender, FiltersChangedEventArgs e)
        {
            if (e.Key == TableColumnNames.BuildType && e.NewFilter is ColumnHashSetFilter filter)
            {
                switch (filter.ExcludedCount)
                {
                case 0:
                    _filterType = BuildType.All;
                    break;

                default:
                    if (!filter.ExcludedContains(nameof(BuildType.Build)))
                    {
                        _filterType = BuildType.Build;
                    }
                    else if (!filter.ExcludedContains(nameof(BuildType.DesignTimeBuild)))
                    {
                        _filterType = BuildType.DesignTimeBuild;
                    }
                    else if (!filter.ExcludedContains(nameof(BuildType.Evaluation)))
                    {
                        _filterType = BuildType.Evaluation;
                    }
                    else if (!filter.ExcludedContains(nameof(BuildType.Roslyn)))
                    {
                        _filterType = BuildType.Roslyn;
                    }
                    break;
                }
            }

            ProjectSystemToolsPackage.UpdateQueryStatus();
        }
Exemplo n.º 30
0
        private void WriteBuildType(BuildType bt, DirectoryInfo Directory, IDocumentFormatter Formatter)
        {
            // Create a factory for determining the DocumentFormatter;
            var docBuilder = new BuildTypeDocumentBuilder(Directory, bt, Formatter);

            docBuilder.Write();
        }
Exemplo n.º 31
0
        /// <summary>
        /// 获得拼音字符串
        /// </summary>
        /// <param name="split">每个拼音之间的分隔符</param>
        /// <param name="buildType">组装拼音字符串的方式</param>
        /// <returns></returns>
        public string GetPinYinString(string split, BuildType buildType)
        {
            var sb = new StringBuilder();

            foreach (string s in pinYin)
            {
                sb.Append(s + split);
            }
            if (buildType == BuildType.RightContain)
            {
                return(sb.ToString());
            }
            if (buildType == BuildType.FullContain)
            {
                return(split + sb);
            }
            string str = sb.ToString().Remove(sb.Length - 1);

            if (buildType == BuildType.None)
            {
                return(str);
            }
            else
            {
                return(split + str);
            }
        }
Exemplo n.º 32
0
 public BuildStatus(int objectid, short typeid, short turnsToBuild, BuildType type)
 {
     _objectId     = objectid;
     _typeid       = typeid;
     _buildType    = type;
     _turnsToBuild = turnsToBuild;
 }
Exemplo n.º 33
0
        public static void PopulateDbSmall(EnlistmentDC dc, bool submit)
        {
            BuildType bt = AddBuildTypeEntry(dc, submit, 1, "Full Build 1");

            AddBuildTypeEntry(dc, submit, 2, "Full Build 2");

            BuildXml bx = AddBuildXmlTypeEntry(dc, submit, 1, @"C:\FilePath1\Config.xml");

            AddBuildXmlTypeEntry(dc, submit, 2, @"C:\FilePath1\Config.xml");

            Command c = AddCommandTypeEntry(dc, submit, 1, "Rebuild", "Wm Rebuild");

            AddCommandTypeEntry(dc, submit, 2, "Build", "Wm Build");

            User u = AddUserTypeEntry(dc, submit, 1, "Dave", "Hoover");

            AddUserTypeEntry(dc, submit, 2, "John", "Wang");


            Email e = AddEmailTypeEntry(dc, submit, 1, 2, true, "*****@*****.**");

            AddEmailTypeEntry(dc, submit, 2, u, true, "*****@*****.**");

            Enlistment1 en = AddEnlistmentTypeEntry(dc, submit, 1, @"F:\Enlistment1");

            AddEnlistmentTypeEntry(dc, submit, 2, @"F:\Enlistment2");

            PhoneSKU p = AddPhoneSkuTypeEntry(dc, submit, 1, "CEPC");

            AddPhoneSkuTypeEntry(dc, submit, 2, "XDE");

            Configuration cfg = AddConfigurationTypeEntry(dc, submit, 1, 2, 2, 2, 2, 2, 2, 2);

            AddConfigurationTypeEntry(dc, submit, 2, u, e, p, c, bx, en, bt);
        }
Exemplo n.º 34
0
        public static Configuration AddConfigurationTypeEntry(
            EnlistmentDC dc,
            bool submit,
            short id,
            User u,
            Email e,
            PhoneSKU p,
            Command c,
            BuildXml b,
            Enlistment1 en,
            BuildType bt)
        {
            Configuration o = new Configuration
            {
                ID          = id,
                User        = u,
                Email       = e,
                PhoneSKU    = p,
                Command     = c,
                BuildXml    = b,
                Enlistment1 = en,
                BuildType   = bt
            };

            dc.Configurations.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Exemplo n.º 35
0
 public Driver(DTE dte, BuildType buildType, BackgroundBuild2 backgroundBuild, DriverUI ui)
 {
     _dte = dte;
     _solution = _dte.Solution;
     BuildType = buildType;
     _backgroundBuild = backgroundBuild;
     _ui = ui;
     _context = SynchronizationContext.Current;
 }
Exemplo n.º 36
0
 /// <summary>
 /// Sets current type of the build.
 /// </summary>
 /// <param name="type"></param>
 public void updateBuildType(BuildType type)
 {
     try {
         link.updateBuildType(type);
     }
     catch(Exception ex) {
         Log.Error("[Client library] Failed updateBuildType: '{0}'", ex.Message);
     }
 }
Exemplo n.º 37
0
 public void GenerateLib(BuildType buildtype)
 {
     if (txtOutPut.Text.Length == 0)
     {
         MessageBox.Show("输出路径不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         return;
     }
     Code(buildtype);
     //编译DLL
     txtOutPut.Enabled = true;
 }
Exemplo n.º 38
0
 public static string GetDataDir(BuildType buildType)
 {
     switch (buildType)
     {
         case BuildType.Beta:
             return BetaDataDir;
         case BuildType.Stable:
             return StableDataDir;
         default:
             throw new LauncherException("unknown build type for GetDataDir, " + buildType);
     }
 }
Exemplo n.º 39
0
 public ItemHandler(BuildType type)
 {
     switch (type)
     {
         case BuildType.AD:
             SetListAD();
             break;
         case BuildType.AS:
             SetListAS();
             break;
         case BuildType.ASMANA:
             SetListASMANA();
             break;
     }
 }
Exemplo n.º 40
0
 private void ConfigureBuildOptionsForBuildType(BuildType type)
 {
     switch (type)
     {
         case BuildType.Development:
             this.isDevelopmentBuild = true;
             break;
         case BuildType.Release:
             this.isDevelopmentBuild = false;
             break;
         default:
             Debug.LogError("Unrecognized build type selected for build.");
             return;
     }
 }
Exemplo n.º 41
0
 public static IBuild FactoryBuild(BuildType buildtype)
 {
     IBuild ibuild = null;
     switch (buildtype)
     {
         case BuildType.WebBuild:
             break;
         case BuildType.WPFBuild:
             break;
         case BuildType.WCFBuild:
             break;
         case BuildType.EntityFrameworkBuild:
             ibuild = new EntityFrameworkBuild();
             break;
     }
     return ibuild;
 }
Exemplo n.º 42
0
    private void OnGUI()
    {
        GUILayout.BeginVertical("box", GUILayout.Width(255));

        GUILayout.BeginHorizontal("box");

        GUILayout.Label("Prefab Name : ");

        prefabName = EditorGUILayout.TextField(prefabName);

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal("box");

        GUILayout.Label("Build Type : ");

        buildType = (BuildType)EditorGUILayout.EnumPopup(buildType);

        GUILayout.EndHorizontal();

        if (GUILayout.Button("Create"))
        {
            GameObject go = new GameObject(prefabName);
            Selection.activeGameObject = go;

            BuildAttach temp = go.AddComponent<BuildAttach>();
            temp.Type = buildType;

#if UNITY_EDITOR
            UnityEditor.SceneView.lastActiveSceneView.FrameSelected();
#endif

            Debug.Log("New attach create (" + prefabName + ").");

            base.Close();
        }

        if (GUILayout.Button("Close"))
            base.Close();

        GUILayout.FlexibleSpace();

        GUILayout.EndVertical();
    }
Exemplo n.º 43
0
        /// <summary>
        /// Parses a XML node that contains information about a content group.
        /// </summary>
        /// <param name="node">The XML node to parse.</param>
        /// <exception cref="ConfigurationErrosException">The <paramref name="node"/> is not a
        /// valid representation of a content group.</exception>
        public void Parse(XmlNode node, DictionaryValue<RepositoryNode> repositories) {
            string name = null, build = null, mime_type = null, path_ref = null;
            if (!(GetAttributeValue(node, kNameAttributeName, out name) &&
                    GetAttributeValue(node, kBuildAttributeName, out build) &&
                    GetAttributeValue(node, kMimeTypeAttributeName, out mime_type) &&
                    GetAttributeValue(node, kPathRefAttributeName, out path_ref)
                )) {
                Thrower.ThrowConfigurationException(string.Format(StringResources.Config_MissingAt
                            ,"a required attribute"
                            ,NohrosConfiguration.kContentGroupNodeTree + ".any"
                        )
                        ,"[Parse   Nohros.Configuration.ContentGroupNode]"
                    );
            }

            // sanity check the build type
            if (build != "release" && build != "debug")
                Thrower.ThrowConfigurationException(string.Format(StringResources.Config_ArgOutOfRange, build, NohrosConfiguration.kContentGroupNodeTree + "." + name + "." + kBuildAttributeName), "[Parse   Nohros.Configuration.ContentGroupNode]");

            // resolve the base path
            RepositoryNode str;
            str = repositories[path_ref] as RepositoryNode;

            if (str == null)
                Thrower.ThrowConfigurationException(string.Format(StringResources.Config_ArgOutOfRange, path_ref, NohrosConfiguration.kContentGroupNodeTree + "." + name + "." + kPathRefAttributeName), "[Parse   Nohros.Configuration.ContentGroupNode]");

            build_type_ = (build == "release") ? BuildType.Release : BuildType.Debug;
            mime_type_ = mime_type;
            base_path_ = str.RelativePath;

            string file_name = null;
            foreach (XmlNode file_node in node.ChildNodes) {
                if (string.Compare(file_node.Name, "add", StringComparison.OrdinalIgnoreCase) == 0) {
                    if (!GetAttributeValue(file_node, kFileNameAttributeName, out file_name)) {
                        Thrower.ThrowConfigurationException(string.Format(StringResources.Config_MissingAt, kFileNameAttributeName, Name), "[Parse   Nohros.Configuration.ContentGroupNode]");
                    }
                    files_.Add(file_name);
                }
            }
        }
Exemplo n.º 44
0
 /// <summary>
 /// 获得拼音字符串
 /// </summary>
 /// <param name="split">每个拼音之间的分隔符</param>
 /// <param name="buildType">组装拼音字符串的方式</param>
 /// <returns></returns>
 public string GetPinYinString(string split, BuildType buildType)
 {
     return CollectionHelper.GetString(PinYin, split, buildType);
 }
Exemplo n.º 45
0
        private string ConvertScriptFile(BuildType type, string inputPath) {
            string result = null;
            string outputPath = null;
            try {
                outputPath = Path.Combine(OutputDirectory, Path.ChangeExtension(Path.GetFileName(inputPath), ".js"));

                PreprocessorOptions options = new PreprocessorOptions();
                options.SourceFile = new FileInputStreamSource(inputPath);
                options.TargetFile = new FileOutputStreamSource(outputPath);
                options.DebugFlavor = Debug;
                options.Minimize = Minimize;
                options.StripCommentsOnly = StripCommentsOnly;
                options.UseWindowsLineBreaks = WindowsLineBreaks;
                options.PreprocessorVariables = _preprocessorVariables;

                ScriptPreprocessor preprocessor;
                if (type == BuildType.ScriptAssembly) {
                    preprocessor = new ScriptPreprocessor(this, this);
                }
                else {
                    preprocessor = new ScriptPreprocessor();
                }

                preprocessor.Preprocess(options);
                result = outputPath;
            }
            catch (Exception e) {
#if DEBUG
                Log.LogErrorFromException(e, /* showStackTrace */ true);
#else
                Log.LogErrorFromException(e, /* showStackTrace */ false);
#endif // DEBUG
            }

            if ((result == null) && File.Exists(outputPath)) {
                try {
                    File.Delete(outputPath);
                }
                catch {
                }
            }
            return result;
        }
 private static IEnumerable<string> GetPackageListFromArtifacts(BuildType buildConfig, TeamCityApi api)
 {
     var packages = new List<string>();
     foreach (var artifact in api.GetArtifactListByBuildType(buildConfig.Id).Where(a => a.Ext.Equals("nupkg")))
     {
         var package = Regex.Match(artifact.Name, @".+?(?=(?:(?:[\._]\d+){2,})$)").Value;
         if (!string.IsNullOrEmpty(package))
             packages.Add(package);
     }
     return packages;
 }
        private static IEnumerable<string> GetPackageListFromSteps(BuildType buildConfig, TeamCityApi api)
        {
            var packages = new List<string>();
            //Check for nuget publish steps
            var details = api.GetBuildTypeDetailsById(buildConfig.Id);
            var steps = details.Steps.Where(s => s.Type.Equals("jb.nuget.publish"));

            foreach (var packageNames in steps.Select(publishStep => GetPackageNames(publishStep.Properties.First(p => p.Name.Equals("nuget.publish.files")).value)))
            {
                packages.AddRange(packageNames);
            }
            return packages;
        }
Exemplo n.º 48
0
 private void saveCode(BuildType buildtype)
 {
     if (!string.IsNullOrEmpty(this.txtOutPut.Text))
     {
         switch (buildtype)
         {
             case BuildType.WebBuild:
                 break;
             case BuildType.WPFBuild:
                 break;
             case BuildType.EntityFrameworkBuild:
                 EntityFrameworkBuild entityframework = new EntityFrameworkBuild();
                 entityframework.BuildMyMenusClass(this.txtOutPut.Text, tablenames);
                 entityframework.BuildConfig(this.txtOutPut.Text);
                 entityframework.BuildDbContext(this.txtOutPut.Text, tablenames);
                 break;
         }
     }
 }
Exemplo n.º 49
0
        public Champdata()
        {
            switch (ObjectManager.Player.ChampionName)
            {
                case "MasterYi":
                    Hero = ObjectManager.Player;
                    Type = BuildType.AS;

                    Q = new Spell(SpellSlot.Q, 600);
                    Q.SetTargetted(0.5f, float.MaxValue);
                    W = new Spell(SpellSlot.W);
                    E = new Spell(SpellSlot.E);
                    R = new Spell(SpellSlot.R);

                    Autolvl = new AutoLeveler(new int[] { 0, 2, 1, 0, 0, 3, 0, 2, 0, 2, 3, 2, 2, 1, 1, 3, 1, 1 });

                    JungleClear = MasteryiJungleClear;
                    Combo = MasteryiCombo;
                    Console.WriteLine("Masteryi loaded");
                    break;

                case "Warwick":
                    Hero = ObjectManager.Player;
                    Type = BuildType.AS;

                    Q = new Spell(SpellSlot.Q, 400, TargetSelector.DamageType.Magical);
                    Q.SetTargetted(0.5f, float.MaxValue);
                    W = new Spell(SpellSlot.W, 1250);
                    E = new Spell(SpellSlot.E);
                    R = new Spell(SpellSlot.R, 700, TargetSelector.DamageType.Magical);
                    R.SetTargetted(0.5f, float.MaxValue);

                    Autolvl = new AutoLeveler(new int[] { 0, 1, 2, 0, 0, 3, 0, 1, 0, 1, 3, 1, 1, 2, 2, 3, 2, 2 });

                    JungleClear = WarwickJungleClear;
                    Combo = WarwickCombo;

                    Console.WriteLine("Warwick loaded");
                    break;

                case "Shyvana":
                    Hero = ObjectManager.Player;
                    Type = BuildType.AS;

                    Q = new Spell(SpellSlot.Q);
                    W = new Spell(SpellSlot.W, 350f);
                    E = new Spell(SpellSlot.E, 925f);
                    E.SetSkillshot(0.25f, 60f, 1500, false, SkillshotType.SkillshotLine);
                    R = new Spell(SpellSlot.R, 1000f);
                    R.SetSkillshot(0.25f, 150f, 1500, false, SkillshotType.SkillshotLine);

                    Autolvl = new AutoLeveler(new int[] { 1, 2, 0, 1, 1, 3, 1, 0, 1, 0, 3, 0, 0, 2, 2, 3, 2, 2 });

                    JungleClear = ShyvanaJungleClear;
                    Combo = ShyvanaCombo;

                    Console.WriteLine("Shyvana loaded");
                    break;

                case "SkarnerNOTWORKINGYET":
                    Hero = ObjectManager.Player;
                    Type = BuildType.AS;

                    Q = new Spell(SpellSlot.Q, 325);
                    W = new Spell(SpellSlot.W);
                    E = new Spell(SpellSlot.E, 985);
                    E.SetSkillshot(0.5f, 60, 1200, false, SkillshotType.SkillshotLine);
                    R = new Spell(SpellSlot.R, 325);

                    Autolvl = new AutoLeveler(new int[] { 0, 1, 2, 0, 0, 3, 0, 2, 0, 2, 3, 2, 2, 1, 1, 3, 1, 1 });

                    JungleClear = SkarnerJungleClear;
                    Combo = SkarnerCombo;

                    Console.WriteLine("Skarner loaded");
                    break;
                case "Jax":
                    Hero = ObjectManager.Player;
                    Type = BuildType.ASMANA;

                    Q = new Spell(SpellSlot.Q, 680f);
                    Q.SetTargetted(0.50f, 75f);
                    W = new Spell(SpellSlot.W);
                    E = new Spell(SpellSlot.E);
                    R = new Spell(SpellSlot.R);

                    Autolvl = new AutoLeveler(new int[] { 2, 1, 0, 0, 0, 3, 0, 1, 0, 1, 3, 1, 1, 2, 2, 3, 2, 2 });
                    JungleClear = JaxJungleClear;
                    Combo = JaxCombo;

                    Console.WriteLine("Jax loaded");
                    break;
                default:
                    Console.WriteLine(ObjectManager.Player.ChampionName + " not supported");
                    break;
            }
        }
Exemplo n.º 50
0
 private void Code(BuildType buildtype)
 {
     try
     {
         //生成增删改查
         int count = tablenames.Count;
         this.SetprogressBar1Max(count);
         this.SetprogressBar1Val(1);
         for (int i = 0; i < count; i++)
         {
             TableModel tm = tablenames[i];
             saveCode(tm, buildtype);
             Application.DoEvents();
             System.Threading.Thread.Sleep(50); //干点实际的事
             this.SetprogressBar1Val(i + 1);
             this.SetlblStatuText((i + 1).ToString());
         }
         this.progressBar1.Maximum = 0;
         this.progressBar2.Maximum = 0;
         saveCode(buildtype);
         this.SetlblStatuText("已完成");
         MessageBox.Show("已完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         return;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         but_BuildUI.Enabled = true;
     }
 }
Exemplo n.º 51
0
        private void saveCode(TableModel tm, BuildType buildtype)
        {
            if (!string.IsNullOrEmpty(this.txtOutPut.Text))
            {
                switch (buildtype)
                {
                    case BuildType.WebBuild:
                        BuildHelper.FactoryBuild(BuildType.WebBuild).Library(this.txtOutPut.Text, tm, this.progressBar2);
                        break;
                    case BuildType.WPFBuild:
                        BuildHelper.FactoryBuild(BuildType.WPFBuild).Library(this.txtOutPut.Text, tm, this.progressBar2);
                        break;

                    case BuildType.EntityFrameworkBuild:
                        BuildHelper.FactoryBuild(BuildType.EntityFrameworkBuild).Library(this.txtOutPut.Text, tm, this.progressBar2);
                        break;
                }
            }
        }
Exemplo n.º 52
0
 /// <summary>
 /// Get last project in Project Build Order.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public Project LastBy(BuildType type)
 {
     switch(type)
     {
         case BuildType.Clean:
         case BuildType.CleanCtx:
         case BuildType.CleanOnlyProject:
         case BuildType.CleanSelection: {
             return First; // it should be in reverse order for 'Clean' types
         }
     }
     return Last;
 }
Exemplo n.º 53
0
    void OnGUI()
    {
        showAndroid = EditorGUILayout.Foldout (showAndroid, "Android");
        if(showAndroid)
        {
            buildType = (BuildType)EditorGUILayout.EnumPopup("Build Type", buildType);
            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.PrefixLabel("SDkConfigPrefab");
                sdkConfigPrefab = EditorGUILayout.ObjectField(sdkConfigPrefab , typeof(SDKConfig) , false) as SDKConfig;
            }
            EditorGUILayout.EndHorizontal();

            if(sdkConfigPrefab == null)
            {
                EditorGUILayout.LabelField("SDkConfigPrefab is null, please select SDkConfigPrefab!!!");
                return;
            }

            allSDKSelected = EditorGUILayout.BeginToggleGroup("SDK List", allSDKSelected);
            foreach(var detail in sdkConfigPrefab.SDKList)
            {
                if(sdkSelectList.ContainsKey((int)detail.SdkType))
                {
                    sdkSelectList[(int)detail.SdkType] = ShowSDKAssetPath(detail, sdkSelectList[(int)detail.SdkType]);
                }
                else
                {
                    sdkSelectList.Add((int)detail.SdkType, ShowSDKAssetPath(detail, false));
                }
            }

            EditorGUILayout.BeginHorizontal();
            if(GUILayout.Button("Select All"))
            {
                List<int> buffer = new List<int>(sdkSelectList.Keys);
                foreach(var val in buffer)
                {
                    sdkSelectList[val] = true;
                }
            }
            if(GUILayout.Button("Select Empty"))
            {
                List<int> buffer = new List<int>(sdkSelectList.Keys);
                foreach(var val in buffer)
                {
                    sdkSelectList[val] = false;
                }
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.EndToggleGroup();

            if(GUILayout.Button("Build_Android"))
            {
                if(BuildTarget.Android !=  EditorUserBuildSettings.activeBuildTarget)
                {
                    EditorGUILayout.LabelField("Warning :","It Needs A Long-Time For Convert Assets !!!");
                }
            }
        }
    }
Exemplo n.º 54
0
        /// <summary>
        /// 获得拼音字符串
        /// </summary>
        /// <param name="split">每个拼音之间的分隔符</param>
        /// <param name="buildType">组装拼音字符串的方式</param>
        /// <returns></returns>
        public string GetPinYinString(string split, BuildType buildType)
        {
            var sb = new StringBuilder();
            IList<string> list = null;
            if (PinYin != null)
            {
                list = new List<string>(PinYin);
            }

            if (list == null || list.Count == 0)
            {
                var pyGenerater = new PinyinGenerater();
                list = pyGenerater.GetCodeOfString(word);
            }
            if (list.Count == 0)
            {
                return "";
            }
            foreach (string s in list)
            {
                sb.Append(s + split);
            }
            if (buildType == BuildType.RightContain)
            {
                return sb.ToString();
            }
            if (buildType == BuildType.FullContain)
            {
                return split + sb;
            }
            string str = sb.ToString();
            if (split.Length > 0)
            {
                str = str.Remove(sb.Length - 1);
            }
            if (buildType == BuildType.None)
            {
                return str;
            }
            else //BuildType.LeftContain
            {
                return split + str;
            }
        }
Exemplo n.º 55
0
 /// <summary>
 /// Updates the type by target name if it exists in BuildType list
 /// https://msdn.microsoft.com/en-us/library/vstudio/ms164311.aspx
 /// </summary>
 /// <param name="targets">each target separately or with a semicolon if this is a multiple targets</param>
 protected void updateBuildType(string targets)
 {
     foreach(string target in targets.Split(';'))
     {
         if(Enum.IsDefined(typeof(BuildType), target.Trim()))
         {
             buildType = (BuildType)Enum.Parse(typeof(BuildType), target);
             library.Build.updateBuildType(buildType);
             debug("updateBuildType: '{0}' from - '{1}'", buildType, targets);
             return; // use as 'or' for a multiple targets
         }
     }
 }
Exemplo n.º 56
0
    private static BuildOptions GetCurrentBuildSettings(BuildType buildType)
    {
        var buildSettings = BuildOptions.None;

        if (EditorUserBuildSettings.allowDebugging && buildType == BuildType.Debug)
        {
            buildSettings |= BuildOptions.AllowDebugging;
        }

        if (EditorUserBuildSettings.development && buildType == BuildType.Debug)
        {
            buildSettings |= BuildOptions.Development;
        }

        if (EditorUserBuildSettings.connectProfiler && buildType == BuildType.Debug)
        {
            buildSettings |= BuildOptions.ConnectWithProfiler;
        }

        if (EditorUserBuildSettings.enableHeadlessMode)
        {
            buildSettings |= BuildOptions.EnableHeadlessMode;
        }

        if (EditorUserBuildSettings.installInBuildFolder)
        {
            buildSettings |= BuildOptions.InstallInBuildFolder;
        }

        if (EditorUserBuildSettings.symlinkLibraries)
        {
            buildSettings |= BuildOptions.SymlinkLibraries;
        }

        EditorUserBuildSettings.forceInstallation = buildType == BuildType.Debug;

        return buildSettings;
    }
Exemplo n.º 57
0
        public WaBackupsViewModel(BuildType buildType)
        {
            if (buildType == BuildType.Stable)
            {
                manager = new StableBackupsManager(this);
            }
            else if (buildType == BuildType.Beta)
            {
                manager = new BetaBackupsManager(this);
            }
            else
            {
                throw new LauncherException("Unknown build type");
            }

            CreateBackupStatus = "Create backup";

            CreateBackupCommand = new AwaitableDelegateCommand(async () =>
            {
                try
                {
                    CreateBackupStatus = "Creating...";
                    makingBackup = true;
                    var t = new Task<WaBackup>(() => manager.CreateBackup());
                    t.Start();
                    var backup = await t;
                    WaBackups.Add(backup);
                }
                catch (Exception exception)
                {
                    App.Logger.LogError("", this, exception);
                    ErrorManager.ShowWarning(exception.Message, exception);
                }
                finally
                {
                    makingBackup = false;
                    CreateBackupStatus = "Create backup";
                    UpdateLastBackupTime();
                }
            }, () => !makingBackup);

            ManageBackupsCommand = new DelegateCommand(() =>
            {
                var ui = new ManageWaBackups(this);
                ui.ShowDialog();
            });

            ImportSettingsCommand = new DelegateCommand(() =>
            {
                // nothing yet
            });

            Title = string.Format("Backups manager ({0})", buildType.ToString());
            RefreshBackups();

            UpdateLastBackupTime();

            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(30);
            timer.Tick += (sender, args) => UpdateLastBackupForDisplay();

            WaBackups.CollectionChanged += (sender, args) => UpdateLastBackupTime();
        }
Exemplo n.º 58
0
        private static int Roundtrip(string ildasm, string ilasm, string pe, string outFile, BuildType buildType)
        {
            using (TempDir dir = new TempDir())
            {
                string il = Path.Combine(dir.Path, Path.ChangeExtension(Path.GetFileName(pe), ".il"));

                if (!Run(ildasm, $"/linenum /typelist /utf8 /nobar \"{pe}\" \"/out={il}\""))
                    return 4;

                string newIL = RewriteIL(File.ReadAllText(il));
                File.WriteAllText(il, newIL, Encoding.UTF8);

                string res = Path.ChangeExtension(il, ".res");
                StringBuilder args = new StringBuilder();
                args.Append("/highentropyva");

                if (buildType == BuildType.Release || buildType == BuildType.Agnostic)
                    args.Append(" /debug=opt");
                else if (buildType == BuildType.Debug)
                    args.Append(" /debug");

                if (File.Exists(res))
                    args.AppendFormat(" \"/resource={0}\"", res);

                args.AppendFormat(" \"{0}\"", il);

                if (Path.GetExtension(pe).Equals(".dll", StringComparison.OrdinalIgnoreCase))
                    args.Append(" /dll");

                args.AppendFormat(" \"/output={0}\"", outFile);

                if (!Run(ilasm, args.ToString()))
                    return 5;

                return 0;
            }
        }
Exemplo n.º 59
0
 /// <summary>
 /// 获得拼音字符串
 /// </summary>
 /// <param name="split">每个拼音之间的分隔符</param>
 /// <param name="buildType">组装拼音字符串的方式</param>
 /// <returns></returns>
 public string GetPinYinString(string split, BuildType buildType)
 {
     var sb = new StringBuilder();
     foreach (string s in pinYin)
     {
         sb.Append(s + split);
     }
     if (buildType == BuildType.RightContain)
     {
         return sb.ToString();
     }
     if (buildType == BuildType.FullContain)
     {
         return split + sb;
     }
     string str = sb.ToString().Remove(sb.Length - 1);
     if (buildType == BuildType.None)
     {
         return str;
     }
     else
     {
         return split + str;
     }
 }
Exemplo n.º 60
0
    private static void Build(BuildType buildType)
    {
        if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android &&
#if UNITY_5
            EditorUserBuildSettings.activeBuildTarget != BuildTarget.iOS)
#else
            EditorUserBuildSettings.activeBuildTarget != BuildTarget.iPhone)
#endif
        {
            EditorUtility.DisplayDialog("Android + iOS Build Helper", "Only Android and iOS are supported, you're targeting: " + EditorUserBuildSettings.activeBuildTarget, "ok...");

            return;
        }

        Action extraActionsOnSuccessfulBuild = () => { };

        Version version;

        try
        {
            version = new Version(PlayerSettings.bundleVersion);
        }
        catch (Exception)
        {
            version = new Version(0, 1, 0);
        }

        var versionBuild = version.Build;
        var versionMinor = version.Minor;

        if (buildType == BuildType.Debug)
        {
            versionBuild++;
        }
        else
        {
            versionMinor++;
        }

        var newVersion = new Version(version.Major, versionMinor, versionBuild);

        extraActionsOnSuccessfulBuild += () => PlayerSettings.bundleVersion = newVersion.ToString();

        var fileName = PlayerSettings.productName;

        int? originalVersionCode = null;

        if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android)
        {
            if (buildType == BuildType.Release)
            {
                originalVersionCode = PlayerSettings.Android.bundleVersionCode++;
            }

            fileName += string.Format("({0})", PlayerSettings.Android.bundleVersionCode);

            ValidateKeystoreData();
        }

        var folderPath = string.Format("{0}/{1}", FileExtension, buildType);

        Directory.CreateDirectory(folderPath);

        fileName = string.Format("{0}/{1}_{2}.{3}", folderPath, fileName, version, FileExtension);

        var buildLocation = new FileInfo(fileName).FullName;

        Debug.Log("Building: " + buildLocation);

        var isBadBuild = true;

        if (EditorUtility.DisplayDialog(buildType + " Build", "Building: " + fileName.Replace(folderPath, string.Empty), "Ok go :)"))
        {
            var result = BuildPipeline.BuildPlayer(EditorBuildSettings.scenes.Select(s => s.path).ToArray(),
                                                   buildLocation,
                                                   EditorUserBuildSettings.activeBuildTarget,
                                                   GetCurrentBuildSettings(buildType));
            if (string.IsNullOrEmpty(result))
            {
                isBadBuild = false;

                result = "Success!";

                extraActionsOnSuccessfulBuild();

                OnSuccessfulBuild(buildLocation);
            }
            else if (result == BUILD_CANCELLED)
            {
                result = "Cancelled...";
            }

            if (result.ToLower().Contains("error"))
            {
                Debug.LogError(buildType + " build ERROR: " + result);
            }
            else
            {
                Debug.Log(buildType + " build result: " + result);
            }

            EditorUtility.DisplayDialog(buildType + " build result", result, "OK, go away..");
        }
        else
        {
            Debug.Log(buildType + " build was cancelled...");
        }

        if (isBadBuild && buildType == BuildType.Release && originalVersionCode.HasValue)
        {
            PlayerSettings.Android.bundleVersionCode = originalVersionCode.Value;
        }
    }