From 1456f98aff503040eaa563e4c1f282c11f065495 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 22 Nov 2017 21:04:14 +0900 Subject: [PATCH] Ensure that osu.Desktop.Deploy works Closes https://github.com/ppy/osu/issues/1545. --- osu.Desktop.Deploy/.vscode/launch.json | 29 ++++++++++++ osu.Desktop.Deploy/.vscode/tasks.json | 64 ++++++++++++++++++++++++++ osu.Desktop.Deploy/Program.cs | 10 ++-- 3 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 osu.Desktop.Deploy/.vscode/launch.json create mode 100644 osu.Desktop.Deploy/.vscode/tasks.json diff --git a/osu.Desktop.Deploy/.vscode/launch.json b/osu.Desktop.Deploy/.vscode/launch.json new file mode 100644 index 0000000000..82cd6b4c13 --- /dev/null +++ b/osu.Desktop.Deploy/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [{ + "name": "Deploy (Debug)", + "request": "launch", + "type": "mono", + "program": "${workspaceRoot}/bin/Debug/net461/osu.Desktop.Deploy.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + }, + { + "name": "Deploy (Release)", + "request": "launch", + "type": "clr", + "program": "${workspaceRoot}/bin/Release/net461/osu.Desktop.Deploy.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release)", + "runtimeExecutable": null, + "env": {}, + "console": "internalConsole" + } + ] +} \ No newline at end of file diff --git a/osu.Desktop.Deploy/.vscode/tasks.json b/osu.Desktop.Deploy/.vscode/tasks.json new file mode 100644 index 0000000000..35bf9e7a0e --- /dev/null +++ b/osu.Desktop.Deploy/.vscode/tasks.json @@ -0,0 +1,64 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "command": "msbuild", + "type": "shell", + "suppressTaskName": true, + "args": [ + "/property:GenerateFullPaths=true", + "/property:DebugType=portable", + "/verbosity:minimal", + "/m" //parallel compiling support. + ], + "tasks": [{ + "taskName": "Build (Debug)", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Build (Release)", + "group": "build", + "args": [ + "/property:Configuration=Release" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean (Debug)", + "args": [ + "/target:Clean" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean (Release)", + "args": [ + "/target:Clean", + "/property:Configuration=Release" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean All", + "dependsOn": [ + "Clean (Debug)", + "Clean (Release)" + ], + "problemMatcher": [ + "$msCompile" + ] + } + ] +} \ No newline at end of file diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index 3c1d532c0f..1be4bdeb0c 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -96,7 +96,7 @@ namespace osu.Desktop.Deploy runCommand(nuget_path, "restore " + solutionPath); write("Updating AssemblyInfo..."); - updateAssemblyInfo(version); + updateCsprojVersion(version); write("Running build process..."); foreach (string targetName in TargetNames.Split(',')) @@ -123,7 +123,7 @@ namespace osu.Desktop.Deploy uploadBuild(version); //reset assemblyinfo. - updateAssemblyInfo("0.0.0"); + updateCsprojVersion("0.0.0"); write("Done!", ConsoleColor.White); Console.ReadLine(); @@ -297,7 +297,7 @@ namespace osu.Desktop.Deploy Directory.CreateDirectory(directory); } - private static void updateAssemblyInfo(string version) + private static void updateCsprojVersion(string version) { var toUpdate = new[] { "", "" }; string file = Path.Combine(ProjectName, $"{ProjectName}.csproj"); @@ -336,8 +336,8 @@ namespace osu.Desktop.Deploy path = Environment.CurrentDirectory; while (!File.Exists(Path.Combine(path, $"{SolutionName}.sln"))) - path = path.Remove(path.LastIndexOf('\\')); - path += "\\"; + path = path.Remove(path.LastIndexOf(Path.DirectorySeparatorChar)); + path += Path.DirectorySeparatorChar; Environment.CurrentDirectory = path; }