Skip to content

Commit

Permalink
Revert "Experiment with dotnet-script script for setup-mono"
Browse files Browse the repository at this point in the history
This reverts commit 9bd26cf.
  • Loading branch information
nike4613 committed Jun 17, 2024
1 parent 9bd26cf commit f06c6a1
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 316 deletions.
7 changes: 0 additions & 7 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
"DocFxTocGenerator"
],
"rollForward": false
},
"dotnet-script": {
"version": "1.5.0",
"commands": [
"dotnet-script"
],
"rollForward": false
}
}
}
116 changes: 58 additions & 58 deletions .github/gen-test-matrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ param (
)

$ErrorActionPreference = "Stop";

$nugetOrgPkgSrc = "nuget.org";

$nugetOrgPkgSrc = "nuget.org";

$operatingSystems = @(
[pscustomobject]@{
Expand All @@ -16,7 +16,7 @@ $operatingSystems = @(
runnerArch = 1;
hasFramework = $true;
unityMonoArch = @("win32", "win64", "win_arm64");
unityMonoDll = "mono-2.0-bdwgc.dll";
unityMonoDll = "mono-2.0-bdwgc.dll";
dllSuffix = ".dll";
},
[pscustomobject]@{
Expand All @@ -27,8 +27,8 @@ $operatingSystems = @(
runnerArch = 0;
hasMono = $true;
unityMonoArch = @("linux64");
unityMonoDll = "limonobdwgc-2.0.so"; # TODO
dllPrefix = "lib";
unityMonoDll = "limonobdwgc-2.0.so"; # TODO
dllPrefix = "lib";
dllSuffix = ".so";
},
[pscustomobject]@{
Expand All @@ -39,8 +39,8 @@ $operatingSystems = @(
runnerArch = 0;
hasMono = $true;
unityMonoArch = @("macos_x64");
unityMonoDll = "limonobdwgc-2.0.dylib";
dllPrefix = "lib";
unityMonoDll = "limonobdwgc-2.0.dylib";
dllPrefix = "lib";
dllSuffix = ".dylib";
},
[pscustomobject]@{
Expand All @@ -52,8 +52,8 @@ $operatingSystems = @(
runnerArch = 1;
hasMono = $true;
unityMonoArch = @("macos_x64", "macos_arm64");
unityMonoDll = "limonobdwgc-2.0.dylib";
dllPrefix = "lib";
unityMonoDll = "limonobdwgc-2.0.dylib";
dllPrefix = "lib";
dllSuffix = ".dylib";
}
);
Expand Down Expand Up @@ -96,43 +96,43 @@ $dotnetVersions = @(
sdk = "6.0";
tfm = "net6.0";
rids = @("win-x86","win-x64","win-arm64","linux-x64","linux-arm","linux-arm64","osx-x64","osx-arm64");
pgo = $true;
netMonoPkgVer = "6.0.31"
pgo = $true;
netMonoPkgVer = "6.0.31"
netMonoNugetSrc = $nugetOrgPkgSrc;
},
[pscustomobject]@{
name = ".NET 7.0";
sdk = "7.0";
tfm = "net7.0";
rids = @("win-x86","win-x64","win-arm64","linux-x64","linux-arm","linux-arm64","osx-x64","osx-arm64");
pgo = $true;
netMonoPkgVer = "7.0.20"
pgo = $true;
netMonoPkgVer = "7.0.20"
netMonoNugetSrc = $nugetOrgPkgSrc;
},
[pscustomobject]@{
name = ".NET 8.0";
sdk = "8.0";
tfm = "net8.0";
rids = @("win-x86","win-x64","win-arm64","linux-x64","linux-arm","linux-arm64","osx-x64","osx-arm64");
pgo = $true;
netMonoPkgVer = "8.0.6"
pgo = $true;
netMonoPkgVer = "8.0.6"
netMonoNugetSrc = $nugetOrgPkgSrc;
}
);

$netMonoPackageName = "Microsoft.NETCore.App.Runtime.Mono.{RID}";
$netMonoLibPath = "runtimes/{RID}/lib/{TFM}/";
$netMonoDllPath = "runtimes/{RID}/native/{DllPre}coreclr{DllSuf}";

function Fill-Template($template, $obj)
{
$result = $template;
foreach ($kvp in $obj.GetEnumerator())
{

$netMonoPackageName = "Microsoft.NETCore.App.Runtime.Mono.{RID}";
$netMonoLibPath = "runtimes/{RID}/lib/{TFM}/";
$netMonoDllPath = "runtimes/{RID}/native/{DllPre}coreclr{DllSuf}";

function Fill-Template($template, $obj)
{
$result = $template;
foreach ($kvp in $obj.GetEnumerator())
{
$result = $result -replace "{$($kvp.Key)}",$kvp.Value;
}
}
return $result;
}
}

$monoTfm = "net462";

Expand Down Expand Up @@ -172,7 +172,7 @@ function Remove-NullProperties {
$obj
}

}
}

foreach ($os in $operatingSystems)
{
Expand Down Expand Up @@ -253,38 +253,38 @@ foreach ($os in $operatingSystems)
arch = $arch;
}
);
}

if ($dotnet.netMonoNugetSrc)
{
# this runtime version has an associated Mono build
$fill = @{
RID = $rid;
TFM = $dotnet.tfm;
DllPre = $os.dllPrefix;
}

if ($dotnet.netMonoNugetSrc)
{
# this runtime version has an associated Mono build
$fill = @{
RID = $rid;
TFM = $dotnet.tfm;
DllPre = $os.dllPrefix;
DllSuf = $os.dllSuffix;
};

# fill the templates, so that we can add the job
$pkgName = Fill-Template $netMonoPackageName $fill
$libPath = Fill-Template $netMonoLibPath $fill
$dllPath = Fill-Template $netMonoDllPath $fill

# We always need to do a restore on Mono
$jobdotnet = $outdotnet | Select-Object -ExcludeProperty sdk,pgo -Property *,`
@{n='isMono';e={$true}},`
@{n='netMonoPkgName';e={$pkgName}},`
@{n='monoLibPath';e={$libPath}},`
@{n='monoDllPath';e={$dllPath}}
$jobdotnet.needsRestore = $true;

$jobs += @(
[pscustomobject]@{
title = ".NET Mono $($dotnet.netMonoPkgVer) $arch on $($os.name)";
os = $outos;
dotnet = $jobdotnet | Remove-NullProperties;
};

# fill the templates, so that we can add the job
$pkgName = Fill-Template $netMonoPackageName $fill
$libPath = Fill-Template $netMonoLibPath $fill
$dllPath = Fill-Template $netMonoDllPath $fill

# We always need to do a restore on Mono
$jobdotnet = $outdotnet | Select-Object -ExcludeProperty sdk,pgo -Property *,`
@{n='isMono';e={$true}},`
@{n='netMonoPkgName';e={$pkgName}},`
@{n='monoLibPath';e={$libPath}},`
@{n='monoDllPath';e={$dllPath}}
$jobdotnet.needsRestore = $true;

$jobs += @(
[pscustomobject]@{
title = ".NET Mono $($dotnet.netMonoPkgVer) $arch on $($os.name)";
os = $outos;
dotnet = $jobdotnet | Remove-NullProperties;
arch = $arch;
}
}
);
}
}
Expand Down

0 comments on commit f06c6a1

Please sign in to comment.