Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmd.exe /C " chcp 1252 & E:VisualStudioMSBuild15.0Binmsbuild.exe /m /p:Configuration=Release /p:Platform=x86 "E:Jenkinsworkspace 00_BUILDSMY_PROJECTMy Project.sln" " && exit %%ERRORLEVEL%%
- <!-- language: lang-c# -->
- using UnityEngine;
- using UnityEditor;
- using System.Collections;
- using System.Collections.Generic;
- using System;
- namespace JENKINS
- {
- public class AutoBuilder : ScriptableObject
- {
- static string[] SCENES = FindEnabledEditorScenes();
- // Use real app name here
- /* Anyway the App will have the name as configured within the Unity-Editor
- This Appname is just for the Folder in which to Build */
- static string APP_NAME;
- static string TARGET_DIR;
- [MenuItem("Custom/CI/Windows Mixed Reality Build (UWP)")]
- public static void PerformWindowsMixedRealityBuild()
- {
- APP_NAME = GetArg("-appName");
- TARGET_DIR = GetArg("-buildFolder");
- Debug.Log("Jenkins-Build: APP_NAME: " + APP_NAME + " TARGET_DIR: " + TARGET_DIR);
- GenericBuild(SCENES, TARGET_DIR + "/" + APP_NAME, BuildTargetGroup.WSA, BuildTarget.WSAPlayer, BuildOptions.AllowDebugging);
- }
- private static string[] FindEnabledEditorScenes()
- {
- List<string> EditorScenes = new List<string>();
- foreach (EditorBuildSettingsScene scene in EditorBuildSettings.scenes)
- {
- if (!scene.enabled) continue;
- EditorScenes.Add(scene.path);
- }
- return EditorScenes.ToArray();
- }
- private static void GenericBuild(string[] scenes, string app_target, BuildTargetGroup build_target_group, BuildTarget build_target, BuildOptions build_options)
- {
- EditorUserBuildSettings.SwitchActiveBuildTarget(build_target_group, BuildTarget.WSAPlayer);
- string res = BuildPipeline.BuildPlayer(scenes, app_target, build_target, build_options);
- if (res.Length > 0)
- {
- throw new Exception("BuildPlayer failure: " + res);
- }
- }
- /**
- * Get Arguments from the command line by name
- */
- private static string GetArg(string name)
- {
- var args = System.Environment.GetCommandLineArgs();
- for (int i = 0; i < args.Length; i++)
- {
- if (args[i] == name && args.Length > i + 1)
- {
- return args[i + 1];
- }
- }
- return null;
- }
- }
- }
- <PathToYourUnityInstallation>EditorUnity.exe -quit -batchmode -username 'xxxxxxxxxxxxx' -password 'xxxxxxxxxxx' -logFile uniytImportLog.txt -importPackage E:UnityPackageAutoBuilder.unitypackage
- <PathToYourUnityInstallation>EditorUnity.exe -quit -batchmode -username 'xxxxxxxxxxxxx' -password 'xxxxxxxxxxx' -logFile uniytBuildLog.txt -buildTarget wsaplayer -executeMethod JENKINS.AutoBuilder.PerformWindowsMixedRealityBuild -appName %JOB_NAME% -buildFolder %WORKSPACE% 0_BUILD
- <PathToYourUnityInstallation>EditorDataPlaybackEnginesMetroSupportToolsnuget.exe restore %WORKSPACE% 0_BUILD%JOB_NAME%%App_Name%
- cmd.exe /C " chcp 1252 & <PathToYourVisual-StudioInstallation>MSBuild15.0Binmsbuild.exe /m /t:restore /p:Configuration=Release /p:Platform=x86 "%WORKSPACE% 0_BUILD%JOB_NAME%%App_Name%" "
- cmd.exe /C " chcp 1252 & <PathToYourVisual-StudioInstallation>MSBuild15.0Binmsbuild.exe /m /t:restore /p:Configuration=Release /p:Platform=x86 "%WORKSPACE% 0_BUILD%JOB_NAME%%App_Name%" "
- "%WORKSPACE% 00_BUILD%JOB_NAME%%App_Name%AppPackages"
Add Comment
Please, Sign In to add comment