dotnet-installer/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets

105 lines
5.3 KiB
Text
Raw Normal View History

2016-06-28 01:26:57 +00:00
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2016-07-11 22:01:15 +00:00
<Target Name="SetupGenerateDebInputsOutputs">
2016-07-13 00:08:39 +00:00
<Exec Command="/usr/bin/env debuild -h" ContinueOnError="true">
2016-07-11 22:01:15 +00:00
<Output TaskParameter="ExitCode" PropertyName="DebuildExitCode" />
</Exec>
2016-07-13 18:19:38 +00:00
<!-- Workaround for Ubuntu16 Jenkins https://github.com/dotnet/core-setup/issues/167 -->
<Message Condition=" '$(DebuildPresent)' != 'true' "
Text="Debuild Not found, Debian packages will not be built."
Importance="High" />
2016-07-11 22:01:15 +00:00
<PropertyGroup>
<DebuildPresent>false</DebuildPresent>
<DebuildPresent Condition=" '$(DebuildExitCode)' == '0' ">true</DebuildPresent>
<DebianPackagingScript>$(RepoRoot)/scripts/package/package-debian.sh</DebianPackagingScript>
<ManpagesDirectory>$(RepoRoot)/Documentation/manpages</ManpagesDirectory>
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
<SdkDebianPackageName>dotnet-dev-$(SdkVersion)</SdkDebianPackageName>
<SharedFrameworkDebianPackageName>dotnet-sharedframework-$(SharedFrameworkName)-$(SharedFrameworkVersion)</SharedFrameworkDebianPackageName>
<SharedFrameworkDebianPackageName>$(SharedFrameworkDebianPackageName.ToLower())</SharedFrameworkDebianPackageName>
<HostFxrDebianPackageName>dotnet-hostfxr-$(HostFxrVersion)</HostFxrDebianPackageName>
<HostFxrDebianPackageName>$(HostFxrDebianPackageName.ToLower())</HostFxrDebianPackageName>
<SharedHostDebianPackageName>dotnet-host</SharedHostDebianPackageName>
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
<DebianTestResultsXmlFile>$(SdkDebianIntermediateDirectory)/debian-testResults.xml</DebianTestResultsXmlFile>
<DebianInstalledDotnet>/usr/share/dotnet/dotnet</DebianInstalledDotnet>
<EndToEndTestDirectory>$(RepoRoot)/test/EndToEnd</EndToEndTestDirectory>
</PropertyGroup>
<ItemGroup>
<SdkDebInputFiles Include="$(SdkLayoutOutputDirectory)/**/*" />
</ItemGroup>
2016-06-28 01:26:57 +00:00
</Target>
2016-07-11 22:01:15 +00:00
<Target Name="GenerateSdkDeb"
Condition=" '$(OSName)' == 'ubuntu' and '$(DebuildPresent)' == 'true' "
2016-07-13 18:19:38 +00:00
Inputs="@(SdkDebInputFiles);"
2016-07-11 22:01:15 +00:00
Outputs="$(SdkInstallerFile)" >
<!-- Install Packages -->
<Exec Command="sudo dpkg -i $(DownloadedSharedHostInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedHostFxrInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedSharedFrameworkInstallerFile)" />
<Exec Command="'$(DebianPackagingScript)'
-v '$(SdkVersion)'
-i '$(SdkLayoutOutputDirectory)'
-o '$(SdkInstallerFile)'
-p '$(SdkDebianPackageName)'
-b '$(SdkBrandName)'
-m '$(ManpagesDirectory)'
--framework-debian-package-name '$(SharedFrameworkDebianPackageName)'
--framework-nuget-name '$(SharedFrameworkName)'
--framework-nuget-version '$(SharedFrameworkVersion)'
--obj-root '$(SdkDebianIntermediateDirectory)'" />
<!-- Remove Packages -->
<Exec Command="sudo dpkg -r $(SdkDebianPackageName)" />
<Exec Command="sudo dpkg -r $(SharedFrameworkDebianPackageName)" />
<Exec Command="sudo dpkg -r $(HostFxrDebianPackageName)" />
<Exec Command="sudo dpkg -r $(SharedHostDebianPackageName)" />
</Target>
<Target Name="TestSdkDeb"
Condition=" '$(OSName)' == 'ubuntu' and '$(DebuildPresent)' == 'true' "
Inputs="$(DownloadedSharedHostInstallerFile);
$(DownloadedHostFxrInstallerFile);
$(DownloadedSharedFrameworkInstallerFile);
$(SdkInstallerFile);"
Outputs="$(DebianTestResultsXmlFile)" >
<!-- Install Packages -->
<Exec Command="sudo dpkg -i $(DownloadedSharedHostInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedHostFxrInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedSharedFrameworkInstallerFile)" />
<Exec Command="sudo dpkg -i $(SdkInstallerFile)" />
<!-- Run E2E -->
<Exec Command="$(DebianInstalledDotnet) test -xml $(DebianTestResultsXmlFile)"
WorkingDirectory="$(EndToEndTestDirectory)" />
<!-- Remove Packages -->
<Exec Command="sudo dpkg -r $(SdkDebianPackageName)" />
<Exec Command="sudo dpkg -r $(SharedFrameworkDebianPackageName)" />
<Exec Command="sudo dpkg -r $(HostFxrDebianPackageName)" />
<Exec Command="sudo dpkg -r $(SharedHostDebianPackageName)" />
</Target>
<Target Name="GenerateDebs"
DependsOnTargets="Init;
Layout;
SetupGenerateDebInputsOutputs;
GenerateSdkDeb;
TestSdkDeb;"
Condition=" '$(OSName)' == 'ubuntu' " />
2016-06-28 01:26:57 +00:00
</Project>