5
5
<TargetFrameworks >netstandard2.0;net46</TargetFrameworks >
6
6
<AssemblyName >Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator</AssemblyName >
7
7
<RootNamespace >Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator</RootNamespace >
8
- <BuildOutputTargetFolder >tools</BuildOutputTargetFolder >
8
+ <IncludeBuildOutput >false</IncludeBuildOutput >
9
+ <IsPackable >true</IsPackable >
10
+ <DisableImplicitNamespaceImports >true</DisableImplicitNamespaceImports >
11
+ </PropertyGroup >
12
+
13
+ <!-- MSBuild extension props -->
14
+ <PropertyGroup >
9
15
<CopyLocalLockFileAssemblies >true</CopyLocalLockFileAssemblies >
10
16
<AutoGenerateBindingRedirects >true</AutoGenerateBindingRedirects >
11
17
<GenerateBindingRedirectsOutputType >true</GenerateBindingRedirectsOutputType >
12
- <IsPackable >true</IsPackable >
13
- <BeforePack >PackReferenceAssemblies</BeforePack >
14
- <DisableImplicitNamespaceImports >true</DisableImplicitNamespaceImports >
18
+ <DevelopmentDependency >true</DevelopmentDependency >
19
+ <SuppressDependenciesWhenPacking >true</SuppressDependenciesWhenPacking >
15
20
</PropertyGroup >
16
21
17
22
<ItemGroup >
18
- <ConsoleProject Include =" ..\ExtensionsMetadataGenerator.Console\ExtensionsMetadataGenerator.Console.csproj" />
23
+ <!-- Explicitly set TFM to net6.0 as auto-resolution will fail with incompatible TFM. -->
24
+ <!-- https://github.com/Microsoft/msbuild/issues/2399 -->
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'" />
19
32
</ItemGroup >
20
33
21
- <Target Name =" BuildGeneratorConsole" Condition =" '$(TargetFramework)' == 'netstandard2.0'" AfterTargets =" Build" >
22
- <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 >
23
47
</Target >
24
48
25
49
<ItemGroup >
26
- <Content Include =" Targets\**\ *" Pack =" true" PackagePath =" build" />
50
+ <Content Include =" Targets/* *" Pack =" true" PackagePath =" build" />
27
51
</ItemGroup >
28
52
29
53
<Target Name =" UpdateRuntimeAssemblies" BeforeTargets =" Build" >
30
54
<Exec Command =" pwsh ./updateruntimeassemblies.ps1" Condition =" '$(OS)' == 'Unix' " />
31
- <Exec Command =" powershell.exe -command .\ updateruntimeassemblies.ps1" Condition =" '$(OS)' == 'Windows_NT' " />
55
+ <Exec Command =" powershell.exe -command ./ updateruntimeassemblies.ps1" Condition =" '$(OS)' == 'Windows_NT' " />
32
56
</Target >
33
57
34
- <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
+
35
63
<ItemGroup >
36
- <Content Include =" $(OutputPath)\netstandard2.0\generator\*" Pack =" true" PackagePath =" tools\netstandard2.0\generator" />
37
64
<Content
38
- Include =" $(OutputPath)\netstandard2.0\*.dll"
39
- Exclude =" **\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.dll"
65
+ Include =" @(_InnerOutputFiles)"
40
66
Pack =" true"
41
- PackagePath =" tools\netstandard2.0\ " />
67
+ PackagePath =" tools/%(_InnerOutputFiles.PackagePath) " />
42
68
</ItemGroup >
43
69
</Target >
44
70
57
83
</ItemGroup >
58
84
59
85
<ItemGroup Condition =" '$(TargetFramework)' == 'netstandard2.0'" >
60
- <PackageReference Include =" System.Runtime.Loader" Version =" 4.3.0" />
86
+ <PackageReference Include =" System.Runtime.Loader" Version =" 4.3.0" PrivateAssets = " all " />
61
87
</ItemGroup >
88
+
89
+ <Target Name =" RemoveFrameworkDependencies" AfterTargets =" _WalkEachTargetPerFramework" >
90
+ <ItemGroup >
91
+ <_FrameworkAssemblyReferences Remove =" @(_FrameworkAssemblyReferences)" />
92
+ </ItemGroup >
93
+ </Target >
94
+
95
+ <Target Name =" GetOutputFiles" Returns =" @(_OutputFiles)" >
96
+ <ItemGroup >
97
+ <_OutputFiles Include =" $(OutputPath)**/*.dll" Exclude =" $(OutputPath)**/Microsoft.Build.*.dll" />
98
+ <_OutputFiles Include =" $(OutputPath)**/*.dll.config" />
99
+ <_OutputFiles Include =" $(OutputPath)**/*.exe" />
100
+ <_OutputFiles Include =" $(OutputPath)**/*.json" />
101
+ <_OutputFiles Update =" @(_OutputFiles)" PackagePath =" $([System.IO.Path]::Combine($(TargetFramework), %(RecursiveDir)))" />
102
+ </ItemGroup >
103
+ </Target >
104
+
62
105
</Project >
0 commit comments