-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wasm][tests][aot] Propogate wasm properties from the original project
.. to the proxy project on helix. This also fixes #50727 , by correctly passing `$(InvariantGlobalization)` property to the proxy project. So, re-enable `Invariant.Tests`.
- Loading branch information
Showing
4 changed files
with
93 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.IO; | ||
using System.Text; | ||
using Microsoft.Build.Framework; | ||
using Microsoft.Build.Utilities; | ||
|
||
namespace Microsoft.WebAssembly.Build.Tasks | ||
{ | ||
public class GenerateAOTProps : Task | ||
{ | ||
[NotNull] | ||
[Required] | ||
public ITaskItem[]? Properties { get; set; } | ||
|
||
[NotNull] | ||
[Required] | ||
public string? OutputFile { get; set; } | ||
|
||
public override bool Execute() | ||
{ | ||
var outDir = Path.GetDirectoryName(OutputFile); | ||
if (!string.IsNullOrEmpty(outDir) && !Directory.Exists(outDir)) | ||
Directory.CreateDirectory(outDir); | ||
|
||
StringBuilder sb = new(); | ||
|
||
sb.AppendLine("<Project>"); | ||
sb.AppendLine(" <PropertyGroup>"); | ||
|
||
foreach (var prop in Properties) | ||
{ | ||
string value = prop.ItemSpec; | ||
string? name = prop.GetMetadata("Name"); | ||
string? condition = prop.GetMetadata("ConditionToUse"); | ||
|
||
if (!string.IsNullOrEmpty(condition)) | ||
sb.AppendLine($" <{name} Condition=\"{condition}\">{value}</{name}>"); | ||
else | ||
sb.AppendLine($" <{name}>{value}</{name}>"); | ||
} | ||
|
||
sb.AppendLine(" </PropertyGroup>"); | ||
sb.AppendLine("</Project>"); | ||
|
||
File.WriteAllText(OutputFile, sb.ToString()); | ||
return !Log.HasLoggedErrors; | ||
} | ||
|
||
} | ||
} |