check in CoreConsole until there's a working build

This commit is contained in:
Andrew Stanton-Nurse 2015-10-16 11:11:07 -07:00 committed by David Fowler
parent 2fa96c3f94
commit 1a9a5acb41
10 changed files with 35 additions and 34 deletions

View file

@ -3,8 +3,8 @@
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-core" value="https://www.myget.org/F/dotnet-core-rel/api/v2" />
<add key="AspNetCIDev" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
<add key="dotnet-core" value="https://www.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="roslyn-nightly" value="https://www.myget.org/F/roslyn-nightly/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>

Binary file not shown.

Binary file not shown.

View file

@ -13,6 +13,9 @@ popd
set STAGE0_DIR=%REPOROOT%\artifacts\stage0
set STAGE1_DIR=%REPOROOT%\artifacts\stage1
set STAGE2_DIR=%REPOROOT%\artifacts\stage2
set RID=win7-x64
set OUTPUT_ROOT=%REPOROOT%\artifacts\%RID%
set DOTNET_CLR_HOSTS_PATH=%REPOROOT%\ext\CLRHost\%RID%
where dnvm >nul 2>nul
if %errorlevel% == 0 goto have_dnvm
@ -49,15 +52,15 @@ call %~dp0dnvm2 upgrade
if errorlevel 1 goto fail
echo Building stage1 dotnet.exe ...
dotnet --framework dnxcore50 --runtime win7-x64 --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli"
dotnet --framework dnxcore50 --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli"
if errorlevel 1 goto fail
echo Building stage1 dotnet-compile.exe ...
dotnet --framework dnxcore50 --runtime win7-x64 --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler"
dotnet --framework dnxcore50 --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler"
if errorlevel 1 goto fail
echo Building stage1 dotnet-publish.exe ...
dotnet --framework dnxcore50 --runtime win7-x64 --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish"
dotnet --framework dnxcore50 --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish"
if errorlevel 1 goto fail
echo Re-building dotnet tools with the bootstrapped version
@ -66,20 +69,19 @@ set PATH=%STAGE1_DIR%;%PATH%
if exist %STAGE2_DIR% rd /s /q %STAGE2_DIR%
REM This works around the coreconsole bug where the path to the exe can't be found
pushd
cd %STAGE1_DIR%
REM No longer need our special CoreConsole
set DOTNET_CLR_HOSTS_PATH=
echo Building stage2 dotnet.exe ...
dotnet publish --framework dnxcore50 --runtime win7-x64 --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli"
dotnet publish --framework dnxcore50 --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli"
if errorlevel 1 goto fail
echo Building stage2 dotnet-compile.exe ...
dotnet publish --framework dnxcore50 --runtime win7-x64 --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler"
dotnet publish --framework dnxcore50 --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler"
if errorlevel 1 goto fail
echo Building stage2 dotnet-publish.exe ...
dotnet publish --framework dnxcore50 --runtime win7-x64 --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish"
dotnet publish --framework dnxcore50 --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish"
if errorlevel 1 goto fail
echo Bootstrapped dotnet to %STAGE2_DIR%

View file

@ -12,5 +12,7 @@ namespace Microsoft.DotNet.Cli.Utils
public static readonly string CoreConsoleName = "coreconsole" + ExeSuffix;
public static readonly string DefaultConfiguration = "Debug";
public static readonly string BinDirectoryName = "bin";
public static readonly string HostsPathEnvironmentVariable = "DOTNET_CLR_HOSTS_PATH";
}
}

View file

@ -7,7 +7,6 @@
"dotnet": "Microsoft.DotNet.Cli"
},
"dependencies": {
"Microsoft.NETCore.ConsoleHost": "1.0.0-*",
"Microsoft.NETCore.Runtime": "1.0.1-*",
"System.Console": "4.0.0-*",

View file

@ -151,9 +151,13 @@ namespace Microsoft.DotNet.Tools.Compiler
private static Command RunCsc(string cscArgs)
{
// Hack -- if we find csc + corerun in the app directory we should
// use that, otherwise just try to find csc on the PATH
var corerun = Path.Combine(AppContext.BaseDirectory, "CoreRun.exe");
// Locate CoreRun
string hostRoot = Environment.GetEnvironmentVariable(Constants.HostsPathEnvironmentVariable);
if(string.IsNullOrEmpty(hostRoot))
{
hostRoot = AppContext.BaseDirectory;
}
var corerun = Path.Combine(hostRoot, "CoreRun.exe");
var cscExe = Path.Combine(AppContext.BaseDirectory, "csc.exe");
return File.Exists(corerun) && File.Exists(cscExe)
? Command.Create(corerun, $@"""{cscExe}"" {cscArgs}")

View file

@ -7,7 +7,6 @@
"dotnet-compile": "Microsoft.DotNet.Tools.Compiler"
},
"dependencies": {
"Microsoft.NETCore.ConsoleHost": "1.0.0-*",
"Microsoft.NETCore.TestHost": "1.0.0-*",
"Microsoft.NETCore.Runtime": "1.0.1-*",
@ -25,7 +24,7 @@
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.Net.Compilers.netcore": "1.1.0-*",
"Microsoft.Net.Compilers.netcore": "1.1.0-*"
},
"frameworks": {
"dnxcore50": { }

View file

@ -116,29 +116,25 @@ namespace Microsoft.DotNet.Tools.Publish
// Publishing for windows, TODO(anurse): Publish for Mac/Linux/etc.
// CoreConsole should be there...
var coreConsole = Path.Combine(outputPath, Constants.CoreConsoleName);
if (!File.Exists(coreConsole))
// Locate CoreConsole
string hostsPath = Environment.GetEnvironmentVariable(Constants.HostsPathEnvironmentVariable);
if(string.IsNullOrEmpty(hostsPath))
{
Reporter.Error.WriteLine($"Unable to find {Constants.CoreConsoleName} at {coreConsole}. You must have an explicit dependency on Microsoft.NETCore.ConsoleHost (for now ;))".Red().Bold());
hostsPath = AppContext.BaseDirectory;
}
var coreConsole = Path.Combine(hostsPath, Constants.CoreConsoleName);
if(!File.Exists(coreConsole))
{
Reporter.Error.WriteLine($"Unable to locate CoreConsole.exe in {coreConsole}, use {Constants.HostsPathEnvironmentVariable} to set the path to it.".Red().Bold());
return 1;
}
// Allow CoreConsole to be replaced
string overrideCoreConsole = Environment.GetEnvironmentVariable("DOTNET_CORE_CONSOLE_PATH");
if(!string.IsNullOrEmpty(overrideCoreConsole) && File.Exists(overrideCoreConsole))
{
Reporter.Output.WriteLine($"Using CoreConsole override: {overrideCoreConsole}");
File.Copy(overrideCoreConsole, coreConsole, overwrite: true);
}
// TEMPORARILY bring CoreConsole along for the ride on it's own (without renaming)
File.Copy(coreConsole, Path.Combine(outputPath, Constants.CoreConsoleName), overwrite: true);
// Use the 'command' field to generate the name
var outputExe = Path.Combine(outputPath, context.ProjectFile.Name + ".exe");
File.Copy(coreConsole, outputExe, overwrite: true);
if (File.Exists(coreConsole))
{
File.Delete(coreConsole);
}
// Check if the a command name is specified, and rename the necessary files
if(context.ProjectFile.Commands.Count == 1)

View file

@ -7,9 +7,7 @@
"dotnet-publish": "Microsoft.DotNet.Tools.Publish"
},
"dependencies": {
"Microsoft.NETCore.ConsoleHost": "1.0.0-*",
"Microsoft.NETCore.Runtime": "1.0.1-*",
"System.Console": "4.0.0-*",
"System.Collections": "4.0.11-*",
"System.Linq": "4.0.1-*",
@ -23,7 +21,8 @@
"Microsoft.Extensions.CommandLineUtils.Sources": {
"type": "build",
"version": "1.0.0-*"
}
},
"System.AppContext": "4.0.1-*"
},
"frameworks": {
"dnxcore50": { }