public LibraryInfo( string type, string compilerName, Func <LibraryInfo, Version> dependenciesVersion, bool requireDependenciesLegacy, string[] referencesLegacy, List <Nuget> nugets, BuildTypes buildType, string extension, params BuildTypes[] supportedBuilds) { Type = type; this.SupportedBuilds = supportedBuilds; this.DependenciesVersion = dependenciesVersion; this.RequireDependenciesLegacy = requireDependenciesLegacy; if (buildType == BuildTypes.Source) { Name = type; Target = type; } else { Name = type + "Model"; Target = "lib"; } CompilerName = compilerName; ReferencesLegacy = referencesLegacy; Nugets = nugets; Extension = extension; this.BuildType = buildType; Dependencies = Path.Combine("dependencies", type); WithActiveRecord = WithHelperMethods = true; }
public static void Build(BuildTypes buildType) { if (buildThread.IsBusy == false) { BuildType = buildType; // Build in a seperate Thread(Asynchronous) buildThread.RunWorkerAsync(); } }
public bool Validate() { // Remove this chunk to implement licensing. Note that the current licensing system is not secure and needs some changes. IsValid = true; ProductName = "MultiTablePro (Open Source)"; ProductDescription = "Modify License.cs to implement licensing system."; MaxStake = 100000000; // Only use on play money. I am not liable for damages etc... BuildType = BuildTypes.INTERNAL; IsTrial = false; return(IsValid); // Make API request var postData = new Dictionary <string, string>() { { "macaddr", GetMac() }, { "license_key", Key }, { "request_product_group", "1" } }; var apiOutput = Api.ApiRequest <ApiData.ValidateLicense>("validate_license", postData); // Errors occurred (invalid license, internet connection etc..) if (apiOutput.Errors.Count() > 0) { // Log errors foreach (string err in apiOutput.Errors) { Logger.Log("License Validate: " + err, Logger.Status.Error); } LicenseStatusMessage = apiOutput.Errors.First(); return(false); } // Store license data ApiData.ValidateLicense lData = apiOutput.Result; Email = lData.Email; ExpiresAt = lData.ExpiresAt; FirstName = lData.FirstName; LastName = lData.LastName; LicenseStatusMessage = lData.LicenseStatusMessage; IsValid = lData.IsValid; IsTrial = lData.IsTrial; ProductName = lData.ProductName; ProductDescription = lData.ProductDescription; SetRestrictions(lData.Restrictions); // Save the key if it's valid if (IsValid) { Save(); } // Return validity return(IsValid); }
private void SetRestrictions(Dictionary <string, string> restrictions) { if (restrictions == null) // happens on trials, assume defaults { return; } // Apply relevant restrictions, use defaults for everything else foreach (var r in restrictions) { switch (r.Key.ToUpper()) { case "MAX_STAKE": int maxStake; if (int.TryParse(r.Value, out maxStake)) { MaxStake = maxStake; } else { Logger.Log($"License: {r.Value} is not a valid integer for license restriction MAX_STAKE. Please contact support.", Logger.Status.Fatal, showMessageBox: true); // should never happen } break; case "UNLIMITED_COMPUTERS": UnlimitedComputers = r.Value.ToUpper() == "TRUE" ? true : false; break; case "BUILDTYPE": BuildTypes buildType; if (Enum.TryParse(r.Value.ToUpper(), out buildType)) { BuildType = buildType; } else { Logger.Log($"License: {r.Value} is not a valid build type. Please contact support about this warning.", Logger.Status.Warning, showMessageBox: true); } break; // restriction NIY default: Logger.Log($"License: {r.Key}:{r.Value} is an undefined restriction. User may be on outdated version.", Logger.Status.Warning, showMessageBox: false); break; } } }
/// <summary> /// Start the Build with given filename, version, and build type. /// </summary> /// <param name="filename"></param> /// <param name="version"></param> /// <param name="build"></param> public void Build(string filename, VersionTypes version, BuildTypes build) { // build the command to call vsvars32.bat string initvar; switch (version) { case VersionTypes.VisualStudio2003: initvar = config.Get("VSVARS32_2003"); break; case VersionTypes.VisualStudio2005: initvar = config.Get("VSVARS32_2005"); break; default: throw new ArgumentOutOfRangeException("version=" + version); } initvar = String.Format("call \"{0}\"", initvar); // build the command to build the solution/project string buildcmd = new ConfigManager().Get("buildCommand"); buildcmd = buildcmd.Replace("{FILENAME}", StringUtil.Quote(filename)); buildcmd = buildcmd.Replace("{BUILDTYPE}", StringUtil.Quote(build.ToString())); string command = initvar + Environment.NewLine + buildcmd; //// setting up the dos environment //Dictionary<string, string> dosEnv = new Dictionary<string, string>(); //dosEnv.Add("PATH", StringUtil.Merge(MicrosoftDotNetPath, Environment.GetEnvironmentVariable("PATH"), ";")); // run the commands. ExeRunner r = new ExeRunner(); try { r.Run(command); } catch (Exception ex) { Debug.Write(ex.ToString()); // WARNING: absorb error only! } finally { log.AddRange(r.Log); } }
static void BuildAndroid(BuildTypes type) { bool isCasino = (type == BuildTypes.CasinoSlots); var currentSetting = EditorUserBuildSettings.activeBuildTarget; var scenes = (from scene in EditorBuildSettings.scenes where scene.enabled select scene.path).ToArray(); EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.Android); var args = System.Environment.GetCommandLineArgs(); var outputLocation = args[args.Length - 1]; SetRotationOptions (!isCasino, isCasino); PlayerSettings.productName = PRODUCT_NAMES[type]; PlayerSettings.bundleIdentifier = BUNDLE_IDENTIFIERS[type]; GameObject.Find ("Init").GetComponent<InitScript>().IS_CASINO_BUILD = isCasino; BuildPipeline.BuildPlayer(scenes, outputLocation, BuildTarget.Android, BuildOptions.None); EditorUserBuildSettings.SwitchActiveBuildTarget(currentSetting); }
static void BuildIphone(BuildTypes type) { bool isCasino = (type == BuildTypes.CasinoSlots); var currentSetting = EditorUserBuildSettings.activeBuildTarget; var scenes = (from scene in EditorBuildSettings.scenes where scene.enabled select scene.path).ToArray(); EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.iPhone); EditorUserBuildSettings.appendProject = true; var outputLocation = EditorUserBuildSettings.GetBuildLocation(BuildTarget.iPhone); outputLocation = ReplaceXcodeWith(outputLocation, XCODE_LOCATIONS[type]); SetRotationOptions (!isCasino, isCasino); PlayerSettings.productName = PRODUCT_NAMES[type]; PlayerSettings.bundleIdentifier = BUNDLE_IDENTIFIERS[type]; GameObject.Find ("Init").GetComponent<InitScript>().IS_CASINO_BUILD = isCasino; BuildPipeline.BuildPlayer(scenes, outputLocation, BuildTarget.iPhone, BuildOptions.SymlinkLibraries); EditorUserBuildSettings.SwitchActiveBuildTarget(currentSetting); }
private void Start() { Instance = this; //Event here guiInfos = new BuildingBlockGUIInfo[buildingBlocks.Length]; blockInfo = new BuildingBlockInfo[buildingBlocks.Length]; enemyInfo = new EnemyInfo[enemies.Length]; birdInfo = new BirdInfo[birds.Length]; currentType = BuildTypes.Blocks; ShowBuildingBlocksUI(); ChangeMaterial(Materials.Wood); }
public void SwitchBuildType() { ClearBuildingList(); scrollBar.value = 1f; switch (currentType) { case BuildTypes.Blocks: ShowEnemiesUI(); typeButton.sprite = bird; switchButton.onClick.SetPersistentListenerState(0, UnityEventCallState.Off); switchButtonIcon.color = Color.grey; switchButtonIcon.sprite = woodToIce; currentType = BuildTypes.Enemies; break; case BuildTypes.Enemies: ShowBirdsUI(); typeButton.sprite = block; switchButtonIcon.color = Color.grey; switchButtonIcon.sprite = woodToIce; currentType = BuildTypes.Birds; break; case BuildTypes.Birds: ShowBuildingBlocksUI(); ChangeMaterial(Materials.Wood); typeButton.sprite = enemy; switchButton.onClick.SetPersistentListenerState(0, UnityEventCallState.RuntimeOnly); switchButtonIcon.color = Color.white; currentType = BuildTypes.Blocks; break; } }
public void Initialize() // TODO: rename to initialize { // users var johnDoe = Users.CreateJohnDoe(); var janeDoe = Users.CreateJaneDoe(); Users.Add(johnDoe); Users.Add(janeDoe); // Vcs roots var vcsGit = VcsRoots.CreateVcsRestClientGit(); var vcs1 = VcsRoots.CreateVcs(Guid.NewGuid()); VcsRoots.Add(vcsGit); VcsRoots.Add(vcs1); // Vcs root instances var bitbucketInstance = VcsRootInstances.CreateVcsInstance(vcsGit); VcsRootInstances.Add(bitbucketInstance); // AgentPools var defaultPool = BuildAgentPools.CreateDefaultPool(); BuildAgentPools.Add(defaultPool); // Agents var enabledAgent = BuildAgents.CreateEnabledAgent(johnDoe, johnDoe, defaultPool); var disabledAgent = BuildAgents.CreateDisabledAgent(janeDoe, defaultPool); BuildAgents.Add(enabledAgent); BuildAgents.Add(disabledAgent); var rootProject = Projects.CreateRootProject(); var clientProject = Projects.CreateRestClientProject(rootProject); var cliProject = Projects.CreateTeamCityCliProject(rootProject); var project1 = Projects.CreateProject(Guid.NewGuid(), rootProject); Projects.Add(rootProject); Projects.Add(clientProject); Projects.Add(cliProject); Projects.Add(project1); var restType = BuildTypes.CreateBuildTypeRestClient(clientProject); var cliType = BuildTypes.CreateBuildTypeTeamCityCli(cliProject); BuildTypes.Add(restType); BuildTypes.Add(cliType); var buildOk = Builds.CreateOKBuild(restType, johnDoe, enabledAgent, bitbucketInstance); var buildFailed = Builds.CreateFailedBuild(restType, johnDoe, enabledAgent, bitbucketInstance); var buildQueued = Builds.CreateQueuedBuild(restType, johnDoe); var buildCanceled = Builds.CreateCancelledBuild(restType, johnDoe); var buildRunning = Builds.CreateRunningBuild(restType, johnDoe); Builds.Add(buildOk); Builds.Add(buildFailed); Builds.Add(buildQueued); Builds.Add(buildCanceled); Builds.Add(buildRunning); // Build queue BuildQueue.AddRange(Builds.All().Items.Where(build => build.State == "queued")); var change1 = Changes.CreateChange("1", "Initial commit.", DateTime.UtcNow.AddDays(-7), johnDoe, bitbucketInstance); var change2 = Changes.CreateChange("2", "Add TeamCity fake data.", DateTime.UtcNow.AddDays(-6), johnDoe, bitbucketInstance); var change3 = Changes.CreateChange("3", "Add Changes unit tests.", DateTime.UtcNow.AddDays(-4), johnDoe, bitbucketInstance); Changes.Add(change1); Changes.Add(change2); Changes.Add(change3); var inv = Investigations.CreateInvetigation("1", janeDoe); Investigations.Add(inv); }