Use CoreConsole on *nix

- Changed publish to use CoreConsole instead of
CoreRun for *nix
- Locked pacakge versions for test projects
This commit is contained in:
David Fowler 2015-10-29 02:23:09 -07:00
parent 6bab94b359
commit 756080421d
3 changed files with 11 additions and 23 deletions

View file

@ -173,28 +173,16 @@ namespace Microsoft.DotNet.Tools.Publish
return 1;
}
// Use the 'command' field to generate the name
var outputExe = Path.Combine(outputPath, context.ProjectFile.Name);
// Write a script that can be used to launch with CoreRun
var script = $@"#!/usr/bin/env bash
SOURCE=""${{BASH_SOURCE[0]}}""
while [ -h ""$SOURCE"" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=""$( cd -P ""$( dirname ""$SOURCE"" )"" && pwd )""
SOURCE=""$(readlink ""$SOURCE"")""
[[ $SOURCE != /* ]] && SOURCE=""$DIR/$SOURCE"" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=""$( cd -P ""$( dirname ""$SOURCE"" )"" && pwd )""
exec ""$DIR/corerun"" ""$DIR/{context.ProjectFile.Name}.exe"" $*
";
// Rename the {app}.exe to {app}.dll
File.Copy(outputExe + ".exe", outputExe + ".dll", overwrite: true);
File.WriteAllText(outputExe, script);
Command.Create("chmod", $"a+x {outputExe}")
.ForwardStdOut()
.ForwardStdErr()
.Execute();
// Change coreconsole.exe to the {app}.exe name
File.Copy(coreConsole, outputExe, overwrite: true);
// Delete the original managed .exe
File.Delete(outputExe + ".exe");
return 0;
}

View file

@ -5,14 +5,14 @@
},
"dependencies": {
"Microsoft.NETCore.Runtime": "1.0.1-*",
"Microsoft.NETCore.Runtime": "1.0.1-23428",
"System.IO": "4.0.10-beta-23420",
"System.Console": "4.0.0-beta-23420",
"System.Runtime": "4.0.20-beta-23420",
"System.Diagnostics.Process": "4.1.0-beta-23420",
"Microsoft.NETCore.ConsoleHost": "1.0.0-beta-*",
"Microsoft.NETCore.TestHost": "1.0.0-beta-*"
"Microsoft.NETCore.ConsoleHost": "1.0.0-beta-23428",
"Microsoft.NETCore.TestHost": "1.0.0-beta-23428"
},
"frameworks": {

View file

@ -5,8 +5,8 @@
},
"dependencies": {
"Microsoft.NETCore.ConsoleHost": "1.0.0-*",
"Microsoft.NETCore.Runtime": "1.0.1-*",
"Microsoft.NETCore.ConsoleHost": "1.0.0-23428",
"Microsoft.NETCore.Runtime": "1.0.1-23428",
"System.Console": "4.0.0-beta-23109"
},