-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example build script that finds the latest RefTrim package to avo…
…id chicken-and-egg problem finding the package. Dogfood the public package in this repo's builds.
- Loading branch information
Showing
4 changed files
with
35 additions
and
11 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
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,23 @@ | ||
@echo off | ||
@rem Builds with ReferenceTrimmer C# and C++ modes | ||
@rem Assumes RefTrim is wired into Directory.Build.props or Directory.Packages.props as a global package reference. | ||
@rem Usage: BuildWithReferenceTrimmer [msbuild args] | ||
setlocal EnableDelayedExpansion | ||
|
||
@rem Explicitly turn on in case the repo is defaulting to false. | ||
set EnableReferenceTrimmer=true | ||
|
||
@echo Restoring with ReferenceTrimmer enabled | ||
call msbuild /t:Restore | ||
|
||
@rem Find the RefTrim latest package in the package store. | ||
set NuGetPkgBase=%NUGET_PACKAGES% | ||
if "%NuGetPkgBase%"=="" set NuGetPkgBase=%USERPROFILE%\.nuget\packages | ||
set RefTrimPkgBase=%NuGetPkgBase%\ReferenceTrimmer | ||
for /d %%d in (%RefTrimPkgBase%\*) do set RefTrimPkg=%%d | ||
set MSBuildLoggerParam=-distributedlogger:CentralLogger,%RefTrimPkg%\build\ReferenceTrimmer.Loggers.dll*ForwardingLogger,%RefTrimPkg%\build\ReferenceTrimmer.Loggers.dll | ||
|
||
@echo Building with ReferenceTrimmer C# and C++ logger. | ||
set cmd=msbuild %MSBuildLoggerParam% %* | ||
echo %cmd% | ||
call %cmd% |
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