Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Compile Include="ApkBuilder.cs" />
<Compile Include="AndroidAppBuilder.cs" />
<Compile Include="AndroidApkFileReplacerTask.cs" />
<Compile Include="Utils.cs" />
<Compile Include="..\Common\Utils.cs" />
</ItemGroup>

<Target Name="PublishBuilder"
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/AotCompilerTask/MonoAOTCompiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="MonoAOTCompiler.cs" />
<Compile Include="Utils.cs" />
<Compile Include="..\Common\Utils.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="MonoAOTCompiler.props">
Expand Down
87 changes: 0 additions & 87 deletions src/tasks/AotCompilerTask/Utils.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/tasks/AppleAppBuilder/AppleAppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class AppleAppBuilderTask : Task
/// The Apple OS we are targeting (iOS or tvOS)
/// </summary>
[Required]
public string TargetOS { get; set; } = Utils.TargetOS.iOS;
public string TargetOS { get; set; } = TargetNames.iOS;

/// <summary>
/// ProjectName is used as an app name, bundleId and xcode project name
Expand Down
3 changes: 2 additions & 1 deletion src/tasks/AppleAppBuilder/AppleAppBuilder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AppleAppBuilder.cs" />
<Compile Include="Utils.cs" />
<Compile Include="..\Common\Utils.cs" />
<Compile Include="TargetOS.cs" />
<Compile Include="Xcode.cs" />
</ItemGroup>

Expand Down
8 changes: 8 additions & 0 deletions src/tasks/AppleAppBuilder/TargetOS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

internal class TargetNames
{
public const string iOS = "iOS";
public const string tvOS = "tvOS";
}
101 changes: 0 additions & 101 deletions src/tasks/AppleAppBuilder/Utils.cs

This file was deleted.

8 changes: 4 additions & 4 deletions src/tasks/AppleAppBuilder/Xcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class Xcode
public Xcode(string target)
{
Target = target;
SysRoot = (Target == Utils.TargetOS.iOS) ?
SysRoot = (Target == TargetNames.iOS) ?
Utils.RunProcess("xcrun", "--sdk iphoneos --show-sdk-path") :
Utils.RunProcess("xcrun", "--sdk appletvos --show-sdk-path");
}
Expand Down Expand Up @@ -95,7 +95,7 @@ public string GenerateXCode(
}

string frameworks = "";
if (Target == Utils.TargetOS.iOS)
if (Target == TargetNames.iOS)
{
frameworks = "\"-framework GSS\"";
}
Expand Down Expand Up @@ -164,7 +164,7 @@ public string BuildAppBundle(

if (architecture == "arm64")
{
sdk = (Target == Utils.TargetOS.iOS) ? "iphoneos" : "appletvos";
sdk = (Target == TargetNames.iOS) ? "iphoneos" : "appletvos";
args.Append(" -arch arm64")
.Append(" -sdk " + sdk);

Expand All @@ -182,7 +182,7 @@ public string BuildAppBundle(
}
else
{
sdk = (Target == Utils.TargetOS.iOS) ? "iphonesimulator" : "appletvsimulator";
sdk = (Target == TargetNames.iOS) ? "iphonesimulator" : "appletvsimulator";
args.Append(" -arch x86_64")
.Append(" -sdk " + sdk);
}
Expand Down
22 changes: 15 additions & 7 deletions src/tasks/AndroidAppBuilder/Utils.cs → src/tasks/Common/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

internal class Utils
{
private static readonly object s_SyncObj = new object();

public static string GetEmbeddedResource(string file)
{
using Stream stream = typeof(Utils).Assembly
Expand Down Expand Up @@ -55,19 +57,25 @@ public static string RunProcess(

process.ErrorDataReceived += (sender, e) =>
{
if (!silent)
lock (s_SyncObj)
{
LogError(e.Data);
outputBuilder.AppendLine(e.Data);
if (!silent)
{
LogError(e.Data);
outputBuilder.AppendLine(e.Data);
}
errorBuilder.AppendLine(e.Data);
}
errorBuilder.AppendLine(e.Data);
};
process.OutputDataReceived += (sender, e) =>
{
if (!silent)
lock (s_SyncObj)
{
LogInfo(e.Data);
outputBuilder.AppendLine(e.Data);
if (!silent)
{
LogInfo(e.Data);
outputBuilder.AppendLine(e.Data);
}
}
};
process.BeginOutputReadLine();
Expand Down