-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.targets
More file actions
142 lines (138 loc) · 9.98 KB
/
Copy pathbuild.targets
File metadata and controls
142 lines (138 loc) · 9.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GeneratorPlatform Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))">windows</GeneratorPlatform>
<GeneratorPlatform Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))">linux</GeneratorPlatform>
<GeneratorPlatform Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))">osx</GeneratorPlatform>
</PropertyGroup>
<!-- Windows -->
<Target Name="KYGeneratorWindowsBeforeTarget"
BeforeTargets="BeforeBuild"
Condition="$(GeneratorPlatform) == 'windows'">
<Error Text=".NET 5 is no longer supported by KY.Generator. .NET 5 reached end-of-life on 2022-05-10. Use KY.Generator v9 or below for .NET 5 projects, or upgrade the project to .NET 6 or newer."
Condition="$(TargetFramework) == 'net5.0'" />
<Exec Command="dotnet --version" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="FrameworkRaw" />
</Exec>
<Error Text=".NET 5 SDK is no longer supported by KY.Generator. .NET 5 reached end-of-life on 2022-05-10. Use KY.Generator v9 or below if you need to run on the .NET 5 SDK, or upgrade your SDK to .NET 6 or newer."
Condition="$(FrameworkRaw.StartsWith('5.'))" />
<PropertyGroup>
<Framework>net462</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('2.'))">netcoreapp2.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('3.'))">netcoreapp3.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('6.'))">net6.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('7.'))">net7.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('8.'))">net8.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('9.'))">net9.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('10.'))">net10.0</Framework>
</PropertyGroup>
<Exec Command="%22$(MSBuildThisFileDirectory)..\tools\$(Framework)\KY.Generator.exe%22 readid -solution=%22$(SolutionPath)%22 -project=%22$(ProjectPath)%22 msbuild beforeBuild set -output=%22$(ProjectDir)\%22 load -assembly=%22$(TargetPath)%22 fluent"
Condition="$(Framework) != 'netcoreapp2.0'"
CustomErrorRegularExpression="^Error:"
CustomWarningRegularExpression="^Warning:">
</Exec>
<Exec Command="dotnet %22$(MSBuildThisFileDirectory)..\tools\$(Framework)\KY.Generator.dll%22 readid -solution=%22$(SolutionPath)%22 -project=%22$(ProjectPath)%22 msbuild beforeBuild set -output=%22$(ProjectDir)\%22 load -assembly=%22$(TargetPath)%22 fluent"
Condition="$(Framework) == 'netcoreapp2.0'"
CustomErrorRegularExpression="^Error:"
CustomWarningRegularExpression="^Warning:">
</Exec>
</Target>
<Target Name="KYGeneratorWindowsAfterTarget"
AfterTargets="AfterBuild"
Condition="$(GeneratorPlatform) == 'windows'">
<Exec Command="%22$(MSBuildThisFileDirectory)..\tools\$(Framework)\KY.Generator.exe%22 readid -solution=%22$(SolutionPath)%22 -project=%22$(ProjectPath)%22 msbuild set -output=%22$(ProjectDir)\%22 load -assembly=%22$(TargetPath)%22 fluent annotation"
Condition="$(Framework) != 'netcoreapp2.0'"
CustomErrorRegularExpression="^Error:"
CustomWarningRegularExpression="^Warning:">
</Exec>
<Exec Command="dotnet %22$(MSBuildThisFileDirectory)..\tools\$(Framework)\KY.Generator.dll%22 readid -solution=%22$(SolutionPath)%22 -project=%22$(ProjectPath)%22 msbuild set -output=%22$(ProjectDir)\%22 load -assembly=%22$(TargetPath)%22 fluent annotation"
Condition="$(Framework) == 'netcoreapp2.0'"
CustomErrorRegularExpression="^Error:"
CustomWarningRegularExpression="^Warning:">
</Exec>
</Target>
<!-- Linux -->
<Target Name="KYGeneratorLinuxBeforeTarget"
BeforeTargets="BeforeBuild"
Condition="$(GeneratorPlatform) == 'linux'">
<Error Text=".NET 5 is no longer supported by KY.Generator. .NET 5 reached end-of-life on 2022-05-10. Use KY.Generator v9 or below for .NET 5 projects, or upgrade the project to .NET 6 or newer."
Condition="$(TargetFramework) == 'net5.0'" />
<Exec Command="dotnet --version" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="FrameworkRaw" />
</Exec>
<Error Text=".NET 5 SDK is no longer supported by KY.Generator. .NET 5 reached end-of-life on 2022-05-10. Use KY.Generator v9 or below if you need to run on the .NET 5 SDK, or upgrade your SDK to .NET 6 or newer."
Condition="$(FrameworkRaw.StartsWith('5.'))" />
<PropertyGroup>
<Framework>none</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('2.'))">netcoreapp2.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('3.'))">netcoreapp3.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('6.'))">net6.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('7.'))">net7.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('8.'))">net8.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('9.'))">net9.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('10.'))">net10.0</Framework>
</PropertyGroup>
<Exec Command="dotnet %22$(MSBuildThisFileDirectory)../tools/$(Framework)/KY.Generator.dll%22 readid -solution=%22$(SolutionPath)%22 -project=%22$(ProjectPath)%22 msbuild beforeBuild set -output=%22$(ProjectDir)%22 load -assembly=%22$(TargetPath)%22 fluent"
Condition="$(Framework) != 'none'"
CustomErrorRegularExpression="^Error:"
CustomWarningRegularExpression="^Warning:">
</Exec>
<Message Text="No matching .net framework found. Install at least .net core 2.0"
Condition="$(Framework) == 'none'">
</Message>
</Target>
<Target Name="KYGeneratorLinuxAfterTarget"
AfterTargets="AfterBuild"
Condition="$(GeneratorPlatform) == 'linux'">
<Exec Command="dotnet %22$(MSBuildThisFileDirectory)../tools/$(Framework)/KY.Generator.dll%22 readid -solution=%22$(SolutionPath)%22 -project=%22$(ProjectPath)%22 msbuild set -output=%22$(ProjectDir)%22 load -assembly=%22$(TargetPath)%22 fluent annotation"
Condition="$(Framework) != 'none'"
CustomErrorRegularExpression="^Error:"
CustomWarningRegularExpression="^Warning:">
</Exec>
<Message Text="No matching .net framework found. Install at least .net core 2.0"
Condition="$(Framework) == 'none'">
</Message>
</Target>
<!-- OSX -->
<Target Name="KYGeneratorOsxBeforeTarget"
BeforeTargets="BeforeBuild"
Condition="$(GeneratorPlatform) == 'osx'">
<Error Text=".NET 5 is no longer supported by KY.Generator. .NET 5 reached end-of-life on 2022-05-10. Use KY.Generator v9 or below for .NET 5 projects, or upgrade the project to .NET 6 or newer."
Condition="$(TargetFramework) == 'net5.0'" />
<Exec Command="dotnet --version" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="FrameworkRaw" />
</Exec>
<Error Text=".NET 5 SDK is no longer supported by KY.Generator. .NET 5 reached end-of-life on 2022-05-10. Use KY.Generator v9 or below if you need to run on the .NET 5 SDK, or upgrade your SDK to .NET 6 or newer."
Condition="$(FrameworkRaw.StartsWith('5.'))" />
<PropertyGroup>
<Framework>none</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('2.'))">netcoreapp2.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('3.'))">netcoreapp3.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('6.'))">net6.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('7.'))">net7.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('8.'))">net8.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('9.'))">net9.0</Framework>
<Framework Condition="$(FrameworkRaw.StartsWith('10.'))">net10.0</Framework>
</PropertyGroup>
<Exec Command="dotnet %22$(MSBuildThisFileDirectory)../tools/$(Framework)/KY.Generator.dll%22 readid -solution=%22$(SolutionPath)%22 -project=%22$(ProjectPath)%22 msbuild beforeBuild set -output=%22$(ProjectDir)%22 load -assembly=%22$(TargetPath)%22 fluent"
Condition="$(Framework) != 'none'"
CustomErrorRegularExpression="^Error:"
CustomWarningRegularExpression="^Warning:">
</Exec>
<Message Text="No matching .net framework found. Install at least .net core 2.0"
Condition="$(Framework) == 'none'">
</Message>
</Target>
<Target Name="KYGeneratorOsxAfterTarget"
AfterTargets="AfterBuild"
Condition="$(GeneratorPlatform) == 'osx'">
<Exec Command="dotnet %22$(MSBuildThisFileDirectory)../tools/$(Framework)/KY.Generator.dll%22 readid -solution=%22$(SolutionPath)%22 -project=%22$(ProjectPath)%22 msbuild set -output=%22$(ProjectDir)%22 load -assembly=%22$(TargetPath)%22 fluent annotation"
Condition="$(Framework) != 'none'"
CustomErrorRegularExpression="^Error:"
CustomWarningRegularExpression="^Warning:">
</Exec>
<Message Text="No matching .net framework found. Install at least .net core 2.0"
Condition="$(Framework) == 'none'">
</Message>
</Target>
</Project>