-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathMicrosoft.Build.Sql.csproj
More file actions
125 lines (112 loc) · 7.43 KB
/
Copy pathMicrosoft.Build.Sql.csproj
File metadata and controls
125 lines (112 loc) · 7.43 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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<IncludeBuildOutput>false</IncludeBuildOutput>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<!-- Default package version used for tests. Actual version set by pipeline. -->
<PackageVersion>1.0.0-test</PackageVersion>
<!-- Staging folder for constructing final NuGet package, assemblies are copied to tools/$(TargetFramework)/ -->
<SdkStagingDirectory>$(ArtifactsPath)\bin\$(AssemblyName)\$(Configuration)\$(AssemblyName)\</SdkStagingDirectory>
<SdkBinariesPath>$(SdkStagingDirectory)tools\$(TargetFramework)\</SdkBinariesPath>
<!-- NuGet Package Properties -->
<Authors>Microsoft</Authors>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<Description>This package contains the SDK for building SQL Database Projects (.sqlproj) in .NET.</Description>
<Owners>Microsoft</Owners>
<PackageIcon>images\nuspecicon.png</PackageIcon>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageProjectUrl>https://github.com/microsoft/DacFx</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>https://github.com/microsoft/DacFx/tree/main/release-notes/Microsoft.Build.Sql</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>dacfx sqlproj build sdk</PackageTags>
<PackageType>MSBuildSDK</PackageType>
<RepositoryBranch>main</RepositoryBranch>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/microsoft/DacFx</RepositoryUrl>
<Title>Microsoft SQL Database Project Build SDK</Title>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" />
<PackageReference Include="Microsoft.SqlServer.DacFx" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Data.SqlClient" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.SqlServer.Server" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.SqlServer.TransactSql.ScriptDom" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.SqlServer.Types" GeneratePathProperty="true" />
<PackageReference Include="NuGet.Versioning" GeneratePathProperty="true" />
<PackageReference Include="System.ComponentModel.Composition" GeneratePathProperty="true" />
<PackageReference Include="System.IO.Packaging" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.ApplicationInsights" GeneratePathProperty="true" />
</ItemGroup>
<Target Name="CopyNetCoreBinaries"
Condition="'$(IsCrossTargetingBuild)' != 'true' And '$(TargetFramework)' != 'net472'"
DependsOnTargets="ResolvePackageAssets"
BeforeTargets="Build">
<ItemGroup>
<PackageFilesNetCore Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net8.0\*.dll" />
<PackageFilesNetCore Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net8.0\*.targets" />
<PackageFilesNetCore Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net8.0\**\*.resources.dll" />
<PackageFilesNetCore Include="$(PkgMicrosoft_Data_SqlClient)\lib\net8.0\Microsoft.Data.SqlClient.dll" />
<PackageFilesNetCore Include="$(PkgMicrosoft_SqlServer_Server)\lib\netstandard2.0\Microsoft.SqlServer.Server.dll" />
<PackageFilesNetCore Include="$(PkgMicrosoft_SqlServer_TransactSql_ScriptDom)\lib\net8.0\Microsoft.SqlServer.TransactSql.ScriptDom.dll" />
<PackageFilesNetCore Include="$(PkgMicrosoft_SqlServer_Types)\lib\netstandard2.0\Microsoft.SqlServer.Types.dll" />
<PackageFilesNetCore Include="$(PkgSystem_ComponentModel_Composition)\lib\net8.0\System.ComponentModel.Composition.dll" />
<PackageFilesNetCore Include="$(PkgSystem_IO_Packaging)\lib\net8.0\System.IO.Packaging.dll" />
<PackageFilesNetCore Include="$(PkgMicrosoft_ApplicationInsights)\lib\netstandard2.0\Microsoft.ApplicationInsights.dll" />
</ItemGroup>
<Copy SourceFiles="@(PackageFilesNetCore)" DestinationFolder="$(SdkBinariesPath)\%(PackageFilesNetCore.RecursiveDir)" />
</Target>
<Target Name="CopyNetFrameworkBinaries"
Condition="'$(IsCrossTargetingBuild)' != 'true' And '$(TargetFramework)' == 'net472'"
DependsOnTargets="ResolvePackageAssets"
BeforeTargets="Build">
<ItemGroup>
<PackageFilesNetFramework Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net472\*.dll" />
<PackageFilesNetFramework Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net472\*.targets" />
<PackageFilesNetFramework Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net472\**\*.resources.dll" />
<PackageFilesNetFramework Include="$(PkgMicrosoft_Data_SqlClient)\lib\net462\Microsoft.Data.SqlClient.dll" />
<PackageFilesNetFramework Include="$(PkgMicrosoft_SqlServer_Server)\lib\net46\Microsoft.SqlServer.Server.dll" />
<PackageFilesNetFramework Include="$(PkgMicrosoft_SqlServer_TransactSql_ScriptDom)\lib\net472\Microsoft.SqlServer.TransactSql.ScriptDom.dll" />
<PackageFilesNetFramework Include="$(PkgMicrosoft_SqlServer_Types)\lib\net472\Microsoft.SqlServer.Types.dll" />
<PackageFilesNetFramework Include="$(PkgNuGet_Versioning)\lib\net472\NuGet.Versioning.dll" />
<PackageFilesNetFramework Include="$(PkgSystem_IO_Packaging)\lib\net462\System.IO.Packaging.dll" />
<PackageFilesNetFramework Include="$(PkgMicrosoft_ApplicationInsights)\lib\net46\Microsoft.ApplicationInsights.dll" />
</ItemGroup>
<Copy SourceFiles="@(PackageFilesNetFramework)" DestinationFolder="$(SdkBinariesPath)\%(PackageFilesNetFramework.RecursiveDir)" />
</Target>
<Target Name="CopyTargetOutputPerFramework" Condition="'$(IsCrossTargetingBuild)' != 'true'" AfterTargets="Build">
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(SdkStagingDirectory)tools\$(TargetFramework)\" />
</Target>
<!-- Set the SDK version in the README and sdk.props -->
<Target Name="SetSdkAssemblyVersion"
Condition="'$(IsCrossTargetingBuild)' == 'true'"
BeforeTargets="_GetPackageFiles"
DependsOnTargets="CopyNetCoreBinaries;CopyTargetOutputPerFramework">
<ReplaceFileText
InputFilename="$(MSBuildThisFileDirectory)/README.md"
OutputFilename="$(SdkStagingDirectory)/README.md"
MatchExpression="###ASSEMBLY_VERSION###"
ReplacementText="$(PackageVersion)" />
<ReplaceFileText
InputFilename="$(MSBuildThisFileDirectory)sdk/Sdk.props"
OutputFilename="$(SdkStagingDirectory)/sdk/Sdk.props"
MatchExpression="###ASSEMBLY_VERSION###"
ReplacementText="$(PackageVersion)" />
<!-- Force MSBuild to recalculate the files needed to be packed -->
<ItemGroup>
<Content Remove="$(SdkStagingDirectory)**\*.*" />
<Content Include="$(SdkStagingDirectory)**\*.*" Pack="true" PackagePath="\" />
</ItemGroup>
</Target>
<Target Name="DeleteStagingDirectory" AfterTargets="Clean">
<RemoveDir Directories="$(SdkStagingDirectory)" />
</Target>
<ItemGroup>
<Content Include="sdk\Sdk.targets" Pack="true" PackagePath="sdk\" />
<Content Include="$(SdkStagingDirectory)**\*.*" Pack="true" PackagePath="\" />
<Content Include="$(EnlistmentRoot)\LICENSE.txt" Pack="true" PackagePath="\" />
<Content Include="$(EnlistmentRoot)\images\nuspecicon.png" Pack="true" PackagePath="images\nuspecicon.png" />
</ItemGroup>
</Project>