Merge pull request #734 from PowerShell/typecataloggen
Fix type catalog generation
This commit is contained in:
commit
d8de5d20bf
File diff suppressed because it is too large
Load Diff
@ -23,10 +23,9 @@
|
||||
"define": [ "CORECLR" ]
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.5.0-rc2-23921",
|
||||
"System.Security.Principal": "4.0.1-rc2-23921",
|
||||
"System.Security.Principal.Windows": "4.0.0-rc2-23921",
|
||||
"System.Diagnostics.TraceSource": "4.0.0-rc2-23921",
|
||||
"System.Security.Principal": "4.0.1-rc2-23922",
|
||||
"System.Security.Principal.Windows": "4.0.0-rc2-23922",
|
||||
"System.Diagnostics.TraceSource": "4.0.0-rc2-23922",
|
||||
"System.Security.SecureString": "1.0.0-*"
|
||||
}
|
||||
}
|
||||
|
@ -1,51 +0,0 @@
|
||||
{
|
||||
"description": "Facade to generate folder of dependencies",
|
||||
|
||||
"authors": [ "andschwa" ],
|
||||
|
||||
"dependencies": {
|
||||
"Newtonsoft.Json": "8.0.2",
|
||||
"System.Xml.XDocument": "4.0.11-rc2-23922",
|
||||
"Microsoft.CSharp": "4.0.1-rc2-23922",
|
||||
"Microsoft.Win32.Registry.AccessControl": "4.0.0-rc2-23922",
|
||||
"System.Collections.Specialized": "4.0.1-rc2-23922",
|
||||
"System.Collections.NonGeneric": "4.0.1-rc2-23922",
|
||||
"System.ComponentModel.EventBasedAsync": "4.0.11-rc2-23922",
|
||||
"System.ComponentModel.TypeConverter": "4.0.1-rc2-23922",
|
||||
"System.Data.Common": "4.0.1-rc2-23922",
|
||||
"System.Diagnostics.Contracts": "4.0.1-rc2-23922",
|
||||
"System.Diagnostics.FileVersionInfo": "4.0.0-rc2-23922",
|
||||
"System.Diagnostics.Process": "4.1.0-rc2-23922",
|
||||
"System.Diagnostics.StackTrace": "4.0.1-rc2-23922",
|
||||
"System.Diagnostics.TraceSource": "4.0.0-rc2-23922",
|
||||
"System.Dynamic.Runtime": "4.0.11-rc2-23922",
|
||||
"System.IO.FileSystem.AccessControl": "4.0.0-rc2-23922",
|
||||
"System.IO.FileSystem.DriveInfo": "4.0.0-rc2-23922",
|
||||
"System.IO.FileSystem.Watcher": "4.0.0-rc2-23922",
|
||||
"System.IO.Pipes": "4.0.0-rc2-23922",
|
||||
"System.Linq.Expressions": "4.0.11-rc2-23922",
|
||||
"System.Net.Http": "4.0.1-rc2-23922",
|
||||
"System.Net.NetworkInformation": "4.1.0-rc2-23922",
|
||||
"System.Reflection.Emit": "4.0.1-rc2-23922",
|
||||
"System.Reflection.Emit.Lightweight": "4.0.1-rc2-23922",
|
||||
"System.Security.AccessControl": "4.0.0-rc2-23922",
|
||||
"System.Security.Cryptography.Algorithms": "4.1.0-rc2-23922",
|
||||
"System.Security.Cryptography.X509Certificates": "4.1.0-rc2-23922",
|
||||
"System.Threading.Thread": "4.0.0-rc2-23922",
|
||||
"System.Threading.Tasks.Parallel": "4.0.1-rc2-23922",
|
||||
"System.Xml.XPath.XmlDocument": "4.0.1-rc2-23922",
|
||||
"System.Xml.XmlDocument": "4.0.1-rc2-23922",
|
||||
"System.Xml.XmlSerializer": "4.0.11-rc2-23922",
|
||||
"System.ServiceProcess.ServiceController": "4.1.0-rc2-23922",
|
||||
"System.Net.NameResolution": "4.0.0-rc2-23922",
|
||||
"Microsoft.CodeAnalysis.CSharp": "1.1.1",
|
||||
"NETStandard.Library": "1.5.0-rc2-23922",
|
||||
"System.Runtime.Loader": "4.0.0-rc2-23922"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"netstandardapp1.5": {
|
||||
"imports": [ "dnxcore50", "netstandardapp1.5", "portable-net45+win8" ]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +1,10 @@
|
||||
. mono-snapshot mono
|
||||
export DOTNET_REFERENCE_ASSEMBLIES_PATH=$MONO_PREFIX/lib/mono/xbuild-frameworks/
|
||||
|
||||
pushd Runtime
|
||||
pushd ../TypeCatalogParser
|
||||
dotnet restore
|
||||
dotnet publish --output bin
|
||||
dotnet run
|
||||
popd
|
||||
|
||||
ls Runtime/bin/*.dll | sed ':a;N;$!ba;s/\n/;/g' > powershell.inc
|
||||
|
||||
dotnet restore
|
||||
dotnet run CorePsTypeCatalog.cs powershell.inc
|
||||
cp CorePsTypeCatalog.cs ../Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/
|
||||
dotnet run ../Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CorePsTypeCatalog.cs powershell.inc
|
||||
|
35
src/TypeCatalogParser/Main.cs
Normal file
35
src/TypeCatalogParser/Main.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NuGet.Frameworks;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.ProjectModel;
|
||||
using Microsoft.DotNet.ProjectModel.Graph;
|
||||
using Microsoft.Extensions.DependencyModel.Resolution;
|
||||
|
||||
namespace ConsoleApplication
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
// The TypeCatalogGen project takes this as input
|
||||
var outputPath = "../TypeCatalogGen/powershell.inc";
|
||||
|
||||
// Get a context for our top level project
|
||||
var context = ProjectContext.Create("../Microsoft.PowerShell.Linux.Host", NuGetFramework.Parse("netstandardapp1.5"));
|
||||
|
||||
System.IO.File.WriteAllLines(outputPath,
|
||||
// Get the target for the current runtime
|
||||
from t in context.LockFile.Targets where t.RuntimeIdentifier == Constants.RuntimeIdentifier
|
||||
// Get the packages (not projects)
|
||||
from x in t.Libraries where x.Type == "package"
|
||||
// Get the real reference assemblies
|
||||
from y in x.CompileTimeAssemblies where y.Path.EndsWith(".dll")
|
||||
// Construct the path to the assemblies
|
||||
select $"{context.PackagesDirectory}/{x.Name}/{x.Version}/{y.Path};");
|
||||
|
||||
Console.WriteLine($"List of reference assemblies written to {outputPath}");
|
||||
}
|
||||
}
|
||||
}
|
26
src/TypeCatalogParser/project.json
Normal file
26
src/TypeCatalogParser/project.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilationOptions": {
|
||||
"warningsAsErrors": true,
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"Microsoft.DotNet.ProjectModel": "1.0.0-beta-*",
|
||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-beta-*"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"netstandardapp1.5": {
|
||||
"imports": [ "dnxcore50", "portable-net45+win8" ]
|
||||
}
|
||||
},
|
||||
|
||||
"runtimes": {
|
||||
"ubuntu.14.04-x64": { },
|
||||
"centos.7.1-x64": { },
|
||||
"win7-x64": { },
|
||||
"win10-x64": { },
|
||||
"osx.10.10-x64": { },
|
||||
"osx.10.11-x64": { }
|
||||
}
|
||||
}
|
5
test/powershell/DotNetInterop.Tests.ps1
Normal file
5
test/powershell/DotNetInterop.Tests.ps1
Normal file
@ -0,0 +1,5 @@
|
||||
Describe ".NET class interoperability" {
|
||||
It "Should access types in System.Console" {
|
||||
[System.Console]::TreatControlCAsInput | Should Be $false
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user