forked from dotnet/corefxlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
21 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 |
---|---|---|
|
@@ -248,4 +248,7 @@ tools/ | |
*.ncrunchsolution | ||
|
||
#dotnet cli | ||
[Dd]otnet/ | ||
[Dd]otnet/ | ||
|
||
# Nuget.exe | ||
nuget.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
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 @@ | ||
@echo off | ||
setlocal | ||
|
||
:: Invoke VS Developer Command Prompt batch file. | ||
:: This sets up some environment variables needed to use ILDasm and ILAsm. | ||
if not defined VisualStudioVersion ( | ||
if defined VS140COMNTOOLS ( | ||
call "%VS140COMNTOOLS%\VsDevCmd.bat" | ||
goto :Package | ||
) | ||
|
||
echo Error: package.cmd requires Visual Studio 2015. | ||
exit /b 1 | ||
) | ||
|
||
:Package | ||
powershell -NoProfile %~dp0scripts\package.ps1 %* |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
Param( | ||
[string]$Configuration="Debug", | ||
[string]$ApiKey | ||
) | ||
|
||
$repoRoot = "$PSScriptRoot\.." | ||
$dotnetExePath="$repoRoot\dotnet\dotnet.exe" | ||
$nugetPath = "$repoRoot\nuget\nuget.exe" | ||
$packagesPath = "$repoRoot\packages" | ||
|
||
Function Ensure-Nuget-Exists { | ||
if (!(Test-Path "$nugetPath")) { | ||
if (!(Test-Path "$repoRoot\nuget")) { | ||
New-Item -ItemType directory -Path "$repoRoot\nuget" | ||
} | ||
Write-Host "nuget.exe not found. Downloading to $nugetPath" | ||
Invoke-WebRequest "https://nuget.org/nuget.exe" -OutFile $nugetPath | ||
} | ||
} | ||
|
||
Write-Host "** Building all NuGet packages. **" | ||
foreach ($file in [System.IO.Directory]::EnumerateFiles("$repoRoot\src", "project.json", "AllDirectories")) { | ||
Write-Host "Creating NuGet package for $file..." | ||
Invoke-Expression "$dotnetExePath pack $file -c $Configuration -o $packagesPath" | ||
|
||
if (!$?) { | ||
Write-Error "Failed to create NuGet package for project $file" | ||
} | ||
} | ||
|
||
if ($ApiKey) | ||
{ | ||
Ensure-Nuget-Exists | ||
foreach ($file in [System.IO.Directory]::EnumerateFiles("$packagesPath", "*.nupkg")) { | ||
try { | ||
Write-Host "Pushing package $file to MyGet..." | ||
$arguments = "push $file $apiKey -Source https://dotnet.myget.org/F/dotnet-corefxlab/api/v2/package" | ||
Start-Process -FilePath $nugetPath -ArgumentList $arguments -Wait -PassThru | ||
Write-Host "done" | ||
} catch [System.Exception] { | ||
Write-Host "Failed to push nuget package $file with error $_.Exception.Message" | ||
} | ||
} | ||
} |