Merge remote-tracking branch 'upstream/master' into compilenative

This commit is contained in:
Bryan Thornbury 2015-10-29 12:04:02 -07:00
commit 4cb3b9569b
86 changed files with 288 additions and 223 deletions

View file

@ -24,8 +24,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{13F8
scripts\bootstrap.cmd = scripts\bootstrap.cmd
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.ProjectModel", "src\Microsoft.Extensions.ProjectModel\Microsoft.Extensions.ProjectModel.xproj", "{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dnxhost", "dnxhost", "{07731125-77D7-4B83-B7B2-C865C6B8A6E8}"
ProjectSection(SolutionItems) = preProject
scripts\dnxhost\dotnet-compile = scripts\dnxhost\dotnet-compile
@ -38,6 +36,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Tools.Comp
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Tools.Resgen", "src\Microsoft.DotNet.Tools.Resgen\Microsoft.DotNet.Tools.Resgen.xproj", "{585FC6F6-48E0-4EA5-8015-0264614E97C0}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.ProjectModel", "src\Microsoft.DotNet.ProjectModel\Microsoft.DotNet.ProjectModel.xproj", "{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -60,10 +60,6 @@ Global
{391D6AD6-0FD5-4E1E-A4C8-6B5439D197B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{391D6AD6-0FD5-4E1E-A4C8-6B5439D197B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{391D6AD6-0FD5-4E1E-A4C8-6B5439D197B5}.Release|Any CPU.Build.0 = Release|Any CPU
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}.Release|Any CPU.Build.0 = Release|Any CPU
{B559378C-FC03-45FA-893C-71784F28E0A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B559378C-FC03-45FA-893C-71784F28E0A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B559378C-FC03-45FA-893C-71784F28E0A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -72,6 +68,10 @@ Global
{585FC6F6-48E0-4EA5-8015-0264614E97C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{585FC6F6-48E0-4EA5-8015-0264614E97C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{585FC6F6-48E0-4EA5-8015-0264614E97C0}.Release|Any CPU.Build.0 = Release|Any CPU
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -81,9 +81,9 @@ Global
{61B7C351-C77D-43F7-B56F-BB1440178E10} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{0A309227-A9D8-4DDF-88DD-326B57B04378} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{391D6AD6-0FD5-4E1E-A4C8-6B5439D197B5} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{07731125-77D7-4B83-B7B2-C865C6B8A6E8} = {13F8C30C-1011-459C-82B2-0ACDD73EDA18}
{B559378C-FC03-45FA-893C-71784F28E0A2} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{585FC6F6-48E0-4EA5-8015-0264614E97C0} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{303677D5-7312-4C3F-BAEE-BEB1A9BD9FE6} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
EndGlobalSection
EndGlobal

View file

@ -14,7 +14,14 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# UTC Timestamp of the last commit is used as the build number. This is for easy synchronization of build number between Windows, OSX and Linux builds.
LAST_COMMIT_TIMESTAMP=$(git log -1 --format=%ct)
export DOTNET_BUILD_VERSION=0.0.1-alpha-$(date -ud @$LAST_COMMIT_TIMESTAMP "+%Y%m%d-%H%M%S")
if [ "$(uname)" == "Darwin" ]; then
export DOTNET_BUILD_VERSION=0.0.1-alpha-$(date -ur $LAST_COMMIT_TIMESTAMP "+%Y%m%d-%H%M%S")
else
export DOTNET_BUILD_VERSION=0.0.1-alpha-$(date -ud @$LAST_COMMIT_TIMESTAMP "+%Y%m%d-%H%M%S")
fi
echo Building dotnet tools verison - $DOTNET_BUILD_VERSION
$DIR/scripts/bootstrap.sh
$DIR/scripts/package.sh $1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

5
omnisharp.json Normal file
View file

@ -0,0 +1,5 @@
{
"dnx": {
"projects": "src/*/project.json"
}
}

View file

@ -101,6 +101,10 @@ echo Building stage2 dotnet-publish.exe ...
dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Resgen"
if errorlevel 1 goto fail
echo Crossgening Roslyn compiler ...
call %~dp0crossgen/crossgen_roslyn.cmd %STAGE2_DIR%
if errorlevel 1 goto fail
REM Copy DNX in to stage2
xcopy /s /q %DNX_ROOT% %STAGE2_DIR%\dnx\

View file

@ -39,13 +39,15 @@ STAGE0_DIR=$OUTPUT_ROOT/stage0
STAGE1_DIR=$OUTPUT_ROOT/stage1
STAGE2_DIR=$OUTPUT_ROOT/stage2
echo "Cleaning artifacts folder"
rm -rf $OUTPUT_ROOT
echo "Installing stage0"
# Use a sub-shell to ensure the DNVM gets cleaned up
mkdir -p $STAGE0_DIR
$DIR/install-stage0.sh $STAGE0_DIR $DIR/dnvm2.sh
if [ "$DOTNET_CI_SKIP_STAGE0_INSTALL" != "1" ]; then
echo "Installing stage0"
# Use a sub-shell to ensure the DNVM gets cleaned up
rm -Rf $STAGE0_DIR
mkdir -p $STAGE0_DIR
$DIR/install-stage0.sh $STAGE0_DIR $DIR/dnvm2.sh
else
echo "Skipping stage0 because DOTNET_CI_SKIP_STAGE0_INSTALL"
fi
export PATH=$STAGE0_DIR/bin:$PATH
@ -85,15 +87,15 @@ dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE1_DIR" --config
dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE1_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Publish"
dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE1_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Resgen"
# Update stage1 with the checked-in CoreCLR
cp $REPOROOT/ext/CoreCLR/$RID/* $STAGE1_DIR
# Add stage1 to the path and use it to build stage2
export PATH=$STAGE1_DIR:$START_PATH
# Make corerun explicitly executable
chmod a+x $STAGE1_DIR/corerun
# Clean up stage2
[ -d "$STAGE2_DIR" ] && rm -Rf "$STAGE2_DIR"
echo "Building stage2 dotnet using stage1 ..."
dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE2_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Cli"
dotnet publish --framework "$TFM" --runtime $RID --output "$STAGE2_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Tools.Compiler"
@ -128,7 +130,7 @@ OUTPUT=$($REPOROOT/artifacts/$RID/smoketest/TestApp)
# Check that a compiler error is reported
set +e
dotnet compile "$REPOROOT/test/compile/failing/SimpleCompilerError" --framework "$TFM" 2>&1 >/dev/null
dotnet compile "$REPOROOT/test/compile/failing/SimpleCompilerError" --framework "$TFM" 2>/dev/null >/dev/null
rc=$?
if [ $rc == 0 ]; then
echo "Compiler failure test failed! The compiler did not fail to compile!"

View file

@ -0,0 +1,42 @@
@echo off
REM Get absolute path
pushd %1
set BIN_DIR=%CD%
popd
REM Replace with a robust method for finding the right crossgen.exe
set CROSSGEN_UTIL=%UserProfile%\.dnx\packages\runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR\1.0.1-beta-23428\tools\crossgen.exe
pushd %BIN_DIR%
%CROSSGEN_UTIL% /nologo /Platform_Assemblies_Paths %BIN_DIR% System.Collections.Immutable.dll
if not %errorlevel% EQU 0 goto fail
%CROSSGEN_UTIL% /nologo /Platform_Assemblies_Paths %BIN_DIR% System.Reflection.Metadata.dll
if not %errorlevel% EQU 0 goto fail
%CROSSGEN_UTIL% /nologo /Platform_Assemblies_Paths %BIN_DIR% Microsoft.CodeAnalysis.dll
if not %errorlevel% EQU 0 goto fail
%CROSSGEN_UTIL% /nologo /Platform_Assemblies_Paths %BIN_DIR% Microsoft.CodeAnalysis.CSharp.dll
if not %errorlevel% EQU 0 goto fail
%CROSSGEN_UTIL% /nologo /Platform_Assemblies_Paths %BIN_DIR% Microsoft.CodeAnalysis.VisualBasic.dll
if not %errorlevel% EQU 0 goto fail
%CROSSGEN_UTIL% /nologo /Platform_Assemblies_Paths %BIN_DIR% csc.exe
if not %errorlevel% EQU 0 goto fail
%CROSSGEN_UTIL% /nologo /Platform_Assemblies_Paths %BIN_DIR% vbc.exe
if not %errorlevel% EQU 0 goto fail
popd
goto end
:fail
popd
echo Crossgen failed...
exit /B 1
:end

View file

@ -25,4 +25,5 @@ docker run --rm --sig-proxy=true \
--name $DOTNET_BUILD_CONTAINER_NAME \
-v $DOCKER_HOST_SHARE_DIR:/opt/code \
-e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \
-e DOTNET_CI_SKIP_STAGE0_INSTALL=$DOTNET_CI_SKIP_STAGE0_INSTALL \
$DOTNET_BUILD_CONTAINER_TAG $BUILD_COMMAND $1

View file

@ -27,6 +27,12 @@ function CheckRequiredVariables
return $false
}
# this variable is set by the CI system
if([string]::IsNullOrEmpty($env:CHANNEL))
{
return $false
}
return $true
}
@ -58,7 +64,7 @@ elseif([System.IO.Path]::GetExtension($file).ToLower() -eq ".msi")
Write-Host "Uploading $fileName to dotnet feed.."
$Upload_URI = "https://$env:STORAGE_ACCOUNT.blob.core.windows.net/$env:STORAGE_CONTAINER/$Folder/$env:DOTNET_BUILD_VERSION/$fileName$env:SASTOKEN"
$Upload_URI = "https://$env:STORAGE_ACCOUNT.blob.core.windows.net/$env:STORAGE_CONTAINER/$env:CHANNEL/$Folder/$env:DOTNET_BUILD_VERSION/$fileName$env:SASTOKEN"
Invoke-WebRequest -URI $Upload_URI -Method PUT -Headers @{"x-ms-blob-type"="BlockBlob"; "x-ms-date"="2015-10-23";"x-ms-version"="2013-08-15"} -InFile $file

View file

@ -59,6 +59,11 @@ validate_env_variables(){
ret=1
fi
if [[ -z "$CHANNEL" ]]; then
echo "CHANNEL environment variable not set"
ret=1
fi
return $ret
}
@ -72,7 +77,7 @@ upload_file_to_blob_storage(){
FOLDER="Binaries"
fi
UPLOAD_URL="https://$STORAGE_ACCOUNT.blob.core.windows.net/$STORAGE_CONTAINER/$FOLDER/$DOTNET_BUILD_VERSION/$filename$SASTOKEN"
UPLOAD_URL="https://$STORAGE_ACCOUNT.blob.core.windows.net/$STORAGE_CONTAINER/$CHANNEL/$FOLDER/$DOTNET_BUILD_VERSION/$filename$SASTOKEN"
curl -L -H "x-ms-blob-type: BlockBlob" -H "x-ms-date: 2015-10-21" -H "x-ms-version: 2013-08-15" $UPLOAD_URL -T $UPLOAD_FILE
result=$?

View file

@ -4,10 +4,13 @@
"shared": "**/*.cs",
"dependencies": {
"System.Console": "4.0.0-beta-23420",
"System.IO.FileSystem": "4.0.1-beta-23420",
"System.Diagnostics.Process": "4.1.0-beta-23420",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23420"
"System.Console": "4.0.0-beta-23428",
"System.IO.FileSystem": "4.0.1-beta-23428",
"System.Diagnostics.Process": "4.1.0-beta-23428",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23428",
"Microsoft.NETCore.ConsoleHost": "1.0.0-beta-23428",
"Microsoft.NETCore.TestHost": "1.0.0-beta-23428"
},
"frameworks": {
"dnxcore50": { }

View file

@ -8,19 +8,19 @@
"dotnet": "Microsoft.DotNet.Cli"
},
"dependencies": {
"Microsoft.NETCore.Runtime": "1.0.1-beta-23420",
"Microsoft.NETCore.Runtime": "1.0.1-beta-23428",
"System.Console": "4.0.0-beta-23420",
"System.Collections": "4.0.11-beta-23420",
"System.Linq": "4.0.1-beta-23420",
"System.Diagnostics.Process": "4.1.0-beta-23420",
"System.Console": "4.0.0-beta-23428",
"System.Collections": "4.0.11-beta-23428",
"System.Linq": "4.0.1-beta-23428",
"System.Diagnostics.Process": "4.1.0-beta-23428",
"Microsoft.DotNet.Cli.Utils": {
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.Extensions.CommandLineUtils.Sources": {
"type": "build",
"version": "1.0.0-rc1-15838"
"version": "1.0.0-*"
}
},
"frameworks": {

View file

@ -74,11 +74,10 @@ namespace Microsoft.Extensions.ProjectModel
projectPath = Path.GetDirectoryName(projectPath);
}
return new ProjectContextBuilder()
{
ProjectDirectory = projectPath,
TargetFramework = framework,
RuntimeIdentifiers = runtimeIdentifiers
}.Build();
.WithProjectDirectory(projectPath)
.WithTargetFramework(framework)
.WithRuntimeIdentifiers(runtimeIdentifiers)
.Build();
}
/// <summary>
@ -95,10 +94,9 @@ namespace Microsoft.Extensions.ProjectModel
foreach(var framework in project.GetTargetFrameworks())
{
yield return new ProjectContextBuilder()
{
Project = project,
TargetFramework = framework.FrameworkName
}.Build();
.WithProject(project)
.WithTargetFramework(framework.FrameworkName)
.Build();
}
}
}

View file

@ -12,23 +12,77 @@ namespace Microsoft.Extensions.ProjectModel
{
public class ProjectContextBuilder
{
public Project Project { get; set; }
private Project Project { get; set; }
public LockFile LockFile { get; set; }
private LockFile LockFile { get; set; }
public GlobalSettings GlobalSettings { get; set; }
private GlobalSettings GlobalSettings { get; set; }
public NuGetFramework TargetFramework { get; set; }
private NuGetFramework TargetFramework { get; set; }
public IEnumerable<string> RuntimeIdentifiers { get; set; } = Enumerable.Empty<string>();
private IEnumerable<string> RuntimeIdentifiers { get; set; } = Enumerable.Empty<string>();
public string RootDirectory { get; set; }
private string RootDirectory { get; set; }
public string ProjectDirectory { get; set; }
private string ProjectDirectory { get; set; }
public string PackagesDirectory { get; set; }
private string PackagesDirectory { get; set; }
public string ReferenceAssembliesPath { get; set; }
private string ReferenceAssembliesPath { get; set; }
public ProjectContextBuilder WithLockFile(LockFile lockFile)
{
LockFile = lockFile;
return this;
}
public ProjectContextBuilder WithProject(Project project)
{
Project = project;
return this;
}
public ProjectContextBuilder WithProjectDirectory(string projectDirectory)
{
ProjectDirectory = projectDirectory;
return this;
}
public ProjectContextBuilder WithTargetFramework(NuGetFramework targetFramework)
{
TargetFramework = targetFramework;
return this;
}
public ProjectContextBuilder WithTargetFramework(string targetFramework)
{
TargetFramework = NuGetFramework.Parse(targetFramework);
return this;
}
public ProjectContextBuilder WithRuntimeIdentifiers(IEnumerable<string> runtimeIdentifiers)
{
RuntimeIdentifiers = runtimeIdentifiers;
return this;
}
public ProjectContextBuilder WithReferenceAssembliesPath(string referenceAssembliesPath)
{
ReferenceAssembliesPath = referenceAssembliesPath;
return this;
}
public ProjectContextBuilder WithPackagesDirectory(string packagesDirectory)
{
PackagesDirectory = packagesDirectory;
return this;
}
public ProjectContextBuilder WithRootDirectory(string rootDirectory)
{
RootDirectory = rootDirectory;
return this;
}
public ProjectContext Build()
{
@ -46,7 +100,7 @@ namespace Microsoft.Extensions.ProjectModel
}
RootDirectory = GlobalSettings?.DirectoryPath ?? RootDirectory;
PackagesDirectory = PackagesDirectory ?? PackageDependencyProvider.ResolveRepositoryPath(RootDirectory, GlobalSettings);
PackagesDirectory = PackagesDirectory ?? PackageDependencyProvider.ResolvePackagesPath(RootDirectory, GlobalSettings);
ReferenceAssembliesPath = ReferenceAssembliesPath ?? GetDefaultReferenceAssembliesPath();
LockFileLookup lockFileLookup = null;

View file

@ -65,7 +65,7 @@ namespace Microsoft.Extensions.ProjectModel.Resolution
}
}
public static string ResolveRepositoryPath(string rootDirectory, GlobalSettings settings)
public static string ResolvePackagesPath(string rootDirectory, GlobalSettings settings)
{
// Order
// 1. global.json { "packages": "..." }

View file

@ -0,0 +1,30 @@
{
"version": "1.0.0-*",
"description": "Types to model a .NET Project",
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23428",
"System.Collections": "4.0.11-beta-23428",
"System.Linq": "4.0.1-beta-23428",
"System.Threading.Thread": "4.0.0-beta-23428",
"System.Runtime.Loader": "4.0.0-beta-23428",
"System.Dynamic.Runtime": "4.0.11-beta-23428",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23428",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23428",
"NuGet.Packaging": "3.2.0",
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-*",
"Microsoft.Extensions.JsonParser.Sources": {
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.Extensions.HashCodeCombiner.Sources": {
"type": "build",
"version": "1.0.0-*"
}
},
"frameworks": {
"dnxcore50": { }
}
}

View file

@ -8,22 +8,22 @@
"dotnet-compile-csc": "Microsoft.DotNet.Tools.Compiler.Csc"
},
"dependencies": {
"Microsoft.NETCore.TestHost": "1.0.0-beta-23420",
"Microsoft.NETCore.Runtime": "1.0.1-beta-23420",
"Microsoft.NETCore.TestHost": "1.0.0-beta-23428",
"Microsoft.NETCore.Runtime": "1.0.1-beta-23428",
"System.Console": "4.0.0-beta-23428",
"System.Collections": "4.0.11-beta-23428",
"System.Linq": "4.0.1-beta-23428",
"System.Diagnostics.Process": "4.1.0-beta-23428",
"System.IO.FileSystem": "4.0.1-beta-23428",
"System.Console": "4.0.0-beta-23420",
"System.Collections": "4.0.11-beta-23420",
"System.Linq": "4.0.1-beta-23420",
"System.Diagnostics.Process": "4.1.0-beta-23420",
"System.IO.FileSystem": "4.0.1-beta-23420",
"Microsoft.Extensions.ProjectModel": "1.0.0-*",
"Microsoft.DotNet.Cli.Utils": {
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.Extensions.CommandLineUtils.Sources": {
"type": "build",
"version": "1.0.0-rc1-15838"
"version": "1.0.0-*"
},
"Microsoft.Net.Compilers.netcore": "1.1.0-*"
},

View file

@ -8,21 +8,22 @@
"dotnet-compile": "Microsoft.DotNet.Tools.Compiler"
},
"dependencies": {
"Microsoft.NETCore.Runtime": "1.0.1-beta-23420",
"Microsoft.NETCore.Runtime": "1.0.1-beta-23428",
"System.Console": "4.0.0-beta-23420",
"System.Collections": "4.0.11-beta-23420",
"System.Linq": "4.0.1-beta-23420",
"System.Diagnostics.Process": "4.1.0-beta-23420",
"System.IO.FileSystem": "4.0.1-beta-23420",
"Microsoft.Extensions.ProjectModel": "1.0.0-*",
"System.Console": "4.0.0-beta-23428",
"System.Collections": "4.0.11-beta-23428",
"System.Linq": "4.0.1-beta-23428",
"System.Diagnostics.Process": "4.1.0-beta-23428",
"System.IO.FileSystem": "4.0.1-beta-23428",
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
"Microsoft.DotNet.Cli.Utils": {
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.Extensions.CommandLineUtils.Sources": {
"type": "build",
"version": "1.0.0-rc1-15838"
"version": "1.0.0-*"
},
"Microsoft.Net.Compilers.netcore": "1.1.0-*"
},

View file

@ -12,8 +12,6 @@ namespace Microsoft.DotNet.Tools.Publish
{
public class Program
{
public static readonly IEnumerable<string> CoreCLRFileNames = GetCoreCLRFileNames();
public static int Main(string[] args)
{
DebugHelper.HandleDebugSwitch(ref args);
@ -157,32 +155,34 @@ namespace Microsoft.DotNet.Tools.Publish
private static int PublishForUnix(ProjectContext context, string outputPath)
{
CopyCoreCLR(outputPath);
if (context.TargetFramework.IsDesktop())
{
return 0;
}
var coreConsole = Path.Combine(outputPath, Constants.CoreConsoleName);
if(!File.Exists(coreConsole))
{
Reporter.Error.WriteLine($"Cannot find {Constants.CoreConsoleName} in the output. You must have a direct dependency on Microsoft.NETCore.ConsoleHost (for now)");
return 1;
}
var coreRun = Path.Combine(outputPath, Constants.CoreRunName);
if(!File.Exists(coreRun))
{
Reporter.Error.WriteLine($"Cannot find {Constants.CoreRunName} in the output. You must have a direct dependency on Microsoft.NETCore.TestHost (for now)");
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;
}
@ -193,9 +193,18 @@ exec ""$DIR/corerun"" ""$DIR/{context.ProjectFile.Name}.exe"" $*
return 0;
}
CopyCoreCLR(outputPath);
var coreConsole = Path.Combine(outputPath, Constants.CoreConsoleName);
if(!File.Exists(coreConsole))
{
Reporter.Error.WriteLine($"Cannot find {Constants.CoreConsoleName} in the output. You must have a direct dependency on Microsoft.NETCore.ConsoleHost (for now)".Red());
return 1;
}
var coreRun = Path.Combine(outputPath, Constants.CoreRunName);
if(!File.Exists(coreRun))
{
Reporter.Error.WriteLine($"Cannot find {Constants.CoreRunName} in the output. You must have a direct dependency on Microsoft.NETCore.TestHost (for now)".Red());
return 1;
}
var outputExe = Path.Combine(outputPath, context.ProjectFile.Name + Constants.ExeSuffix);
@ -207,17 +216,6 @@ exec ""$DIR/corerun"" ""$DIR/{context.ProjectFile.Name}.exe"" $*
return 0;
}
private static void CopyCoreCLR(string outputPath)
{
// TEMPORARILY bring checked-in CoreCLR stuff along for the ride.
var clrPath = AppContext.BaseDirectory;
foreach(var file in CoreCLRFileNames)
{
File.Copy(Path.Combine(clrPath, file), Path.Combine(outputPath, file), overwrite: true);
}
}
private static void CopyContents(ProjectContext context, string outputPath)
{
var sourceFiles = context.ProjectFile.Files.GetFilesForBundling();
@ -289,32 +287,5 @@ exec ""$DIR/corerun"" ""$DIR/{context.ProjectFile.Name}.exe"" $*
File.Copy(file, Path.Combine(outputPath, Path.GetFileName(file)), overwrite: true);
}
}
private static IEnumerable<string> GetCoreCLRFileNames()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
yield return "coreclr.dll";
yield return "CoreConsole.exe";
yield return "CoreRun.exe";
yield return "mscorlib.ni.dll";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
yield return "libcoreclr.dylib";
yield return "coreconsole";
yield return "corerun";
yield return "mscorlib.dll";
yield return "System.Globalization.Native.dylib";
}
else
{
yield return "libcoreclr.so";
yield return "coreconsole";
yield return "corerun";
yield return "mscorlib.dll";
yield return "System.Globalization.Native.so";
}
}
}
}

View file

@ -8,22 +8,24 @@
"dotnet-publish": "Microsoft.DotNet.Tools.Publish"
},
"dependencies": {
"Microsoft.NETCore.Runtime": "1.0.1-beta-23420",
"System.Console": "4.0.0-beta-23420",
"System.Collections": "4.0.11-beta-23420",
"System.Linq": "4.0.1-beta-23420",
"System.Diagnostics.Process": "4.1.0-beta-23420",
"System.IO.FileSystem": "4.0.1-beta-23420",
"Microsoft.Extensions.ProjectModel": "1.0.0-*",
"Microsoft.NETCore.Runtime": "1.0.1-beta-23428",
"System.Console": "4.0.0-beta-23428",
"System.Collections": "4.0.11-beta-23428",
"System.Linq": "4.0.1-beta-23428",
"System.Diagnostics.Process": "4.1.0-beta-23428",
"System.IO.FileSystem": "4.0.1-beta-23428",
"System.AppContext": "4.0.1-beta-23428",
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
"Microsoft.DotNet.Cli.Utils": {
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.Extensions.CommandLineUtils.Sources": {
"type": "build",
"version": "1.0.0-rc1-15838"
},
"System.AppContext": "4.0.1-beta-23420"
"version": "1.0.0-*"
}
},
"frameworks": {
"dnxcore50": { }

View file

@ -8,23 +8,24 @@
"resgen": "Microsoft.DotNet.Tools.Resgen"
},
"dependencies": {
"Microsoft.NETCore.TestHost": "1.0.0-beta-23420",
"Microsoft.NETCore.Runtime": "1.0.1-beta-23420",
"System.Console": "4.0.0-beta-23420",
"System.Collections": "4.0.11-beta-23420",
"System.Linq": "4.0.1-beta-23420",
"System.Diagnostics.Process": "4.1.0-beta-23420",
"System.IO.FileSystem": "4.0.1-beta-23420",
"Microsoft.NETCore.TestHost": "1.0.0-beta-23428",
"Microsoft.NETCore.Runtime": "1.0.1-beta-23428",
"System.Console": "4.0.0-beta-23428",
"System.Collections": "4.0.11-beta-23428",
"System.Linq": "4.0.1-beta-23428",
"System.Diagnostics.Process": "4.1.0-beta-23428",
"System.IO.FileSystem": "4.0.1-beta-23428",
"System.Xml.XDocument": "4.0.11-beta-23428",
"System.Resources.ReaderWriter": "4.0.0-beta-23428",
"Microsoft.DotNet.Cli.Utils": {
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.Extensions.CommandLineUtils.Sources": {
"type": "build",
"version": "1.0.0-rc1-15838"
},
"System.Xml.XDocument": "4.0.11-beta-23420",
"System.Resources.ReaderWriter": "4.0.0-beta-23420"
"version": "1.0.0-*"
}
},
"frameworks": {
"dnxcore50": { }

View file

@ -1,30 +0,0 @@
{
"version": "1.0.0-*",
"description": "Types to model a .NET Project",
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23420",
"System.Collections": "4.0.11-beta-23420",
"System.Linq": "4.0.1-beta-23420",
"System.Threading.Thread": "4.0.0-beta-23420",
"System.Runtime.Loader": "4.0.0-beta-23420",
"System.Dynamic.Runtime": "4.0.11-beta-23420",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23420",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23420",
"NuGet.Packaging": "3.2.0",
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-beta8-*",
"Microsoft.Extensions.JsonParser.Sources": {
"type": "build",
"version": "1.0.0-rc1-15792"
},
"Microsoft.Extensions.HashCodeCombiner.Sources": {
"type": "build",
"version": "1.0.0-rc1-15718 "
}
},
"frameworks": {
"dnxcore50": { }
}
}

View file

@ -1,40 +0,0 @@
#ifndef TPAFILE_H
#define TPAFILE_H
#include <vector>
#include "pal.h"
struct tpaentry_t
{
pal::string_t asset_type;
pal::string_t library_name;
pal::string_t library_version;
pal::string_t library_hash;
pal::string_t relative_path;
pal::string_t absolute_path;
pal::string_t asset_name;
};
class tpafile
{
public:
static std::pair<bool, tpafile> load(pal::string_t path);
inline const std::vector<tpaentry_t>& entries() { return m_entries; }
inline bool present() { return m_present; }
void add_from(const pal::string_t& dir);
void write_tpa_list(pal::string_t& output);
void write_native_paths(std::string& output);
void set_package_paths(std::vector<pal::string_t> search_paths) { m_package_search_paths = search_paths; }
private:
tpafile(bool present, std::vector<tpaentry_t> entries) : m_present(present), m_entries(entries) {}
bool m_present;
std::vector<tpaentry_t> m_entries;
std::vector<pal::string_t> m_package_search_paths;
};
#endif // TPAFILE_H

View file

@ -5,11 +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"
"System.Diagnostics.Process": "4.1.0-beta-23420",
"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"
},