Skip to content
Open
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
1 change: 1 addition & 0 deletions Basic.Reference.Assemblies.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<Project Path="Src/Basic.Reference.Assemblies.AspNet110/Basic.Reference.Assemblies.AspNet110.csproj" />
<Project Path="Src/Basic.Reference.Assemblies.AspNet80/Basic.Reference.Assemblies.AspNet80.csproj" />
<Project Path="Src/Basic.Reference.Assemblies.AspNet90/Basic.Reference.Assemblies.AspNet90.csproj" />
<Project Path="Src/Basic.Reference.Assemblies.Net100.Wasm/Basic.Reference.Assemblies.Net100.Wasm.csproj" />
<Project Path="Src/Basic.Reference.Assemblies.Net100/Basic.Reference.Assemblies.Net100.csproj" />
<Project Path="Src/Basic.Reference.Assemblies.Net110/Basic.Reference.Assemblies.Net110.csproj" />
<Project Path="Src/Basic.Reference.Assemblies.Net20/Basic.Reference.Assemblies.Net20.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
Comment thread
2018Zexew marked this conversation as resolved.
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageDownload Include="Microsoft.NETCore.App.Runtime.Mono.browser-wasm" Version="[10.0.7]" />
</ItemGroup>

<Import Project="Generated.targets" />
</Project>
5,271 changes: 5,271 additions & 0 deletions Src/Basic.Reference.Assemblies.Net100.Wasm/Generated.cs

Large diffs are not rendered by default.

692 changes: 692 additions & 0 deletions Src/Basic.Reference.Assemblies.Net100.Wasm/Generated.targets

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<ProjectReference Include="..\Basic.Reference.Assemblies.Net80\Basic.Reference.Assemblies.Net80.csproj" />
<ProjectReference Include="..\Basic.Reference.Assemblies.Net80Windows\Basic.Reference.Assemblies.Net80Windows.csproj" />
<ProjectReference Include="..\Basic.Reference.Assemblies.Net90\Basic.Reference.Assemblies.Net90.csproj" />
<ProjectReference Include="..\Basic.Reference.Assemblies.Net100.Wasm\Basic.Reference.Assemblies.Net100.Wasm.csproj">
<Aliases>Net100Wasm</Aliases>
</ProjectReference>
<ProjectReference Include="..\Basic.Reference.Assemblies.AspNet80\Basic.Reference.Assemblies.AspNet80.csproj" />
<ProjectReference Include="..\Basic.Reference.Assemblies.NetCoreApp31\Basic.Reference.Assemblies.NetCoreApp31.csproj" />
<ProjectReference Include="..\Basic.Reference.Assemblies.NetStandard13\Basic.Reference.Assemblies.NetStandard13.csproj" />
Expand Down
6 changes: 6 additions & 0 deletions Src/Basic.Reference.Assemblies.UnitTests/SanityUnitTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern alias Net100Wasm;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using System;
Expand All @@ -8,6 +10,8 @@
using Xunit.Abstractions;
using Xunit.Sdk;

using Net100WasmAssembly = Net100Wasm::Basic.Reference.Assemblies.Net100Wasm;

namespace Basic.Reference.Assemblies.UnitTests;

public class SanityUnitTests(ITestOutputHelper outputHelper)
Expand Down Expand Up @@ -121,6 +125,7 @@ public void ReferencesLazyInit()
Assert.NotEmpty(NetStandard13.References.All);
Assert.NotEmpty(Net461.References.All);
Assert.NotEmpty(Net472.References.All);
Assert.NotEmpty(Net100WasmAssembly.References.All);
}

[Fact]
Expand Down Expand Up @@ -210,5 +215,6 @@ public void LoadAll()
Net461.References.All.ToList();
Net40.References.All.ToList();
Net70.References.All.ToList();
Net100WasmAssembly.References.All.ToList();
}
}
5 changes: 5 additions & 0 deletions Src/Basic.Reference.Assemblies.UnitTests/TestData.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
extern alias Combined;
extern alias Net100Wasm;


using System.Collections.Generic;
using System.Linq;

using CombinedAssembly = Combined::Basic.Reference.Assemblies;
using Net100WasmAssembly = Net100Wasm::Basic.Reference.Assemblies.Net100Wasm;

namespace Basic.Reference.Assemblies.UnitTests
{
Expand All @@ -29,6 +32,7 @@ public static IEnumerable<object[]> ApplicationReferences
new object[] { "net8.0", CombinedAssembly.Net80.References.All },
new object[] { "net8.0", AspNet80.References.All },
new object[] { "net9.0", Net90.References.All },
new object[] { "net10.0-wasm", Net100WasmAssembly.References.All },
};
}
}
Expand Down Expand Up @@ -71,6 +75,7 @@ public static IEnumerable<object[]> AllValues
new object[] { "net7.0", Net70.ReferenceInfos.AllValues },
new object[] { "net8.0", Net80.ReferenceInfos.AllValues },
new object[] { "net9.0", Net90.ReferenceInfos.AllValues },
new object[] { "net10.0-wasm", Net100WasmAssembly.ReferenceInfos.AllValues },

new object[] { "netstandard2.0", CombinedAssembly.NetStandard20.ReferenceInfos.AllValues },
new object[] { "net472", CombinedAssembly.Net472.ReferenceInfos.AllValues },
Expand Down
53 changes: 37 additions & 16 deletions Src/Generate/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
Net80Windows();
Net90();
Net100();
Net100Wasm();
Net110();
AspNet80();
AspNet90();
Expand Down Expand Up @@ -108,6 +109,15 @@ void Net100()
File.WriteAllText(Path.Combine(targetDir, "Generated.targets"), content.TargetsContent, encoding);
}

void Net100Wasm()
{
var content = GetGeneratedContent("Net100Wasm", [@"microsoft.netcore.app.runtime.mono.browser-wasm/10.0.7/runtimes/browser-wasm/lib/net10.0"]);
var targetDir = Path.Combine(srcPath, "Basic.Reference.Assemblies.Net100.Wasm");
Directory.CreateDirectory(targetDir);
File.WriteAllText(Path.Combine(targetDir, "Generated.cs"), content.CodeContent, encoding);
File.WriteAllText(Path.Combine(targetDir, "Generated.targets"), content.TargetsContent, encoding);
}

void Net110()
{
var content = GetGeneratedContent("Net110", [@"microsoft.netcore.app.ref/11.0.0-preview.3.26207.106/ref/net11.0"]);
Expand Down Expand Up @@ -591,31 +601,42 @@ public static ImmutableArray<PortableExecutableReference> All
}
""");
}
}

static IEnumerable<(string FilePath, string RelativeFilePath, Guid Mvid)> FindDlls(string[] packagePaths, string packagePrefix)
static IEnumerable<(string FilePath, string RelativeFilePath, Guid Mvid)> FindDlls(string[] packagePaths, string packagePrefix)
{
var dllPaths = new List<string>();
foreach (var packagePath in packagePaths)
{
var dllPaths = new List<string>();
foreach (var packagePath in packagePaths)
dllPaths.AddRange(Directory.GetFiles(packagePath, "*.dll"));

var facadesPath = Path.Combine(packagePath, "Facades");
if (Directory.Exists(facadesPath))
{
dllPaths.AddRange(Directory.GetFiles(packagePath, "*.dll"));
var facadesPath = Path.Combine(packagePath, "Facades");
if (Directory.Exists(facadesPath))
{
dllPaths.AddRange(Directory.GetFiles(facadesPath, "*.dll"));
}
dllPaths.AddRange(Directory.GetFiles(facadesPath, "*.dll"));
}

var allPropNames = new List<string>();
foreach (var dllPath in dllPaths)
var nativePath = Path.GetFullPath(Path.Combine(packagePath, "..", "..", "native"));
if (Directory.Exists(nativePath))
{
if (GetMvid(dllPath) is not var (mvid, isAssembly) || !isAssembly)
var coreLibPath = Path.Combine(nativePath, "System.Private.CoreLib.dll");
if (File.Exists(coreLibPath) && !dllPaths.Contains(coreLibPath))
{
continue;
dllPaths.Add(coreLibPath);
}
}
}

var relativeFilePath = dllPath.Substring(packagePrefix.Length);
yield return (dllPath, relativeFilePath, mvid);
var allPropNames = new List<string>();
foreach (var dllPath in dllPaths)
{
if (GetMvid(dllPath) is not var (mvid, isAssembly) || !isAssembly)
{
continue;
}

var relativeFilePath = dllPath.Substring(packagePrefix.Length);
yield return (dllPath, relativeFilePath, mvid);
}
}

Expand Down