-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge my spike on compile/publish/run and switch from PS1 to C#
- Loading branch information
Showing
43 changed files
with
4,298 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,4 +49,4 @@ | |
*.vbproj text=auto | ||
*.fsproj text=auto | ||
*.dbproj text=auto | ||
*.sln text=auto eol=crlf | ||
*.sln text=auto eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.23107.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1F391100-F011-4630-8C25-D1A5355E4F19}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5AB144A3-3D0A-4DC7-9EE8-19FDD2DF8735}" | ||
ProjectSection(SolutionItems) = preProject | ||
dotnet-compile.cmd = dotnet-compile.cmd | ||
dotnet-run.cmd = dotnet-run.cmd | ||
global.json = global.json | ||
NuGet.Config = NuGet.Config | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{47858134-8A8D-4D5C-ABD5-E6630A66DA05}" | ||
EndProject | ||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "test\TestApp\TestApp.xproj", "{58808BBC-371E-47D6-A3D0-4902145EDA4E}" | ||
EndProject | ||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "DotNet.Tools.DependencyResolver", "src\DotNet.Tools.DependencyResolver\DotNet.Tools.DependencyResolver.xproj", "{A5D41198-209A-461B-A191-F48B9DBECD67}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{A5D41198-209A-461B-A191-F48B9DBECD67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A5D41198-209A-461B-A191-F48B9DBECD67}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A5D41198-209A-461B-A191-F48B9DBECD67}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A5D41198-209A-461B-A191-F48B9DBECD67}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{58808BBC-371E-47D6-A3D0-4902145EDA4E} = {47858134-8A8D-4D5C-ABD5-E6630A66DA05} | ||
{A5D41198-209A-461B-A191-F48B9DBECD67} = {1F391100-F011-4630-8C25-D1A5355E4F19} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
$OutputName = Split-Path -Leaf (Get-Location) | ||
$OutputPath = Join-Path (Get-Location) "bin" | ||
|
||
if(!(Test-Path $OutputPath)) { | ||
mkdir $OutputPath | Out-Null | ||
} | ||
$OutputPath = (Convert-Path $OutputPath) | ||
|
||
|
||
# Resolve compilation dependencies | ||
Write-Host "Resolving dependencies..." | ||
$refs = dnx -p "$PSScriptRoot\src\DotNet.Tools.DependencyResolver" run --packages "$env:USERPROFILE\.dnx\packages" --target "DNXCore,Version=v5.0" --assets compile | ||
|
||
# Resolve source files | ||
Write-Host "Finding source files..." | ||
$srcs = dnx -p "$PSScriptRoot\src\DotNet.Tools.SourceResolver" run | ||
|
||
# Build csc response file | ||
$resp = @($refs | foreach { "/r:$_" }) | ||
$resp += @($srcs | foreach { $_ }) | ||
$resp += @( | ||
"/out:$OutputPath\$OutputName.dll" | ||
"/nostdlib" | ||
) | ||
|
||
Write-Host "Compiling..." | ||
$resp > "$OutputPath\csc.rsp" | ||
csc "@$OutputPath\csc.rsp" | ||
|
||
Write-Host " $OutputName -> $OutputPath\$OutputName.dll" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
$OutputName = Split-Path -Leaf (Get-Location) | ||
$OutputPath = Join-Path (Join-Path (Get-Location) "bin") "publish" | ||
|
||
& $PSScriptRoot\dotnet-compile.ps1 | ||
|
||
if(Test-Path $OutputPath) { | ||
del -Recurse -Force $OutputPath | ||
} | ||
mkdir $OutputPath | Out-Null | ||
$OutputPath = (Convert-Path $OutputPath) | ||
|
||
# Resolve runtime and native dependencies | ||
Write-Host "Resolving dependencies..." | ||
$refs = dnx -p "$PSScriptRoot\src\DotNet.Tools.DependencyResolver" run --packages "$env:USERPROFILE\.dnx\packages" --target "DNXCore,Version=v5.0/win7-x64" --assets runtime --assets native | ||
|
||
# Copy everything to one directory | ||
$refs | foreach { | ||
Write-Host "Publishing $_ ..." | ||
cp $_ $OutputPath | ||
} | ||
|
||
$ProjectBinary = (Join-Path (Get-Location) "bin\$OutputName.dll") | ||
Write-Host "Publishing $ProjectBinary ..." | ||
cp $ProjectBinary $OutputPath | ||
|
||
# CoreConsole should have come along for the ride | ||
$CoreConsolePath = Join-Path $OutputPath "CoreConsole.exe" | ||
if(!(Test-Path $CoreConsolePath)) { | ||
throw "Unable to locate CoreConsole.exe. You must have a dependency on Microsoft.NETCore.ConsoleHost (for now ;))" | ||
} | ||
mv $CoreConsolePath (Join-Path $OutputPath "$OutputName.exe") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
exec "dnu" "build" "$@" | ||
#!/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 )" | ||
|
||
# work around restore timeouts on Mono | ||
[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50 | ||
|
||
# Makes development easier | ||
export PATH=$PATH:$DIR | ||
|
||
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.Compiler" run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/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 )" | ||
|
||
# work around restore timeouts on Mono | ||
[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50 | ||
|
||
# Makes development easier | ||
export PATH=$PATH:$DIR | ||
|
||
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.Publish" run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@Echo OFF | ||
SETLOCAL | ||
SET ERRORLEVEL= | ||
|
||
REM makes testing easier for now | ||
set PATH=%PATH%;%~dp0 | ||
|
||
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Tools.Publish run %* | ||
|
||
exit /b %ERRORLEVEL% | ||
ENDLOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/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 )" | ||
|
||
# work around restore timeouts on Mono | ||
[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50 | ||
|
||
# Makes development easier | ||
export PATH=$PATH:$DIR | ||
|
||
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.DependencyResolver" run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@Echo OFF | ||
SETLOCAL | ||
SET ERRORLEVEL= | ||
|
||
REM makes testing easier for now | ||
set PATH=%PATH%;%~dp0 | ||
|
||
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Tools.DependencyResolver run %* | ||
|
||
exit /b %ERRORLEVEL% | ||
ENDLOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/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 )" | ||
|
||
# work around restore timeouts on Mono | ||
[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50 | ||
|
||
# Makes development easier | ||
export PATH=$PATH:$DIR | ||
|
||
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.SourceResolver" run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@Echo OFF | ||
SETLOCAL | ||
SET ERRORLEVEL= | ||
|
||
REM makes testing easier for now | ||
set PATH=%PATH%;%~dp0 | ||
|
||
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Tools.SourceResolver run %* | ||
|
||
exit /b %ERRORLEVEL% | ||
ENDLOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/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 )" | ||
|
||
# work around restore timeouts on Mono | ||
[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50 | ||
|
||
# Makes development easier | ||
export PATH=$PATH:$DIR | ||
|
||
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.Run" run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@Echo OFF | ||
SETLOCAL | ||
SET ERRORLEVEL= | ||
|
||
REM makes testing easier for now | ||
set PATH=%PATH%;%~dp0 | ||
|
||
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Tools.Run run %* | ||
|
||
exit /b %ERRORLEVEL% | ||
ENDLOCAL |
Oops, something went wrong.