private bool CopyContent(string sdkPath, UMakeTarget umakeTarget, string version, string buildPath) { string contentFolderPath = Path.Combine(sdkPath, "tools/ContentBuilder/content"); if (!Directory.Exists(contentFolderPath)) { Debug.LogFormat("Content folder \"{0}\" does not exist.", contentFolderPath); return(false); } UMakeTarget.Path targetPath = umakeTarget.GetTargetPath(version, buildPath); if (!Directory.Exists(targetPath.directoryPath)) { Debug.LogFormat("Target path \"{0}\" does not exist. Did you forget to build?", targetPath.directoryPath); return(false); } string uploadFolderPath = Path.Combine(contentFolderPath, contentSubFolder); if (Directory.Exists(uploadFolderPath)) { Directory.Delete(uploadFolderPath, true); } FileSystemHelper.CopyDirectory(targetPath.directoryPath, uploadFolderPath); Debug.LogFormat("Build files copied to \"{0}\".", uploadFolderPath); return(true); }
public static void ExecuteAction(UMakeTarget t, BuildAction action) { UMake umake; if (!UMake.Get().TryGet(out umake)) { return; } string buildPath; UMakeTarget.Path targetPath; switch (action) { case BuildAction.PreActions: EditorApplication.delayCall += () => t.ExecutePreBuildActions(umake); break; case BuildAction.Build: buildPath = UMake.GetBuildPath(); EditorApplication.delayCall += () => t.Build(umake, buildPath); break; case BuildAction.PostActions: EditorApplication.delayCall += () => t.ExecutePostBuildActions(umake); break; case BuildAction.OpenFolder: targetPath = t.GetTargetPath(umake.version, UMake.GetBuildPath()); EditorUtility.RevealInFinder(targetPath.directoryPath); break; } }
public override void Execute(UMake umake, UMakeTarget target) { PlayerSettings.keystorePass = keyStorePassword; PlayerSettings.keyaliasPass = keyAliasPassword; PlayerSettings.Android.keystoreName = ProjectPath + keyStoreName; PlayerSettings.Android.keyaliasName = keyAliasName; }
private void ShowPostBuildActions(UMakeTarget t) { if (postBuildActionsList == null) { postBuildActionsList = CreateBuildActionsList("Post Build Actions", t.postBuildActions); } postBuildActionsList.DoLayoutList(); }
private void ShowBuildSettings(UMakeTarget t) { t.buildTarget = ( BuildTarget )EditorGUILayout.EnumPopup("Build Target", t.buildTarget); #if UNITY_5 || UNITY_2017_1 || UNITY_2017_2 t.buildOptions = ( BuildOptions )EditorGUILayout.EnumMaskField("Build Options", t.buildOptions); #else t.buildOptions = ( BuildOptions )EditorGUILayout.EnumFlagsField("Build Options", t.buildOptions); #endif t.fileNameOverride = EditorGUILayout.TextField("File Name Override", t.fileNameOverride); }
public override void Execute(UMake umake, UMakeTarget target) { string bundleVersion = PlayerSettings.bundleVersion; if (target.buildTarget == BuildTarget.Android) { PlayerSettings.Android.bundleVersionCode++; } else if (target.buildTarget == BuildTarget.iOS) { int buildNumber = 0; if (int.TryParse(PlayerSettings.iOS.buildNumber, out buildNumber)) { buildNumber++; PlayerSettings.iOS.buildNumber = buildNumber.ToString(); } } }
public override void Execute(UMake umake, UMakeTarget target) { Undo.RecordObject(umake, "UMakeBuildAction"); string[] parts = umake.version.Split(separator); int minVersion; if (int.TryParse(parts[parts.Length - 1], out minVersion)) { minVersion += 1; parts[parts.Length - 1] = minVersion.ToString(); umake.version = string.Join(separator.ToString(), parts); } if (updateApplicationVersion) { PlayerSettings.bundleVersion = umake.version; Debug.Log("The application is now with version " + Application.version); } EditorUtility.SetDirty(umake); }
public override void Execute(UMake umake, UMakeTarget target) { Undo.RecordObject(umake, "UMakeBuildAction"); string[] parts = umake.version.Split(separator); int version = 1; int index = (int)increaseVersionType; if (index >= parts.Length) { string[] versions = new string[(index + 1) - parts.Length]; for (int i = 0; i < versions.Length; i++) { versions[i] = "0"; } ArrayUtility.AddRange(ref parts, versions); } else if (int.TryParse(parts[index], out version)) { version += 1; } for (int i = index + 1; i < parts.Length;) { ArrayUtility.RemoveAt(ref parts, i); } parts[index] = version.ToString(); umake.version = string.Join(separator.ToString(), parts); if (updateApplicationVersion) { PlayerSettings.bundleVersion = umake.version; Debug.Log("The application is now with version " + Application.version); } EditorUtility.SetDirty(umake); }
public override void Execute(UMake umake, UMakeTarget target) { try { string buildPath = UMake.GetBuildPath(); string steamBuildScript = buildScript; string sdkPath = steamSdkPath.Value; string username = steamUsername.Value; string password = steamPassword.Value; bool skipCopy = skipSteamContentCopy; if (UMakeCli.IsInCli) { UMakeCli.Args.TryGetValue("path", out buildPath); UMakeCli.Args.TryGetValue("script", out steamBuildScript); UMakeCli.Args.TryGetValue("steam-sdk", out sdkPath); UMakeCli.Args.TryGetValue("steam-username", out username); UMakeCli.Args.TryGetValue("steam-password", out password); string skipCopyStringValue; UMakeCli.Args.TryGetValue("skip-steam-content-copy", out skipCopyStringValue); bool.TryParse(skipCopyStringValue, out skipCopy); } if (!Directory.Exists(sdkPath)) { Debug.LogFormat("SteamSDK \"{0}\" not found.", sdkPath); return; } string steamCmdPath = Path.Combine(sdkPath, "tools/ContentBuilder/builder/steamcmd.exe");; if (!File.Exists(steamCmdPath)) { Debug.LogFormat("SteamCMD \"{0}\" not found.", steamCmdPath); return; } if (!skipCopy && !CopyContent(sdkPath, target, umake.version, buildPath)) { Debug.Log("Could not copy content to Steam folder."); return; } var uploaderProcess = new System.Diagnostics.Process(); uploaderProcess.StartInfo.FileName = steamCmdPath; uploaderProcess.StartInfo.WorkingDirectory = Path.GetDirectoryName(Path.GetDirectoryName(steamCmdPath)); uploaderProcess.StartInfo.Arguments = string.Format(steamCmdArgFormat, username, password, steamBuildScript); if (UMakeCli.IsInCli) { uploaderProcess.StartInfo.UseShellExecute = false; uploaderProcess.StartInfo.RedirectStandardOutput = true; uploaderProcess.OutputDataReceived += (sender, msg) => { if (msg != null) { Debug.Log(msg.Data); } }; } uploaderProcess.Start(); Debug.LogFormat("Executing SteamCMD \"{0}\"...", steamCmdPath); if (UMakeCli.IsInCli) { uploaderProcess.BeginOutputReadLine(); uploaderProcess.WaitForExit(); } uploaderProcess.Close(); } catch (System.Exception e) { Debug.Log("Upload to Steam failed."); Debug.LogException(e); } }
public virtual void Execute(UMake umake, UMakeTarget target) { }