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:
parent
6bab94b359
commit
756080421d
3 changed files with 11 additions and 23 deletions
|
@ -173,28 +173,16 @@ namespace Microsoft.DotNet.Tools.Publish
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the 'command' field to generate the name
|
|
||||||
var outputExe = Path.Combine(outputPath, context.ProjectFile.Name);
|
var outputExe = Path.Combine(outputPath, context.ProjectFile.Name);
|
||||||
|
|
||||||
// Write a script that can be used to launch with CoreRun
|
// Rename the {app}.exe to {app}.dll
|
||||||
var script = $@"#!/usr/bin/env bash
|
File.Copy(outputExe + ".exe", outputExe + ".dll", overwrite: true);
|
||||||
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"" $*
|
|
||||||
";
|
|
||||||
|
|
||||||
File.WriteAllText(outputExe, script);
|
// Change coreconsole.exe to the {app}.exe name
|
||||||
|
File.Copy(coreConsole, outputExe, overwrite: true);
|
||||||
Command.Create("chmod", $"a+x {outputExe}")
|
|
||||||
.ForwardStdOut()
|
|
||||||
.ForwardStdErr()
|
|
||||||
.Execute();
|
|
||||||
|
|
||||||
|
// Delete the original managed .exe
|
||||||
|
File.Delete(outputExe + ".exe");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.NETCore.Runtime": "1.0.1-*",
|
"Microsoft.NETCore.Runtime": "1.0.1-23428",
|
||||||
"System.IO": "4.0.10-beta-23420",
|
"System.IO": "4.0.10-beta-23420",
|
||||||
"System.Console": "4.0.0-beta-23420",
|
"System.Console": "4.0.0-beta-23420",
|
||||||
"System.Runtime": "4.0.20-beta-23420",
|
"System.Runtime": "4.0.20-beta-23420",
|
||||||
"System.Diagnostics.Process": "4.1.0-beta-23420",
|
"System.Diagnostics.Process": "4.1.0-beta-23420",
|
||||||
|
|
||||||
"Microsoft.NETCore.ConsoleHost": "1.0.0-beta-*",
|
"Microsoft.NETCore.ConsoleHost": "1.0.0-beta-23428",
|
||||||
"Microsoft.NETCore.TestHost": "1.0.0-beta-*"
|
"Microsoft.NETCore.TestHost": "1.0.0-beta-23428"
|
||||||
},
|
},
|
||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.NETCore.ConsoleHost": "1.0.0-*",
|
"Microsoft.NETCore.ConsoleHost": "1.0.0-23428",
|
||||||
"Microsoft.NETCore.Runtime": "1.0.1-*",
|
"Microsoft.NETCore.Runtime": "1.0.1-23428",
|
||||||
"System.Console": "4.0.0-beta-23109"
|
"System.Console": "4.0.0-beta-23109"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue