-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Microsoft.AspNetCore.BuildTools.ApiCheck to builds
- aspnet/KoreBuild#143 Add Microsoft.AspNetCore.BuildTools.ApiCheck.Task project - include task assembly in the Microsoft.AspNetMicrosoft.AspNetCore.BuildTools.ApiCheck package - add *.props and *.targets files to hook task into `Pack` target; runs just before .nupkg is created - reference Microsoft.AspNetMicrosoft.AspNetCore.BuildTools.ApiCheck project from the Sdk project - requires lots of hacks; dotnet/sdk#939 workarounds fail in this scenario - bump ApiCheck package version Improve project-to-project reference and native assembly handling - avoid `FileNotFoundException` in `AssemblyLoadContext.GetAssemblyName()` due to `\placeholder\` paths - catch and ignore `BadImageFormatException` in `AssemblyLoadContext.GetAssemblyName()` - avoid `InvalidOperationException` in `PackageGraph.RuntimeIsCompatible()` due to missing .sha512 file Fall back to `RuntimeTargets` when `RuntimeAssemblies` yields no assemblies Change ApiCheck.exe's options and output - add `api-check --compact-output` option - generally make tool's output more useful to the task - catch and log `FileNotFoundException`; output types and stack traces of caught `Exception`s - change ApiCheck.exe option from `--ApiListing` to `--api-listing` for consistency w/ other options Use Microsoft.Extensions.CommandLineUtils.Sources package - VersionTool project cannot do this because it has `public` properties of these `internal` types Update appveyor.yml now that VS 2017 RC image is no more nits: - remove `PackageGraph.RuntimeIsCompatible()` `candidateRuntime` parameter - not needed and confusingly-named; passed value included in `compatibleRuntimes` - update solution to use current project type GUID - ignore global.json and launchSettings.json - make some Linq a bit more readable - whitespace and `using` cleanup - move all property groups above item groups in Microsoft.AspNetMicrosoft.AspNetCore.BuildTools.ApiCheck.csproj - make a couple of constructors `private`; used only in `public static` methods - ignore case a bit more - remove duplicate `<PropertyGroup>` from `NugetReferenceResolver` project - get this repo building on Linux - don't need API checks in this repo - centralize a few more properties in dependencies.props notes: - don't use `UseCommandProcessor==true`; `ToolTask` writes out .cmd file with a BOM that cmd.exe hates
- Loading branch information
Showing
32 changed files
with
539 additions
and
115 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 |
---|---|---|
|
@@ -19,3 +19,5 @@ project.lock.json | |
.build | ||
.vs/ | ||
.vscode/ | ||
global.json | ||
launchSettings.json |
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 |
---|---|---|
|
@@ -11,4 +11,4 @@ build_script: | |
clone_depth: 1 | ||
test: off | ||
deploy: off | ||
os: Visual Studio 2017 RC | ||
os: Visual Studio 2017 |
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
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,30 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos and are not intended | ||
for use outside of Microsoft. | ||
--> | ||
<Project> | ||
<Target Name="ApiCheck" Condition=" '$(EnableApiCheck)' == 'true' "> | ||
<PropertyGroup> | ||
<_ApiListingFileSuffix Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">net45.json</_ApiListingFileSuffix> | ||
<_ApiListingFileSuffix Condition=" '$(_ApiListingFileSuffix)' == '' ">netcore.json</_ApiListingFileSuffix> | ||
<_ApiListingFilePath>$(MSBuildProjectDirectory)\baseline.$(_ApiListingFileSuffix)</_ApiListingFilePath> | ||
<_ApiExclusionsFilePath>$(MSBuildProjectDirectory)\exceptions.$(_ApiListingFileSuffix)</_ApiExclusionsFilePath> | ||
<_ApiListingFile Condition=" Exists('$(_ApiListingFilePath)') ">$(_ApiListingFilePath)</_ApiListingFile> | ||
<_ApiExclusionsFile Condition=" Exists('$(_ApiExclusionsFilePath)') ">$(_ApiExclusionsFilePath)</_ApiExclusionsFile> | ||
</PropertyGroup> | ||
|
||
<Message Condition=" '$(_ApiListingFile)' != '' " | ||
Importance="normal" | ||
Text="Checking for breaking changes in $(MSBuildProjectName), $(TargetFramework)" /> | ||
<ApiCheckTask Condition=" '$(_ApiListingFile)' != '' " | ||
ApiListingPath="$(_ApiListingFile)" | ||
AssemblyPath="$(TargetPath)" | ||
Framework="$(TargetFramework)" | ||
ExcludePublicInternalTypes="$(ExcludePublicInternalTypes_InApiCheck)" | ||
ExclusionsPath="$(_ApiExclusionsFile)" | ||
ProjetAssetsPath="$(ProjectAssetsFile)" /> | ||
|
||
<Warning Condition=" '$(_ApiListingFile)' == '' " | ||
Text="No baseline file for $(TargetFramework) found in $(MSBuildProjectName)." /> | ||
</Target> | ||
</Project> |
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
17 changes: 17 additions & 0 deletions
17
src/Internal.AspNetCore.Sdk/buildMultiTargeting/ApiCheck.targets
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 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos and are not intended | ||
for use outside of Microsoft. | ||
--> | ||
<Project> | ||
<Target Name="ApiCheck" Condition=" '$(EnableApiCheck)' == 'true' "> | ||
<ItemGroup> | ||
<_TargetFrameworks Remove="@(_TargetFrameworks)" /> | ||
<_TargetFrameworks Include="$(TargetFrameworks)" /> | ||
</ItemGroup> | ||
|
||
<MSBuild Projects="$(MSBuildProjectFullPath)" | ||
Targets="ApiCheck" | ||
Properties="TargetFramework=%(_TargetFrameworks.Identity)" | ||
RemoveProperties="TargetFrameworks" /> | ||
</Target> | ||
</Project> |
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 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos and are not intended | ||
for use outside of Microsoft. | ||
--> | ||
<Project> | ||
<!-- Set nothing if handled in project file or already done in outer build. --> | ||
<PropertyGroup> | ||
<!-- Unconditionally disable API checks if running in .NET Framework MSBuild. Task cannot run there. --> | ||
<EnableApiCheck Condition=" '$(MSBuildRuntimeType)' != 'Core' ">false</EnableApiCheck> | ||
|
||
<!-- Unconditionally disable API checks if task would use .NET Framework tool x-plat. --> | ||
<EnableApiCheck Condition=" '$(OS)' != 'Windows_NT' AND $(TargetFramework.StartsWith('net4')) ">false</EnableApiCheck> | ||
|
||
<!-- Unless overridden in the project or in one of the above situations, always do API checks. --> | ||
<EnableApiCheck Condition=" '$(EnableApiCheck)' == '' ">true</EnableApiCheck> | ||
|
||
<ExcludePublicInternalTypes_InApiCheck Condition=" '$(ExcludePublicInternalTypes_InApiCheck)' == '' ">true</ExcludePublicInternalTypes_InApiCheck> | ||
|
||
<!-- Hook API checks into Pack run, prior to creating the .nupkg but after build (if any). --> | ||
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);ApiCheck</GenerateNuspecDependsOn> | ||
</PropertyGroup> | ||
</Project> |
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
Oops, something went wrong.