<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFramework>$(ServiceLayerTargetFramework)</TargetFramework>
		<AssemblyName>MicrosoftSqlToolsServiceLayer</AssemblyName>
		<OutputType>Exe</OutputType>
		<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>
		<EnableDefaultItems>false</EnableDefaultItems> 
		<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
		<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
		<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
		<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
		<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
		<DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants>
		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
		<PreserveCompilationContext>true</PreserveCompilationContext>
		<RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;linux-x64;win10-arm;win10-arm64</RuntimeIdentifiers>
	</PropertyGroup>

	<PropertyGroup>
		<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
		<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
		<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" />
		<PackageReference Include="Microsoft.SqlServer.DACFx" />
		<PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" />
		<PackageReference Include="System.Text.Encoding.CodePages" />
		<PackageReference Include="Microsoft.SqlServer.Assessment" />
		<PackageReference Include="Microsoft.SqlServer.Migration.Assessment" />
		<PackageReference Include="System.Text.Encoding.CodePages" />
		<PackageReference Include="Microsoft.SqlServer.TransactSql.ScriptDom.NRT">
			<Aliases>ASAScriptDom</Aliases>
		</PackageReference>
	</ItemGroup>
	<ItemGroup>
		<Compile Include="**\*.cs" Exclude="**/obj/**/*.cs" />
	</ItemGroup>
	<ItemGroup>
		<ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
		<ProjectReference Include="../Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
		<ProjectReference Include="../Microsoft.SqlTools.ManagedBatchParser/Microsoft.SqlTools.ManagedBatchParser.csproj" />
		<ProjectReference Include="../Microsoft.InsightsGenerator/Microsoft.InsightsGenerator.csproj" />
	</ItemGroup>
	<ItemGroup>
		<Content Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\netstandard2.0\Microsoft.Data.Tools.Schema.SqlTasks.targets">
			<CopyToPublishDirectory>Always</CopyToPublishDirectory>
		</Content>
		<Content Include="..\..\Notice.txt">
			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
		</Content>
		<Content Include=".\Migration\Metadata\**">
			<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>
		<EmbeddedResource Include="ObjectExplorer\SmoModel\TreeNodeDefinition.xml" />
		<EmbeddedResource Include="Localization\*.resx" />
		<None Include="Localization\sr.strings" />
	</ItemGroup>
	<ItemGroup>
		<EmbeddedResource Include=".\Agent\NotebookResources\NotebookJobScript.ps1" />
	</ItemGroup>
	<!-- this target enables dependency files to be copied as part of the output of ProjectReference.
	https://github.com/dotnet/sdk/issues/1675
	 -->
	<Target Name="AddRuntimeDependenciesToContent" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" BeforeTargets="GetCopyToOutputDirectoryItems" DependsOnTargets="GenerateBuildDependencyFile;&#xD;&#xA;							GenerateBuildRuntimeConfigurationFiles">
		<ItemGroup>
			<ContentWithTargetPath Include="$(ProjectDepsFilePath)" Condition="'$(GenerateDependencyFile)' == 'true'" CopyToOutputDirectory="PreserveNewest" TargetPath="$(ProjectDepsFileName)" />
			<ContentWithTargetPath Include="$(ProjectRuntimeConfigFilePath)" Condition="'$(GenerateRuntimeConfigurationFiles)' == 'true'" CopyToOutputDirectory="PreserveNewest" TargetPath="$(ProjectRuntimeConfigFileName)" />
		</ItemGroup>
	</Target>
</Project>
