Ejemplo n.º 1
0
    /// <summary>
    /// Call GitVersion.exe for current project. Capture output, deserialize it to GitVersionVariables object
    /// </summary>
    /// <returns></returns>
    private static GitVersionVariables GenerateVersionInfo()
    {
        var ret = new GitVersionVariables();

        using (var process = new Process())
        {
            var platformDependentScripts = Utils.PlatformDependentScripts.ScriptsFactory.ScriptsForCurrentPlatform();
            var startInfo = platformDependentScripts.GetGitVersionProcessStartInfo(GetPathToGitVersionTool());
            process.StartInfo = startInfo;

            var versionInfo = new StringBuilder();
            process.OutputDataReceived += (sender, args) => versionInfo.Append(args.Data);
            process.ErrorDataReceived  += (sender, args) => BuildHelpers.HandleCompilationError(args.Data);
            process.Start();
            process.BeginOutputReadLine();
            process.BeginErrorReadLine();
            process.WaitForExit();

            var succeed = process.ExitCode == 0;
            UnityEngine.Debug.Log(succeed ? "GitVersion succeed" : "GitVersion failed, output: " + versionInfo.ToString());

            try
            {
                // We don't need all that returns GitVersion.exe deserialize it with restricted set of properties
                ret = JsonUtility.FromJson <GitVersionVariables>(versionInfo.ToString());
            }
            catch (Exception e)
            {
                UnityEngine.Debug.LogError("GetVersion output:" + versionInfo.ToString());
                UnityEngine.Debug.LogError("Error during reading GitVersion tool output file. See the next message for error details");
                UnityEngine.Debug.LogException(e);
            }
        }
        return(ret);
    }
Ejemplo n.º 2
0
 private static string GetCIFolder()
 {
     return(BuildHelpers.GetSolutionPath() // scripts/CI/
            .CombineAsPath("..")
            .CombineAsPath("..")
            .CombineAsPath("scripts")
            .CombineAsPath("CI"));
 }
Ejemplo n.º 3
0
    public static void Windows()
    {
        Directory.CreateDirectory(GetAbsoluteOutputPath());
        BuildHelpers.RemoveDirectoryContent(GetAbsoluteOutputPath());
        BuildVersionInfo();

        // Build player.
        BuildPipeline.BuildPlayer(
            EditorBuildSettings.scenes,
            GetAbsoluteOutputPath().CombineAsPath(string.Format("{0}.exe", PlayerSettings.productName)),
            BuildTarget.StandaloneWindows64,
            BuildOptions.UncompressedAssetBundle);
    }
Ejemplo n.º 4
0
    public static void Android()
    {
        Directory.CreateDirectory(GetAbsoluteOutputPath());
        BuildHelpers.RemoveDirectoryContent(GetAbsoluteOutputPath());
        BuildVersionInfo();

        PlayerSettings.Android.bundleVersionCode++;

        // Build player.
        BuildPipeline.BuildPlayer(
            EditorBuildSettings.scenes,
            GetAbsoluteOutputPath().CombineAsPath(string.Format("{0}.apk", PlayerSettings.productName)),
            BuildTarget.Android,
            BuildOptions.UncompressedAssetBundle);
    }
Ejemplo n.º 5
0
        public virtual MvcForm Begin(FormRenderStyle style = FormRenderStyle.Default)
        {
            Html.UpdateFormBuilderContext(x => x.FormRenderStyle = style);

            switch (style)
            {
            case FormRenderStyle.Inline:
                this.AddClass("form-inline");
                break;

            case FormRenderStyle.Horizontal:
                this.AddClass("form-horizontal");
                break;
            }

            BuildHelpers.FormHelper(Html, DetermineFormAction(), FormMethod, HtmlAttributes);

            return(new BuildMvcForm(Html, Html.ViewContext));
        }
Ejemplo n.º 6
0
 void CleanupOldSettings() => BuildHelpers.CleanOldSettings <XRGeneralSettings>();
Ejemplo n.º 7
0
 /// <summary>
 /// Get path to output folder
 /// </summary>
 /// <returns></returns>
 private static string GetAbsoluteOutputPath()
 {
     return(BuildHelpers.GetSolutionPath().CombineAsPath(RelativeOutputPath));
 }