Commit 0cfff8eb authored by Jesse McGrew's avatar Jesse McGrew
Browse files

Package as .tar.gz instead of .zip for Linux and Mac.

parent 67724a8f8887
......@@ -15,6 +15,12 @@ dotnet msbuild Build.proj -t:PackageAllRids -p:Configuration=Release
<MainBuildPrefix Condition=" '$(MainBuildPrefix)' == '' "></MainBuildPrefix>
<Mono Condition="'$(OS)' != 'Windows_NT' AND !$(TargetFramework.StartsWith('netcore'))">true</Mono>
<MacOS Condition="'$(OS)' == 'Unix' AND Exists('/Applications') AND Exists('/Library') AND Exists('/System') AND Exists('/Volumes')">true</MacOS>
<WindowsTarget>false</WindowsTarget>
<WindowsTarget Condition="$(RuntimeIdentifier.StartsWith('win'))">true</WindowsTarget>
<PortableTarget>false</PortableTarget>
<PortableTarget Condition="'$(RuntimeIdentifier)' == ''">true</PortableTarget>
<UnixTarget>false</UnixTarget>
<UnixTarget Condition="!($(WindowsTarget) OR $(PortableTarget))">true</UnixTarget>
<RootDir>$(MSBuildThisFileDirectory)</RootDir>
<Solution>$(RootDir)Zilf.sln</Solution>
......@@ -28,7 +34,7 @@ dotnet msbuild Build.proj -t:PackageAllRids -p:Configuration=Release
<!-- Allows one restore to apply to multiple builds -->
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<BuildInParallel Condition=" '$(BuildInParallel)' == '' ">false</BuildInParallel>
<!--<BuildInParallel Condition=" '$(BuildInParallel)' == '' ">false</BuildInParallel>-->
</PropertyGroup>
<Import Project="$(BuildSysDir)\Tasks.targets" />
......@@ -51,7 +57,8 @@ dotnet msbuild Build.proj -t:PackageAllRids -p:Configuration=Release
BinDir=$(BinDir);
StageDir=$(StageDir);
BuildSysDir=$(BuildSysDir);
Mono=$(Mono);
WindowsTarget=$(WindowsTarget);
UnixTarget=$(UnixTarget)
</BuildProperties>
</PropertyGroup>
......@@ -179,8 +186,8 @@ dotnet msbuild Build.proj -t:PackageAllRids -p:Configuration=Release
</ItemGroup>
<MSBuild Projects="@(ProjectToPackage)"
Targets="Package"
BuildInParallel="$(BuildInParallel)" />
Targets="Package" />
<!--BuildInParallel="$(BuildInParallel)" />-->
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="Package"
......@@ -203,8 +210,8 @@ dotnet msbuild Build.proj -t:PackageAllRids -p:Configuration=Release
</ItemGroup>
<MSBuild Projects="@(ProjectToClean)"
Targets="Clean"
BuildInParallel="$(BuildInParallel)" />
Targets="Clean" />
<!--BuildInParallel="$(BuildInParallel)" />-->
</Target>
<Import Project="$(RootDir)\Package\**\*.Packaging.targets" />
......
......@@ -11,6 +11,12 @@
<ReferenceDir Condition=" '$(ReferenceDir)' == '' ">$(RootDir)Util\References</ReferenceDir>
<Mono Condition=" '$(Mono)' == '' AND '$(OS)' != 'Windows_NT' ">true</Mono>
<WindowsTarget Condition="'$(WindowsTarget)' == '' AND $(RuntimeIdentifier.StartsWith('win'))">true</WindowsTarget>
<WindowsTarget Condition="'$(WindowsTarget)' == ''">false</WindowsTarget>
<PortableTarget Condition="'$(PortableTarget)' == '' AND '$(RuntimeIdentifier)' == ''">true</PortableTarget>
<PortableTarget Condition="'$(PortableTarget)' == ''">false</PortableTarget>
<UnixTarget Condition="'$(UnixTarget)' == '' AND !($(WindowsTarget) OR $(PortableTarget))">true</UnixTarget>
<UnixTarget Condition="'$(UnixTarget)' == ''">false</UnixTarget>
<!-- The following two lines prevent csc.rsp and Microsoft.NETFramework.props from adding
additional assembly references. -->
......
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0">
<PropertyGroup>
<TarOutputFile>$(PackageDir)\$(PackageName).tar.gz</TarOutputFile>
<TarStageDir>$(PackageDir)\tar_temp_$(PackageName)</TarStageDir>
</PropertyGroup>
<Target Name="TarPackage"
DependsOnTargets="Stage"
AfterTargets="Package"
Outputs="$(TarOutputFile)"
Condition="$(UnixTarget) AND '$(OS)' == 'Unix'">
<MakeDir Directories="$(PackageDir)" Condition="!Exists('$(PackageDir)')" />
<MakeDir Directories="$(TarStageDir)" Condition="!Exists('$(TarStageDir)')" />
<ItemGroup>
<TarFiles Include="$(StageDir)\**\*.*" Exclude="$(StageDir)\**\*.Tests.*;$(StageDir)\**\*.pdb" />
</ItemGroup>
<!--
We rename the executable wrappers to lowercase for convenience on case-sensitive filesystems.
Luckily, the wrappers are the only files with no extensions.
-->
<Copy SourceFiles="@(TarFiles)"
DestinationFolder="$(TarStageDir)\$(PackageName)\%(RecursiveDir)">
<Output TaskParameter="CopiedFiles" ItemName="CopiedTarFiles" />
</Copy>
<ItemGroup>
<_TarExe Include="@(CopiedTarFiles)" Condition="'%(Extension)' == ''">
<_LowerFilename>$([MSBuild]::ValueOrDefault('%(Filename)', '').ToLower())</_LowerFilename>
</_TarExe>
<_TarExeLowered Include="@(_TarExe->'%(RootDir)%(Directory)%(_LowerFilename)')" />
</ItemGroup>
<Move SourceFiles="@(_TarExe)"
DestinationFiles="@(_TarExeLowered)" />
<Exec WorkingDirectory="$(TarStageDir)"
Command="tar cvfz $(TarOutputFile) $(PackageName)" />
<RemoveDir Directories="$(TarStageDir)" />
</Target>
</Project>
......@@ -11,7 +11,8 @@
<Target Name="ZipPackage"
DependsOnTargets="Stage"
AfterTargets="Package"
Outputs="$(ZipOutputFile)">
Outputs="$(ZipOutputFile)"
Condition="$(WindowsTarget) OR $(PortableTarget)">
<MakeDir Directories="$(PackageDir)" Condition="!Exists('$(PackageDir)')" />
<MakeDir Directories="$(ZipStageDir)" Condition="!Exists('$(ZipStageDir)')" />
......
......@@ -63,6 +63,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ZIL Library", "ZIL Library"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{3E280263-C59C-4A3B-B9ED-466D22C25333}"
ProjectSection(SolutionItems) = preProject
Package\tar\Tar.Packaging.targets = Package\tar\Tar.Packaging.targets
Package\zip\Zip.Packaging.targets = Package\zip\Zip.Packaging.targets
EndProjectSection
EndProject
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment