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> <packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below --> <!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear /> <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="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="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" /> <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources> </packageSources>

Binary file not shown.

Binary file not shown.

View file

@ -13,6 +13,9 @@ popd
set STAGE0_DIR=%REPOROOT%\artifacts\stage0 set STAGE0_DIR=%REPOROOT%\artifacts\stage0
set STAGE1_DIR=%REPOROOT%\artifacts\stage1 set STAGE1_DIR=%REPOROOT%\artifacts\stage1
set STAGE2_DIR=%REPOROOT%\artifacts\stage2 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 where dnvm >nul 2>nul
if %errorlevel% == 0 goto have_dnvm if %errorlevel% == 0 goto have_dnvm
@ -49,15 +52,15 @@ call %~dp0dnvm2 upgrade
if errorlevel 1 goto fail if errorlevel 1 goto fail
echo Building stage1 dotnet.exe ... 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 if errorlevel 1 goto fail
echo Building stage1 dotnet-compile.exe ... 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 if errorlevel 1 goto fail
echo Building stage1 dotnet-publish.exe ... 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 if errorlevel 1 goto fail
echo Re-building dotnet tools with the bootstrapped version 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% 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 REM No longer need our special CoreConsole
pushd set DOTNET_CLR_HOSTS_PATH=
cd %STAGE1_DIR%
echo Building stage2 dotnet.exe ... 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 if errorlevel 1 goto fail
echo Building stage2 dotnet-compile.exe ... 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 if errorlevel 1 goto fail
echo Building stage2 dotnet-publish.exe ... 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 if errorlevel 1 goto fail
echo Bootstrapped dotnet to %STAGE2_DIR% 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 CoreConsoleName = "coreconsole" + ExeSuffix;
public static readonly string DefaultConfiguration = "Debug"; public static readonly string DefaultConfiguration = "Debug";
public static readonly string BinDirectoryName = "bin"; 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" "dotnet": "Microsoft.DotNet.Cli"
}, },
"dependencies": { "dependencies": {
"Microsoft.NETCore.ConsoleHost": "1.0.0-*",
"Microsoft.NETCore.Runtime": "1.0.1-*", "Microsoft.NETCore.Runtime": "1.0.1-*",
"System.Console": "4.0.0-*", "System.Console": "4.0.0-*",

View file

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

View file

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

View file

@ -116,29 +116,25 @@ namespace Microsoft.DotNet.Tools.Publish
// Publishing for windows, TODO(anurse): Publish for Mac/Linux/etc. // Publishing for windows, TODO(anurse): Publish for Mac/Linux/etc.
// CoreConsole should be there... // Locate CoreConsole
var coreConsole = Path.Combine(outputPath, Constants.CoreConsoleName); string hostsPath = Environment.GetEnvironmentVariable(Constants.HostsPathEnvironmentVariable);
if (!File.Exists(coreConsole)) 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; return 1;
} }
// Allow CoreConsole to be replaced // TEMPORARILY bring CoreConsole along for the ride on it's own (without renaming)
string overrideCoreConsole = Environment.GetEnvironmentVariable("DOTNET_CORE_CONSOLE_PATH"); File.Copy(coreConsole, Path.Combine(outputPath, Constants.CoreConsoleName), overwrite: true);
if(!string.IsNullOrEmpty(overrideCoreConsole) && File.Exists(overrideCoreConsole))
{
Reporter.Output.WriteLine($"Using CoreConsole override: {overrideCoreConsole}");
File.Copy(overrideCoreConsole, coreConsole, overwrite: true);
}
// Use the 'command' field to generate the name // Use the 'command' field to generate the name
var outputExe = Path.Combine(outputPath, context.ProjectFile.Name + ".exe"); var outputExe = Path.Combine(outputPath, context.ProjectFile.Name + ".exe");
File.Copy(coreConsole, outputExe, overwrite: true); 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 // Check if the a command name is specified, and rename the necessary files
if(context.ProjectFile.Commands.Count == 1) if(context.ProjectFile.Commands.Count == 1)

View file

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