Skip to content
This repository was archived by the owner on Dec 12, 2020. It is now read-only.

Commit 6d800e9

Browse files
authored
TFM-agnostic BuildTime package, Attributes with less TFMs (#151)
* Rename Tasks project to BuildTime * Make BuildTime package TFM-agnostic * Make Attributes package target only netstandard1.0
1 parent 2b937a4 commit 6d800e9

8 files changed

Lines changed: 18 additions & 57 deletions

File tree

CONTRIBUTION.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/CodeGeneration.Roslyn.Attributes/CodeGeneration.Roslyn.Attributes.csproj

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>
5-
netstandard1.0;
6-
netstandard2.0;
7-
net40;
8-
net20;
9-
portable-net40+win8+wpa81;
10-
portable-net45+win8+wpa81+wp8
11-
</TargetFrameworks>
4+
<TargetFrameworks>netstandard1.0</TargetFrameworks>
125
<RootNamespace>CodeGeneration.Roslyn</RootNamespace>
136
<Description>A package that offers attributes to drive code generation.</Description>
147
</PropertyGroup>

src/CodeGeneration.Roslyn.Tasks/CodeGeneration.Roslyn.Tasks.csproj renamed to src/CodeGeneration.Roslyn.BuildTime/CodeGeneration.Roslyn.BuildTime.csproj

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
<Project Sdk="MSBuild.Sdk.Extras">
1+
<Project Sdk="Microsoft.Build.NoTargets">
22

33
<PropertyGroup>
4-
<TargetFrameworks>
5-
netstandard1.0;
6-
netstandard2.0;
7-
net40;
8-
net20;
9-
portable-net40+win8+wpa81;
10-
portable-net45+win8+wpa81+wp8
11-
</TargetFrameworks>
12-
<PackageId>CodeGeneration.Roslyn.BuildTime</PackageId>
4+
<TargetFramework>netstandard1.0</TargetFramework>
135
<Description>The build-time development dependency that generates code for a project that consumes code generation attributes.</Description>
14-
<IncludeBuildOutput>false</IncludeBuildOutput>
6+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
157
<DevelopmentDependency>true</DevelopmentDependency>
8+
<!--
9+
Min Version is 2.5 because that's when build/ folder support was introduced:
10+
https://docs.microsoft.com/en-us/nuget/release-notes/nuget-2.5#automatic-import-of-msbuild-targets-and-props-files
11+
-->
1612
<MinClientVersion>2.5</MinClientVersion>
13+
<IncludeBuildOutput>false</IncludeBuildOutput>
14+
<!-- Below is needed to make NuGet package TFM-oblivious -->
15+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
1716
</PropertyGroup>
1817

1918
<ItemGroup>
@@ -24,12 +23,4 @@
2423
</None>
2524
</ItemGroup>
2625

27-
<ItemDefinitionGroup>
28-
<PackageReference>
29-
<PrivateAssets>all</PrivateAssets>
30-
</PackageReference>
31-
<ProjectReference>
32-
<PrivateAssets>all</PrivateAssets>
33-
</ProjectReference>
34-
</ItemDefinitionGroup>
3526
</Project>

src/CodeGeneration.Roslyn.Tasks/build/CodeGeneration.Roslyn.BuildTime.props renamed to src/CodeGeneration.Roslyn.BuildTime/build/CodeGeneration.Roslyn.BuildTime.props

File renamed without changes.

src/CodeGeneration.Roslyn.Tasks/build/CodeGeneration.Roslyn.BuildTime.targets renamed to src/CodeGeneration.Roslyn.BuildTime/build/CodeGeneration.Roslyn.BuildTime.targets

File renamed without changes.
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Import Project="..\CodeGeneration.Roslyn.BuildTime\build\CodeGeneration.Roslyn.BuildTime.props" />
4+
25
<PropertyGroup>
36
<TargetFrameworks>net462;netcoreapp2.1</TargetFrameworks>
47
<GenerateCodeFromAttributesToolPathOverride>$(OutputPath)..\..\CodeGeneration.Roslyn.Tool\$(Configuration)\netcoreapp2.1\dotnet-codegen.dll</GenerateCodeFromAttributesToolPathOverride>
58
</PropertyGroup>
69

7-
<ItemGroup>
8-
<Compile Update="**\*.cs">
9-
<Generator>MSBuild:GenerateCodeFromAttributes</Generator>
10-
</Compile>
11-
</ItemGroup>
12-
1310
<ItemGroup>
1411
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(RoslynNugetVersion)" />
1512
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
@@ -23,7 +20,6 @@
2320

2421
<ItemGroup>
2522
<ProjectReference Include="..\CodeGeneration.Roslyn.Engine\CodeGeneration.Roslyn.Engine.csproj" />
26-
<ProjectReference Include="..\CodeGeneration.Roslyn.Tasks\CodeGeneration.Roslyn.Tasks.csproj" />
2723
<ProjectReference Include="..\CodeGeneration.Roslyn.Tests.Generators\CodeGeneration.Roslyn.Tests.Generators.csproj" />
2824
<ProjectReference Include="..\CodeGeneration.Roslyn.Tool\CodeGeneration.Roslyn.Tool.csproj">
2925
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
@@ -32,5 +28,6 @@
3228
</ProjectReference>
3329
</ItemGroup>
3430

35-
<Import Project="..\CodeGeneration.Roslyn.Tasks\build\CodeGeneration.Roslyn.BuildTime.targets" />
31+
<Import Project="..\CodeGeneration.Roslyn.BuildTime\build\CodeGeneration.Roslyn.BuildTime.targets" />
32+
3633
</Project>

src/CodeGeneration.Roslyn.sln

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
99
..\azure-pipeline.yml = ..\azure-pipeline.yml
1010
CodeGeneration.Roslyn.ruleset = CodeGeneration.Roslyn.ruleset
1111
CodeGeneration.Roslyn.Tests.ruleset = CodeGeneration.Roslyn.Tests.ruleset
12-
..\CONTRIBUTION.md = ..\CONTRIBUTION.md
1312
Directory.Build.props = Directory.Build.props
1413
global.json = global.json
1514
..\LICENSE.txt = ..\LICENSE.txt
@@ -23,7 +22,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGeneration.Roslyn.Attri
2322
EndProject
2423
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGeneration.Roslyn", "CodeGeneration.Roslyn\CodeGeneration.Roslyn.csproj", "{09465031-08F8-4632-9C26-AC561B6E3538}"
2524
EndProject
26-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGeneration.Roslyn.Tasks", "CodeGeneration.Roslyn.Tasks\CodeGeneration.Roslyn.Tasks.csproj", "{D5240C82-6F90-48F8-9192-DA53EE1B0355}"
25+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGeneration.Roslyn.BuildTime", "CodeGeneration.Roslyn.BuildTime\CodeGeneration.Roslyn.BuildTime.csproj", "{D5240C82-6F90-48F8-9192-DA53EE1B0355}"
2726
EndProject
2827
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGeneration.Roslyn.Tests", "CodeGeneration.Roslyn.Tests\CodeGeneration.Roslyn.Tests.csproj", "{D8E7323F-6721-42A5-BADA-496A63DB0A88}"
2928
EndProject

src/global.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"sdk": { "version": "2.1.500" },
33
"msbuild-sdks": {
4+
"Microsoft.Build.NoTargets": "1.0.73",
45
"MSBuild.Sdk.Extras": "1.6.65"
56
}
67
}

0 commit comments

Comments
 (0)