Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 19ea17a

Browse files
committed
Add a "GenerateReferenceAssembly" target and generate four assemblies.
* The GenerateReferenceAssembly target can be run as a manual step on a project. When run, it produces a source code file <Assembly>.cs, in the reference assembly folder for the library. This source file can be used to compile an equivalent reference assembly. * Use the target to generate reference assemblies for the following libraries: * System.Collections.Immutable * System.Reflection.Metadata * System.Threading.Tasks.Dataflow * System.Threading.Tasks.Extensions
1 parent 7d69f67 commit 19ea17a

15 files changed

+5037
-0
lines changed

dir.targets

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,15 @@
110110
<Message Importance="High" Condition="'$(ConfigurationErrorMsg)' != ''" Text="$(MSBuildProjectFullPath) ConfigurationErrorMessage: $(ConfigurationErrorMsg)" />
111111
</Target>
112112

113+
<Target Name="GenerateReferenceAssembly">
114+
<PropertyGroup>
115+
<_GenApiExePath>$(ToolsDir)GenApi.exe</_GenApiExePath>
116+
<_RefSourceFileOutputPath>$(MSBuildProjectDirectory)/../ref/$(AssemblyName).cs</_RefSourceFileOutputPath>
117+
<_DefaultDocIdsTxtPath>$(MSBuildThisFileDirectory)tools-local/DefaultGenApiDocIds.txt</_DefaultDocIdsTxtPath>
118+
<_LicenseHeaderTxtPath>$(MSBuildThisFileDirectory)tools-local/LicenseHeader.txt</_LicenseHeaderTxtPath>
119+
</PropertyGroup>
120+
<Exec Command="$(DotnetToolCommand) $(_GenApiExePath) -assembly:$(TargetPath) -libPath:$(RefPath) -out:$(_RefSourceFileOutputPath) -excludeAttributesList:$(_DefaultDocIdsTxtPath) -headerFile:$(_LicenseHeaderTxtPath)" />
121+
<Message Text="Generated reference assembly source code: $(_RefSourceFileOutputPath)" />
122+
</Target>
123+
113124
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<PackageConfigurations>
5+
netstandard1.0;
6+
netstandard;
7+
</PackageConfigurations>
8+
<BuildConfigurations>
9+
$(PackageConfigurations);
10+
netcoreapp;
11+
uap-Windows_NT;
12+
</BuildConfigurations>
13+
</PropertyGroup>
14+
</Project>

src/System.Collections.Immutable/ref/System.Collections.Immutable.cs

Lines changed: 1048 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
5+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
6+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
7+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
8+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.0-Debug|AnyCPU'" />
9+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.0-Release|AnyCPU'" />
10+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
12+
<ItemGroup>
13+
<Compile Include="System.Collections.Immutable.cs" />
14+
</ItemGroup>
15+
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp' Or '$(TargetGroup)' == 'uap'">
16+
<ProjectReference Include="..\..\System.Collections\ref\System.Collections.csproj" />
17+
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
18+
</ItemGroup>
19+
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard1.0'">
20+
<Reference Include="System.Runtime" />
21+
<Reference Include="System.Collections" />
22+
</ItemGroup>
23+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
24+
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<PackageConfigurations>
5+
netstandard1.1;
6+
netstandard;
7+
</PackageConfigurations>
8+
<BuildConfigurations>
9+
$(PackageConfigurations);
10+
netcoreapp;
11+
uap-Windows_NT;
12+
</BuildConfigurations>
13+
</PropertyGroup>
14+
</Project>

src/System.Reflection.Metadata/ref/System.Reflection.Metadata.cs

Lines changed: 3429 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6+
<CLSCompliant>false</CLSCompliant>
7+
</PropertyGroup>
8+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
9+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
10+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
12+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Debug|AnyCPU'" />
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.1-Release|AnyCPU'" />
14+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
15+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
16+
<ItemGroup>
17+
<Compile Include="System.Reflection.Metadata.cs" />
18+
</ItemGroup>
19+
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp' Or '$(TargetGroup)' == 'uap'">
20+
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
21+
<ProjectReference Include="..\..\System.Collections.Immutable\ref\System.Collections.Immutable.csproj" />
22+
</ItemGroup>
23+
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard1.1'">
24+
<Reference Include="System.IO" />
25+
<Reference Include="System.Reflection.Primitives" />
26+
<Reference Include="System.Runtime" />
27+
<Reference Include="System.Text.Encoding" />
28+
</ItemGroup>
29+
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard' Or '$(TargetGroup)' == 'netstandard1.1'">
30+
<ProjectReference Include="..\..\System.Collections.Immutable\ref\System.Collections.Immutable.csproj" />
31+
</ItemGroup>
32+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
33+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<BuildConfigurations>
5+
netstandard1.0;
6+
netstandard1.1;
7+
netstandard;
8+
</BuildConfigurations>
9+
</PropertyGroup>
10+
</Project>

0 commit comments

Comments
 (0)