This commit is contained in:
Ivan Matkov 2022-07-26 17:04:41 +02:00
Родитель a822c31ac5
Коммит e86177f7e4
5 изменённых файлов: 21 добавлений и 12 удалений

Просмотреть файл

@ -2,13 +2,9 @@
"solution": { "solution": {
"path": "AppCenter-Mac.sln", "path": "AppCenter-Mac.sln",
"projects": [ "projects": [
"SDK\\AppCenter\\Microsoft.AppCenter\\Microsoft.AppCenter.csproj",
"SDK\\AppCenter\\Microsoft.AppCenter.AppleUnified\\Microsoft.AppCenter.AppleUnified.csproj", "SDK\\AppCenter\\Microsoft.AppCenter.AppleUnified\\Microsoft.AppCenter.AppleUnified.csproj",
"SDK\\AppCenterAnalytics\\Microsoft.AppCenter.Analytics\\Microsoft.AppCenter.Analytics.csproj",
"SDK\\AppCenterAnalytics\\Microsoft.AppCenter.Analytics.AppleUnified\\Microsoft.AppCenter.Analytics.AppleUnified.csproj", "SDK\\AppCenterAnalytics\\Microsoft.AppCenter.Analytics.AppleUnified\\Microsoft.AppCenter.Analytics.AppleUnified.csproj",
"SDK\\AppCenterCrashes\\Microsoft.AppCenter.Crashes\\Microsoft.AppCenter.Crashes.csproj",
"SDK\\AppCenterCrashes\\Microsoft.AppCenter.Crashes.AppleUnified\\Microsoft.AppCenter.Crashes.AppleUnified.csproj", "SDK\\AppCenterCrashes\\Microsoft.AppCenter.Crashes.AppleUnified\\Microsoft.AppCenter.Crashes.AppleUnified.csproj",
"SDK\\AppCenterDistribute\\Microsoft.AppCenter.Distribute\\Microsoft.AppCenter.Distribute.csproj",
"SDK\\AppCenterDistribute\\Microsoft.AppCenter.Distribute.AppleUnified\\Microsoft.AppCenter.Distribute.AppleUnified.csproj" "SDK\\AppCenterDistribute\\Microsoft.AppCenter.Distribute.AppleUnified\\Microsoft.AppCenter.Distribute.AppleUnified.csproj"
] ]
} }

Просмотреть файл

@ -53,6 +53,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\AppCenter\Microsoft.AppCenter.AppleUnified\Microsoft.AppCenter.AppleUnified.csproj" /> <ProjectReference Include="..\..\AppCenter\Microsoft.AppCenter.AppleUnified\Microsoft.AppCenter.AppleUnified.csproj" />
</ItemGroup> </ItemGroup>
<Import Project="..\Microsoft.AppCenter.Crashes.Shared.Xamarin\Microsoft.AppCenter.Crashes.Shared.Xamarin.projitems" Label="Shared" Condition="Exists('..\Microsoft.AppCenter.Crashes.Shared.Xamarin\Microsoft.AppCenter.Crashes.Shared.Xamarin.projitems')" /> <Import Project="..\Microsoft.AppCenter.Crashes.Shared.Xamarin\Microsoft.AppCenter.Crashes.Shared.Xamarin.projitems" Label="Shared" />
<Import Project="..\Microsoft.AppCenter.Crashes.Shared\Microsoft.AppCenter.Crashes.Shared.projitems" Label="Shared" Condition="Exists('..\Microsoft.AppCenter.Crashes.Shared\Microsoft.AppCenter.Crashes.Shared.projitems')" /> <Import Project="..\Microsoft.AppCenter.Crashes.Shared\Microsoft.AppCenter.Crashes.Shared.projitems" Label="Shared" />
</Project> </Project>

Просмотреть файл

@ -53,4 +53,5 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\AppCenter\Microsoft.AppCenter.AppleUnified\Microsoft.AppCenter.AppleUnified.csproj" /> <ProjectReference Include="..\..\AppCenter\Microsoft.AppCenter.AppleUnified\Microsoft.AppCenter.AppleUnified.csproj" />
</ItemGroup> </ItemGroup>
<Import Project="..\Microsoft.AppCenter.Distribute.Shared\Microsoft.AppCenter.Distribute.Shared.projitems" Label="Shared" />
</Project> </Project>

Просмотреть файл

@ -55,7 +55,7 @@ Task("Build")
.Does(() => .Does(() =>
{ {
var platformId = IsRunningOnUnix() ? "mac" : "windows"; var platformId = IsRunningOnUnix() ? "mac" : "windows";
var buildGroups = BuildGroup.ReadBuildGroups(); var buildGroups = BuildGroup.ReadBuildGroups(platformId);
foreach (var buildGroup in buildGroups) foreach (var buildGroup in buildGroups)
{ {
buildGroup.ExecuteBuilds(); buildGroup.ExecuteBuilds();
@ -91,7 +91,8 @@ Task("Externals-Android")
CleanDirectory(AndroidExternals); CleanDirectory(AndroidExternals);
// Download zip file. // Download zip file.
DownloadFile(AndroidUrl, zipFile); using (VerboseVerbosity())
DownloadFile(AndroidUrl, zipFile);
Unzip(zipFile, AndroidExternals); Unzip(zipFile, AndroidExternals);
// Move binaries to externals/android so that linked files don't have versions // Move binaries to externals/android so that linked files don't have versions
@ -113,7 +114,8 @@ Task("Externals-Apple")
CleanDirectory(AppleExternals); CleanDirectory(AppleExternals);
// Download zip file. // Download zip file.
DownloadFile(AppleUrl, zipFile); using (VerboseVerbosity())
DownloadFile(AppleUrl, zipFile);
using(var process = StartAndReturnProcess("unzip", using(var process = StartAndReturnProcess("unzip",
new ProcessSettings new ProcessSettings
{ {

Просмотреть файл

@ -23,7 +23,6 @@ public class BuildGroup
public override void Build(string solutionPath) public override void Build(string solutionPath)
{ {
Statics.Context.NuGetRestore(solutionPath);
Statics.Context.MSBuild(solutionPath, settings => { Statics.Context.MSBuild(solutionPath, settings => {
if (ToolVersion != null) if (ToolVersion != null)
{ {
@ -39,7 +38,6 @@ public class BuildGroup
{ {
public override void Build(string solutionPath) public override void Build(string solutionPath)
{ {
Statics.Context.DotNetRestore(solutionPath);
var settings = new DotNetCoreBuildSettings var settings = new DotNetCoreBuildSettings
{ {
Configuration = Configuration, Configuration = Configuration,
@ -48,7 +46,7 @@ public class BuildGroup
} }
} }
public static IList<BuildGroup> ReadBuildGroups() public static IList<BuildGroup> ReadBuildGroups(string platformId)
{ {
XmlReader reader = ConfigFile.CreateReader(); XmlReader reader = ConfigFile.CreateReader();
IList<BuildGroup> groups = new List<BuildGroup>(); IList<BuildGroup> groups = new List<BuildGroup>();
@ -58,6 +56,10 @@ public class BuildGroup
{ {
XmlDocument buildGroup = new XmlDocument(); XmlDocument buildGroup = new XmlDocument();
var node = buildGroup.ReadNode(reader); var node = buildGroup.ReadNode(reader);
if (node.Attributes.GetNamedItem("platformId").Value != platformId)
{
continue;
}
groups.Add(new BuildGroup(node)); groups.Add(new BuildGroup(node));
} }
} }
@ -80,6 +82,14 @@ public class BuildGroup
public void ExecuteBuilds() public void ExecuteBuilds()
{ {
if (_solutionPath.EndsWith(".slnf"))
{
Statics.Context.DotNetRestore(_solutionPath);
}
else
{
Statics.Context.NuGetRestore(_solutionPath);
}
foreach (var builders in _builders) foreach (var builders in _builders)
{ {
builders.Build(_solutionPath); builders.Build(_solutionPath);