1
1
<Project Sdk =" Microsoft.NET.Sdk" InitialTargets =" UpdateRuntimeAssemblies" >
2
2
<Import Project =" ..\..\build\metadatagenerator.props" />
3
+
3
4
<PropertyGroup >
4
5
<Version >4.0.2</Version >
5
6
<OutputType >Library</OutputType >
6
7
<TargetFrameworks >netstandard2.0;net46</TargetFrameworks >
7
8
<AssemblyName >Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator</AssemblyName >
8
9
<RootNamespace >Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator</RootNamespace >
9
- <BuildOutputTargetFolder >tools</BuildOutputTargetFolder >
10
+ <IncludeBuildOutput >false</IncludeBuildOutput >
11
+ <IsPackable >true</IsPackable >
12
+ <DisableImplicitNamespaceImports >true</DisableImplicitNamespaceImports >
13
+ </PropertyGroup >
14
+
15
+ <!-- MSBuild extension props -->
16
+ <PropertyGroup >
10
17
<CopyLocalLockFileAssemblies >true</CopyLocalLockFileAssemblies >
11
18
<AutoGenerateBindingRedirects >true</AutoGenerateBindingRedirects >
12
19
<GenerateBindingRedirectsOutputType >true</GenerateBindingRedirectsOutputType >
13
- <IsPackable >true</IsPackable >
14
- <BeforePack >PackReferenceAssemblies</BeforePack >
15
- <DisableImplicitNamespaceImports >true</DisableImplicitNamespaceImports >
20
+ <DevelopmentDependency >true</DevelopmentDependency >
16
21
</PropertyGroup >
17
22
18
23
<ItemGroup >
19
- <ConsoleProject Include =" ..\ExtensionsMetadataGenerator.Console\ExtensionsMetadataGenerator.Console.csproj" />
24
+ <!-- Explicitly set TFM to net6.0 as auto-resolution will fail with incompatible TFM -->
25
+ <ProjectReference
26
+ Include =" ../ExtensionsMetadataGenerator.Console/ExtensionsMetadataGenerator.Console.csproj"
27
+ ReferenceOutputAssembly =" false"
28
+ PrivateAssets =" all"
29
+ Private =" false"
30
+ SetTargetFramework =" TargetFramework=net6.0"
31
+ Condition =" '$(TargetFramework)' == 'netstandard2.0'" />
20
32
</ItemGroup >
21
33
22
- <Target Name =" BuildGeneratorConsole" Condition =" '$(TargetFramework)' == 'netstandard2.0'" AfterTargets =" Build" >
23
- <MSBuild Projects =" @(ConsoleProject)" Targets =" Restore;Build" Properties =" Configuration=$(Configuration);Platform=$(Platform);TargetFramework=netcoreapp2.0;OutputPath=$(OutputPath)\generator" />
34
+ <Target Name =" _IncludeConsoleReferences" BeforeTargets =" AssignTargetPaths" Condition =" '$(TargetFramework)' == 'netstandard2.0'" >
35
+ <MSBuild Projects =" @(ProjectReference)" Targets =" GetTargetPath" >
36
+ <Output TaskParameter =" TargetOutputs" PropertyName =" _ConsoleOutputPath" />
37
+ </MSBuild >
38
+
39
+ <PropertyGroup >
40
+ <_ConsoleOutputPath >$([System.IO.Path]::GetDirectoryName($(_ConsoleOutputPath)))</_ConsoleOutputPath >
41
+ </PropertyGroup >
42
+
43
+ <ItemGroup >
44
+ <_ConsoleFiles Include =" $(_ConsoleOutputPath)/*" />
45
+ <None Include =" @(_ConsoleFiles)" Link =" generator/%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory =" PreserveNewest" />
46
+ </ItemGroup >
24
47
</Target >
25
48
26
49
<ItemGroup >
27
- <Content Include =" Targets\**\*" >
28
- <Pack >true</Pack >
29
- <PackagePath >build</PackagePath >
30
- </Content >
50
+ <Content Include =" Targets/**" Pack =" true" PackagePath =" build" />
31
51
</ItemGroup >
32
52
33
53
<Target Name =" UpdateRuntimeAssemblies" BeforeTargets =" Build" >
34
54
<Exec Command =" pwsh ./updateruntimeassemblies.ps1" Condition =" '$(OS)' == 'Unix' " />
35
- <Exec Command =" powershell.exe -command .\ updateruntimeassemblies.ps1" Condition =" '$(OS)' == 'Windows_NT' " />
55
+ <Exec Command =" powershell.exe -command ./ updateruntimeassemblies.ps1" Condition =" '$(OS)' == 'Windows_NT' " />
36
56
</Target >
37
57
38
- <Target Name =" PackReferenceAssemblies" >
58
+ <Target Name =" _CollectRuntimeDependencies" DependsOnTargets =" _ComputeTargetFrameworkItems" BeforeTargets =" _GetPackageFiles" >
59
+ <MSBuild Projects =" @(_InnerBuildProjects)" Targets =" GetOutputFiles" >
60
+ <Output TaskParameter =" TargetOutputs" ItemName =" _InnerOutputFiles" />
61
+ </MSBuild >
62
+
39
63
<ItemGroup >
40
- <Content Include =" $(OutputPath)\netstandard2.0\generator\*" >
41
- <Pack >true</Pack >
42
- <PackagePath >tools\netstandard2.0\generator</PackagePath >
43
- </Content >
44
- <Content Include =" $(OutputPath)\netstandard2.0\*.dll" Exclude =" **\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.dll" >
45
- <Pack >true</Pack >
46
- <PackagePath >tools\netstandard2.0\</PackagePath >
47
- </Content >
64
+ <Content
65
+ Include =" @(_InnerOutputFiles)"
66
+ Pack =" true"
67
+ PackagePath =" tools/%(_InnerOutputFiles.PackagePath)" />
48
68
</ItemGroup >
49
69
</Target >
50
70
73
93
<ItemGroup Condition =" '$(TargetFramework)' == 'netstandard2.0'" >
74
94
<PackageReference Include =" System.Runtime.Loader" >
75
95
<Version >4.3.0</Version >
96
+ <PrivateAssets >all</PrivateAssets >
76
97
</PackageReference >
77
98
</ItemGroup >
99
+
100
+ <Target Name =" RemoveFrameworkDependencies" AfterTargets =" _WalkEachTargetPerFramework" >
101
+ <ItemGroup >
102
+ <_FrameworkAssemblyReferences Remove =" @(_FrameworkAssemblyReferences)" />
103
+ </ItemGroup >
104
+ </Target >
105
+
106
+ <Target Name =" GetOutputFiles" Returns =" @(_OutputFiles)" >
107
+ <ItemGroup >
108
+ <_OutputFiles Include =" $(OutputPath)**/*.dll" Exclude =" $(OutputPath)**/Microsoft.Build.*.dll" />
109
+ <_OutputFiles Include =" $(OutputPath)**/*.dll.config" />
110
+ <_OutputFiles Include =" $(OutputPath)**/*.exe" />
111
+ <_OutputFiles Include =" $(OutputPath)**/*.json" />
112
+ <_OutputFiles Update =" @(_OutputFiles)" PackagePath =" $([System.IO.Path]::Combine($(TargetFramework), %(RecursiveDir)))" />
113
+ </ItemGroup >
114
+ </Target >
115
+
78
116
</Project >
0 commit comments