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.
Merge pull request dotnet#416 from sokket/nuget
Adding files to generate a NuGet package for the System.Buffers on every official build
- Loading branch information
Showing
5 changed files
with
146 additions
and
1 deletion.
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
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,53 @@ | ||
@echo off | ||
setlocal | ||
|
||
:: Note: We've disabled node reuse because it causes file locking issues. | ||
:: The issue is that we extend the build with our own targets which | ||
:: means that that rebuilding cannot successfully delete the task | ||
:: assembly. | ||
|
||
if not defined VisualStudioVersion ( | ||
if defined VS140COMNTOOLS ( | ||
call "%VS140COMNTOOLS%\VsDevCmd.bat" | ||
goto :EnvSet | ||
) | ||
|
||
if defined VS120COMNTOOLS ( | ||
call "%VS120COMNTOOLS%\VsDevCmd.bat" | ||
goto :EnvSet | ||
) | ||
|
||
echo Error: build.cmd requires Visual Studio 2013 or 2015. | ||
echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/developer-guide.md for build instructions. | ||
exit /b 1 | ||
) | ||
|
||
:EnvSet | ||
|
||
:: Log build command line | ||
set _buildproj=%~dp0build.proj | ||
set _buildlog=%~dp0msbuild.log | ||
set _buildprefix=echo | ||
set _buildpostfix=^> "%_buildlog%" | ||
call :build %* | ||
|
||
:: Build | ||
set _buildprefix= | ||
set _buildpostfix= | ||
call :build %* | ||
|
||
goto :AfterBuild | ||
|
||
:build | ||
%_buildprefix% msbuild "src/System.Buffers/src/System.Buffers.csproj" /t:BuildPackages /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=normal;LogFile="%_buildlog%";Append %* %_buildpostfix% | ||
set BUILDERRORLEVEL=%ERRORLEVEL% | ||
goto :eof | ||
|
||
:AfterBuild | ||
|
||
echo. | ||
:: Pull the build summary from the log file | ||
findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%_buildlog%" | ||
echo Build Exit Code = %BUILDERRORLEVEL% | ||
|
||
exit /b %BUILDERRORLEVEL% |
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,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package > | ||
<metadata> | ||
<id>System.Buffers</id> | ||
<version>4.0.0-beta</version> | ||
<title>System.Buffers</title> | ||
<authors>Microsoft Corporation</authors> | ||
<owners>Microsoft Corporation</owners> | ||
<requireLicenseAcceptance>true</requireLicenseAcceptance> | ||
<licenseUrl>http://go.microsoft.com/fwlink/?LinkId=329770</licenseUrl> | ||
<projectUrl>http://go.microsoft.com/fwlink/?LinkId=518631</projectUrl> | ||
<iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl> | ||
<description>Pre-release of the System.Buffers namespace</description> | ||
<releaseNotes>Pre-release of the System.Buffers namespace</releaseNotes> | ||
<copyright>Copyright Microsoft Corporation 2015</copyright> | ||
<tags>System.Buffers BufferPool Buffer</tags> | ||
</metadata> | ||
<files> | ||
<file src="..\..\bin\Windows_NT.AnyCPU.Debug\System.Buffers\System.Buffers.dll" target="lib" /> | ||
<file src="..\..\bin\Windows_NT.AnyCPU.Debug\System.Buffers\System.Slices.dll" target="lib" /> | ||
</files> | ||
</package> |
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,53 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<ItemGroup> | ||
<PackagesNuSpecFiles Include="*.nuspec" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<PackagesOutDir Condition="'$(PackagesOutDir)' == ''">$(OutDir)Packages\</PackagesOutDir> | ||
<PackagesBasePath Condition="'$(PackagesBasePath)' == ''">$(OutDir)</PackagesBasePath> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<NuGetExe>"$(NuGetToolPath)"</NuGetExe> | ||
<NuGetBasePath>"$(PackagesBasePath.TrimEnd('\'))"</NuGetBasePath> | ||
<NuGetOutputDirectory>"$(PackagesOutDir.TrimEnd('\'))"</NuGetOutputDirectory> | ||
</PropertyGroup> | ||
|
||
<Target Name="BuildPackages" | ||
Condition="'$(SkipBuildPackages)' != 'true'"> | ||
|
||
<!-- Create package output directory --> | ||
<MakeDir Directories="$(PackagesOutDir)" /> | ||
|
||
<!-- Make package --> | ||
<!-- We ignore warnings because NuGet will warn when libraries are not placed | ||
in framework specific subfolders. Our build tools do this because the | ||
libraries are used during build, and do not depend on the framework being | ||
targeted by the build --> | ||
<!-- We trim the last backslash from properties which could end with one, | ||
to prevent it from escaping the closing quote --> | ||
<Exec | ||
Condition="'@(PackagesNuSpecFiles)'!=''" | ||
IgnoreStandardErrorWarningFormat="true" | ||
StandardOutputImportance="Low" | ||
Command="$(NuGetExe) pack "%(PackagesNuSpecFiles.FullPath)" -BasePath $(NuGetBasePath) -OutputDirectory $(NuGetOutputDirectory) $(ProductVersion)" /> | ||
|
||
<Message | ||
Condition="'@(PackagesNuSpecFiles)'!=''" | ||
Importance="High" | ||
Text="%(PackagesNuSpecFiles.Filename) NuGet Package -> $(PackagesOutDir)%(PackagesNuSpecFiles.Filename).%(PackagesNuSpecFiles.PackageVersion).nupkg" /> | ||
|
||
<ItemGroup> | ||
<PackagesForPublishing Include="$(PackagesOutDir)*.nupkg" /> | ||
</ItemGroup> | ||
|
||
<!-- push all packages to a server if one has been specified --> | ||
<Exec | ||
Condition="'@(PackagesForPublishing)' != '' and '$(PublishPackageSource)' != ''" | ||
Command="$(NuGetExe) push "%(PackagesForPublishing.Identity)" -s $(PublishPackageSource)" /> | ||
|
||
</Target> | ||
</Project> |