Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions build_projects/dotnet-host-build/CompileTargets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public class CompileTargets
{ "win10-arm64", "win10-arm64" },
{ "osx.10.10-x64", "osx.10.10-x64" },
{ "osx.10.11-x64", "osx.10.10-x64" },
{ "ubuntu.14.04-arm", "ubuntu.14.04-arm" },
{ "ubuntu.14.04-x64", "ubuntu.14.04-x64" },
{ "ubuntu.16.04-arm", "ubuntu.16.04-arm" },
{ "ubuntu.16.04-x64", "ubuntu.16.04-x64" },
{ "ubuntu.16.10-x64", "ubuntu.16.10-x64" },
{ "centos.7-x64", "rhel.7-x64" },
Expand Down Expand Up @@ -386,10 +388,23 @@ public static BuildTargetResult PackagePkgProjects(BuildTargetContext c)
var hostNugetversion = hostVersion.LatestHostVersion.ToString();
var content = $@"{c.BuildContext["CommitHash"]}{Environment.NewLine}{hostNugetversion}{Environment.NewLine}";
var pkgDir = Path.Combine(c.BuildContext.BuildDirectory, "pkg");
var packCmd = "pack." + (CurrentPlatform.IsWindows ? "cmd" : "sh");
string rid = HostPackageSupportedRids[c.BuildContext.Get<string>("TargetRID")];
File.WriteAllText(Path.Combine(pkgDir, "version.txt"), content);
Exec(Path.Combine(pkgDir, packCmd));

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Exec(Path.Combine(pkgDir, "pack.cmd"));
}
else
{
List<string> buildScriptArgList = new List<string>();
string buildScriptFile = Path.Combine(pkgDir, "pack.sh");

buildScriptArgList.Add("--rid");
buildScriptArgList.Add(rid);

Exec(buildScriptFile, buildScriptArgList);
}

foreach (var file in Directory.GetFiles(Path.Combine(pkgDir, "bin", "packages"), "*.nupkg"))
{
Expand Down
31 changes: 30 additions & 1 deletion pkg/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ init_distro_name()
fi
}

usage()
{
echo "Usage: $0 --rid <Runtime Identifier>"
echo ""
echo "Options:"
echo " --rid <Runtime Identifier> Target Runtime Identifier"

exit 1
}

set -e

# determine current directory
Expand All @@ -25,6 +35,23 @@ done
__project_dir="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
__distro_rid=

while [ "$1" != "" ]; do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
-h|--help)
usage
exit 1
;;
--rid)
shift
__distro_rid=$1
;;
*)
echo "Unknown argument to pack.sh $1"; exit 1
esac
shift
done

# setup msbuild
"$__project_dir/init-tools.sh"

Expand All @@ -44,7 +71,9 @@ if [ "$(uname -s)" == "Darwin" ]; then
__targets_param="TargetsOSX=true"
else
__targets_param="TargetsLinux=true"
init_distro_name
if [ -z $__distro_rid ]; then

This comment was marked as spam.

This comment was marked as spam.

init_distro_name
fi
fi

__common_parameters="/p:$__targets_param /p:DistroRid=$__distro_rid /verbosity:minimal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.14.04-arm'" Include="ubuntu.14.04/Microsoft.NETCore.DotNetHost.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.14.04-x64'" Include="ubuntu.14.04/Microsoft.NETCore.DotNetHost.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.04-arm'" Include="ubuntu.16.04/Microsoft.NETCore.DotNetHost.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.04-x64'" Include="ubuntu.16.04/Microsoft.NETCore.DotNetHost.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.14.04-arm'" Include="ubuntu.14.04/Microsoft.NETCore.DotNetHostPolicy.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.14.04-x64'" Include="ubuntu.14.04/Microsoft.NETCore.DotNetHostPolicy.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.04-arm'" Include="ubuntu.16.04/Microsoft.NETCore.DotNetHostPolicy.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.04-x64'" Include="ubuntu.16.04/Microsoft.NETCore.DotNetHostPolicy.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.14.04-arm'" Include="ubuntu.14.04/Microsoft.NETCore.DotNetHostResolver.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.14.04-x64'" Include="ubuntu.14.04/Microsoft.NETCore.DotNetHostResolver.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.04-arm'" Include="ubuntu.16.04/Microsoft.NETCore.DotNetHostResolver.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>arm</Platform>
</Project>
<Project Condition="'$(TargetsLinux)' == 'true' and '$(DistroRid)' == 'ubuntu.16.04-x64'" Include="ubuntu.16.04/Microsoft.NETCore.DotNetHostResolver.pkgproj">
<OSGroup>Linux</OSGroup>
<Platform>amd64</Platform>
Expand Down