Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to process assemblies with generics <T> #183

Open
wants to merge 298 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
298 commits
Select commit Hold shift + click to select a range
e54d632
Serious rework on dumper
josesimoes Jan 15, 2021
0c4565d
Add and reorder tables
josesimoes Jan 22, 2021
0fb8e2e
Add property to expose table type
josesimoes Jan 22, 2021
a5c2e85
Add member ref table
josesimoes Jan 22, 2021
1631397
Reorder minimization order
josesimoes Jan 22, 2021
96cb3bc
Add property exposing table type
josesimoes Jan 22, 2021
8ce1df7
Add and reorder tables
josesimoes Jan 22, 2021
bcd5f9d
Add assert to MemberRef dependency crawler
josesimoes Jan 22, 2021
8302a5d
Add assert to TypeSpec dependency crawler
josesimoes Jan 22, 2021
ec68b14
Improve generics processing in Method crawler
josesimoes Jan 22, 2021
8fd3aa9
Improve tables context
josesimoes Jan 22, 2021
7db9f84
Fix MethodSpec table write
josesimoes Jan 22, 2021
6320b7b
Fix MethodRef table write
josesimoes Jan 22, 2021
da3b73b
Rework dumper genertor
josesimoes Jan 22, 2021
3150791
Fix getting MethodSpec
josesimoes Jan 22, 2021
ac0c5a0
Rename comparer to match class
josesimoes Jan 23, 2021
ffc36e0
Improve selection of methods with generic parameters
josesimoes Jan 23, 2021
f9c9de7
Add lengh check on typespec writing
josesimoes Jan 23, 2021
add48c7
Add RemoveUnusedItems to TypeSpecs table
josesimoes Jan 23, 2021
dc1c5fd
Improve GetItems on TypeSpecs table
josesimoes Jan 23, 2021
20a1dbf
Add property with CLR table to TypeSpec table
josesimoes Jan 23, 2021
4e3d207
Improve TypeReferenceComparer
josesimoes Jan 23, 2021
c40f397
Add TypeSpecBySignatureComparer
josesimoes Jan 23, 2021
1f9bbab
Improvements and fixes on TypeSpec table class
josesimoes Jan 23, 2021
fad6156
Fix GetOrCreateTypeSpecificationId
josesimoes Jan 23, 2021
b4e40c2
Fix TryGetTypeReferenceId
josesimoes Jan 23, 2021
3211718
Move generic params table to the end of the other tables
josesimoes Jan 23, 2021
9c11510
GenericParameters now contain parameter type
josesimoes Jan 23, 2021
7be37ee
Improve generic parameter type handling
josesimoes Jan 23, 2021
4a62847
Replace inlineType enum with nf encoding
josesimoes Jan 26, 2021
4b4da84
Add TableIndex property to missing tables
josesimoes Jan 26, 2021
7b5f390
Fix signature of generic instance
josesimoes Jan 26, 2021
4bfb6b4
Minor fixes in comments and usings
josesimoes Jan 26, 2021
d104ab5
Fix genericinstance signature
josesimoes Jan 26, 2021
425b8d1
Improvements in WriteSubTypeInfo
josesimoes Jan 26, 2021
0a3354f
Fix signature generator for generic instance
josesimoes Jan 26, 2021
d10476a
Add MethodReferenceExtensions
josesimoes Jan 27, 2021
c963e5b
Rework Generic parameters table write
josesimoes Jan 27, 2021
ada6de8
Rework MethodDef flags related with generic parameters
josesimoes Jan 27, 2021
60dc334
Rework fields reference table write
josesimoes Jan 27, 2021
fef0c6d
Improvements in pdbx writer
josesimoes Jan 28, 2021
21a5c26
Rename CLR_TABLESENUM
josesimoes Jan 28, 2021
db3bdc3
Rename nanoCLR_DataType to nanoClrDataType
josesimoes Jan 29, 2021
7072866
Improvements in PDBX writer
josesimoes Jan 29, 2021
85e998f
Improvements in dump output
josesimoes Jan 29, 2021
7347da1
Simplification of GetMethodReferenceId
josesimoes Jan 29, 2021
e488419
Fix TonanoClrTable in MethodReferenceExtensions
josesimoes Jan 29, 2021
861513e
Fix name to use camel case
josesimoes Jan 29, 2021
664357f
Remove unnecessary property
josesimoes Jan 29, 2021
89f66b1
Improvements in PDBX writer
josesimoes Jan 30, 2021
afd8b70
Fix class name and identation
josesimoes Feb 1, 2021
1519fe9
Add extension of CLR tables enum
josesimoes Feb 1, 2021
42e5687
Pdbx writer now uses coded table index
josesimoes Feb 1, 2021
2f114c1
Rename ClrTable enum to nanoClrTable
josesimoes Feb 1, 2021
3a777b5
Remove unnecessary hexa prefixes
josesimoes Feb 1, 2021
43d0d26
Add MemberRef extensions
josesimoes Feb 2, 2021
058e97a
Rework GetMethodReferenceId to use member reference table
josesimoes Feb 2, 2021
e1f668d
Remove MemberRef table
josesimoes Feb 3, 2021
38256aa
Add extension to "fix" type names for generic parameters and arguments
josesimoes Feb 3, 2021
4320cb9
Fix order of type checking in MemberRef extensions
josesimoes Feb 3, 2021
7bc23de
Add extensions to fix type names
josesimoes Feb 3, 2021
6e5b8b8
Add method to add a new item to nanoReferenceTableBase
josesimoes Feb 3, 2021
ffc8e63
Replace flag in TypeDef flags
josesimoes Feb 3, 2021
9497981
Rework accessibility of (now) internal list of TypeDefs
josesimoes Feb 3, 2021
a33197c
Fix order in which tables are cleaned up after minimization
josesimoes Feb 3, 2021
dbf4055
Generic type instances are now added as fake TypeDefs
josesimoes Feb 3, 2021
a87529f
Fix pbdx writer
josesimoes Feb 4, 2021
ccef437
Improvements on TypeReference comparer
josesimoes Feb 4, 2021
a9de567
Move TypeReferenceEqualityComparer to it's own file
josesimoes Feb 4, 2021
3c5374a
Improvements in TypeReferenceEqualityComparer
josesimoes Feb 4, 2021
38cd071
Complete rework TableSpecs class
josesimoes Feb 4, 2021
169f923
Fix build
josesimoes Feb 4, 2021
8d94b35
Improve BuildDependencyList with TypeSpec tokens
josesimoes Feb 4, 2021
9556e47
Add fields to generic class to improve testability
josesimoes Feb 4, 2021
8847047
Temporary fix for FieldRef
josesimoes Feb 4, 2021
c109d21
Update dumper to output TypeSpec members
josesimoes Feb 4, 2021
9d144c8
PDBX writer now outputs TypeSpec members
josesimoes Feb 4, 2021
2b55a1d
Fix property access in TypeDefinitionTable
josesimoes Feb 4, 2021
ce50f68
AddItem in nanoReferenceTableBase now accepts index argument
josesimoes Feb 4, 2021
86a3ddf
Add ConvertToNanoClrTable to help converting tables
josesimoes Feb 4, 2021
9a7af1c
Add CLR_TypeRefOrSpecTables
josesimoes Feb 4, 2021
05fb759
Rework MethodRef write to use correct conversion
josesimoes Feb 4, 2021
6b5623b
Rework FieldRef write
josesimoes Feb 4, 2021
bd34013
Add ToCLR_TypeRefOrSpec to extensions
josesimoes Feb 4, 2021
cead262
Fix processing of array types as TypeSpec
josesimoes Feb 5, 2021
e7e2617
Remove extra processing of exception handler type
josesimoes Feb 5, 2021
e42dc92
Add back MemberRef table
josesimoes Feb 5, 2021
9afe21c
Revert change in TypeDef flag
josesimoes Feb 5, 2021
6cff152
Rework helper methods in TypeSpec table
josesimoes Feb 5, 2021
621c97c
Fix GetMethodReferenceId
josesimoes Feb 5, 2021
f391062
Improve compress token helper to a more resusable one
josesimoes Feb 5, 2021
3248a93
Rework GetFieldReferenceId
josesimoes Feb 6, 2021
e472cb8
Rework GetMethodReferenceId
josesimoes Feb 6, 2021
2b4a9c7
Add list of table to use when encoding MemberRefs related with fields
josesimoes Feb 6, 2021
a70945a
Fix table encoding algorithm
josesimoes Feb 6, 2021
9a63475
Fix GetMethodReferenceId
josesimoes Feb 9, 2021
692a91f
Fix MethodSpec table
josesimoes Feb 11, 2021
4b8f856
Add check for multidimensional arrays
josesimoes Feb 12, 2021
2c4b50a
Fix GetFieldRef
josesimoes Feb 17, 2021
2cfa0e0
Replace PDBX writer with json serializer
josesimoes Feb 18, 2021
563eb8f
Global rename of CLR to use all upper case
josesimoes Feb 19, 2021
9e3bf0f
Fix type spec table constructor
josesimoes Mar 12, 2021
fc16431
Fixes to move to shared project
josesimoes Feb 21, 2023
a8c3f48
Move PDBX writer to shared project
josesimoes Feb 21, 2023
64834cd
Fix dump generator
josesimoes Feb 21, 2023
b79292f
Fix binary writer
josesimoes Feb 21, 2023
5ff18a1
Fix extensions
josesimoes Feb 21, 2023
a36faa6
Fix code writer
josesimoes Feb 21, 2023
fde3b9c
Fix pdbx writer
josesimoes Feb 21, 2023
1db8e0b
Fix tables classes
josesimoes Feb 21, 2023
477437f
Fix utility classes
josesimoes Feb 21, 2023
1ba4959
Fix miscellaneous classes in shared project
josesimoes Feb 21, 2023
5923bfa
Fix build
josesimoes Feb 21, 2023
dfcbed0
Fix dumper generator to handle custom attributes
josesimoes Feb 23, 2023
f9f5129
Improve CLR integration tests
josesimoes Feb 23, 2023
4071b2e
Bump version to 4.0
josesimoes Feb 23, 2023
71a9d07
Fix helper class for Unit Tests
josesimoes Mar 9, 2023
6410de7
Fix TypeSignatureAsString to process classes
josesimoes Mar 9, 2023
1727f19
Add initializer to Unit test to use nanoclr instead of WIN32 for runner
josesimoes Mar 10, 2023
118c71e
Update mscorlib sub-module @18ec78d
josesimoes Mar 14, 2023
3d61792
Improvements in debugger helper
josesimoes Mar 14, 2023
792d0b4
Rework CLR integration tests to use nanoclr CLI instead of WIN32 exec…
josesimoes Mar 14, 2023
f91b4e0
Add back changes from #153
josesimoes Mar 14, 2023
cbe054f
Add definition for MDP build task
josesimoes Mar 14, 2023
8e54bea
Porting #148
josesimoes Mar 14, 2023
f809d37
Comment out msbuild task tests
josesimoes Mar 14, 2023
5f4f2d1
Fix dumper unit test with new output format
josesimoes Mar 14, 2023
33c2982
Update test object helper with latest changes from upstream
josesimoes Mar 14, 2023
cd26ef6
Improvements in CLR integration tests
josesimoes Mar 15, 2023
41c3879
Remove unnecessary pre-build event from test project
josesimoes Mar 15, 2023
c4a8856
Fix output message with assembly checksum
josesimoes Mar 15, 2023
7c83f2e
Improvements in CLR integration tests
josesimoes Mar 15, 2023
b8d6eb7
Add missing license header
josesimoes Mar 15, 2023
20a24ff
Add diagnostic verbose output on CLR integration tests
josesimoes Mar 15, 2023
fd1910c
Fix paths of PE files for test app
josesimoes Mar 15, 2023
b70ed27
Fix regexe checking for nanoclr install/update
josesimoes Mar 15, 2023
f979fb6
Local path for nanoCLR instance is now only available on debug build
josesimoes Mar 15, 2023
24b6c18
Fix dump template for FieldDef
josesimoes Mar 15, 2023
075c127
Add info about entry point in dump output
josesimoes Mar 20, 2023
c3ed6c4
Improve output of local listing in method definition
josesimoes Mar 21, 2023
31c4a39
Add note about mirror update needed with structs shared with native CLR
josesimoes Mar 23, 2023
3687c18
Improve debug output of signature tables generator
josesimoes Mar 24, 2023
900924d
Fix typo in comment
josesimoes Mar 24, 2023
de1f7a0
Add comment to stress need to keep table order in sync with native
josesimoes Mar 24, 2023
84e0054
Improve output from generic unit tests
josesimoes Mar 24, 2023
c1236a5
Add extra debug information to verbose output of table elements
josesimoes Mar 27, 2023
1071f7d
Add Generic Params table to dump output
josesimoes Mar 28, 2023
e48c416
More improvements in Unit Tests
josesimoes Mar 28, 2023
a6f3743
Enable back more unit tests after fixes in nanoCLR
josesimoes Mar 28, 2023
bc77656
Improve DumpAssemblyTest
josesimoes Mar 30, 2023
0f0976b
Add more generic unit tests with new classes with more generics
josesimoes Mar 30, 2023
4da474e
Replace NULLs with nullpts in skeletons and assembly declarations
josesimoes Mar 30, 2023
539aeb3
CLR integration Unit Tests are now able to specify a local instance o…
josesimoes Apr 5, 2023
7144b10
Extract ToString for several dump outputs
josesimoes Apr 6, 2023
9c0fd53
Improvements in CLR integration unit tests
josesimoes Apr 6, 2023
76d040b
Fix method CRC test
josesimoes Apr 6, 2023
0b853ac
Rework dumper tests to remove hard coded string outputs
josesimoes Apr 6, 2023
089fced
Update mscorlib @ fb3230c
josesimoes Apr 27, 2023
1ddcb2b
Update mscorlib sub-module @9d81efc
josesimoes May 29, 2023
e2ced9e
Improve CLR tests setup to install nanoclr only if needed
josesimoes May 29, 2023
634d98f
Add solution for test app
josesimoes Jun 1, 2023
8b98d68
Add runsettings for test app
josesimoes Jun 1, 2023
fd6b2ab
Merge branch 'main' of https://github.com/nanoframework/metadata-proc…
josesimoes Jun 2, 2023
70cf7a3
Fix processing TyepSpec in ldtoken
josesimoes Jun 2, 2023
7cb476e
Fix building ldtoken for typespec
josesimoes Jun 7, 2023
2de2f34
Fix test code for typeof of array
josesimoes Jun 7, 2023
d438f77
Fix build of mscorlib for nano projects in Unit Tests
josesimoes Jun 7, 2023
93956cf
Improve test app for generics
josesimoes Jun 9, 2023
2c6c69d
Fix call to MethodDef
josesimoes Jun 13, 2023
941554d
Work on MDP msbuild task
josesimoes Jun 13, 2023
ebece56
Work test project
josesimoes Jun 13, 2023
e64c146
Add runsettings file for unit tests
josesimoes Jun 13, 2023
82d7f30
Fix metadata token converter for Method
josesimoes Jun 13, 2023
390060b
Fix dump code for TypeDef fields
josesimoes Jun 13, 2023
5d95759
msbuild task test now generates PDBX
josesimoes Jun 13, 2023
0ddfc7c
Code style formatting for PDBX file writer
josesimoes Jun 13, 2023
aebd210
Add missing processing for Generic Param in ldtoken IL
josesimoes Jun 13, 2023
1d9d9f8
Improve generics class with more output on generic types
josesimoes Jun 13, 2023
a7b8c4d
Code fixes from static analysis
josesimoes Jun 13, 2023
c7d0e94
Fix output of types for generic locals
josesimoes Jun 30, 2023
518cca5
Add edge case with referencing enums in another assembly
josesimoes Apr 11, 2024
85cd505
Fix Log output messages
josesimoes Apr 11, 2024
f0bc9c2
Add edge case with referencing enums in another assembly (#162)
josesimoes Apr 11, 2024
5654aae
Add check for string table size (#164)
josesimoes Jun 12, 2024
adffec3
Update dependencies
josesimoes Sep 9, 2024
ea453f8
Add unit tests for delegate flags in methods (#168)
josesimoes Sep 18, 2024
9be54a4
Method flags now processes finalizer (#169)
josesimoes Sep 19, 2024
5ea49d3
Work CI-CD
josesimoes Sep 19, 2024
1d24072
Work CI-CD
josesimoes Sep 19, 2024
ae26335
Remove wrong runsettings file from test app
josesimoes Sep 24, 2024
5196c25
Add check for byte code table size (#170)
MateuszKlatecki Oct 29, 2024
300253d
Now processes auto generated backing fields (#172)
josesimoes Jan 23, 2025
2d61de8
Update dependencies
josesimoes Jan 23, 2025
208bc59
Work CI-CD
nfbot Jan 23, 2025
8d134a4
Improve processing of custom attributes (#173)
josesimoes Feb 3, 2025
ec0e033
Work CI-CD
josesimoes Feb 3, 2025
1622a3e
Remove unused files
josesimoes Feb 3, 2025
919a0a9
Work CI-CD
josesimoes Feb 3, 2025
413cc3a
Work CI-CD
josesimoes Feb 3, 2025
e28e43b
Add sanity check for method counters (#174)
josesimoes Feb 11, 2025
d26b18a
Work CI-CD
josesimoes Feb 20, 2025
08c0da0
Add VS editor config and dic exclusion list
josesimoes Feb 20, 2025
5727406
Various fixes in README
josesimoes Feb 20, 2025
6ea12f4
Work CI-CD
josesimoes Feb 20, 2025
2a3a67d
Work CI-CD
josesimoes Feb 20, 2025
7bb67dd
Add back CLR integrations tests (#175)
josesimoes Feb 20, 2025
9886c10
Work on old MDP
josesimoes Feb 20, 2025
b5b4b28
Fix generated metadata in TypeDef processing (#176)
josesimoes Feb 21, 2025
559b2e0
Fix merge from previous commit
josesimoes Feb 21, 2025
61f0c7e
Fix usage of HTTP header in nanoCLR install (#177)
josesimoes Feb 21, 2025
8b5f7d0
Work CI-CD
josesimoes Feb 21, 2025
c28b0cb
Add processing of exclude type attribute (#179)
josesimoes Feb 25, 2025
5402229
Fix processing of auto backing fields (#180)
josesimoes Feb 26, 2025
d9fd346
Improve type comparison for declarations and stubs (#181)
josesimoes Feb 28, 2025
59d340f
Update mscrolib sub-module @4f1e809
josesimoes Mar 17, 2025
0ed35fe
Update test project references
josesimoes Mar 17, 2025
70a825c
Update path to nanoCLR in debug run
josesimoes Mar 17, 2025
487fd95
Fix several unit tests
josesimoes Mar 17, 2025
9268d15
Skeleton generator now has an extra compiler def to control output of…
josesimoes Mar 17, 2025
0f2f1b7
Dumper generator now outputs arg for push integer
josesimoes Mar 17, 2025
20ed3fd
Fix getting scope for type references
josesimoes Mar 18, 2025
e591be7
Fix FillTypeSpecsFromTypes
josesimoes Mar 18, 2025
a441db6
Update unit tests for dumper output
josesimoes Mar 18, 2025
9034f23
Fix nf-interpreter sub-module declaration
josesimoes Mar 18, 2025
5fd9918
Update nf-interpreter sub-module @b6e028d11b255fcbd38ce5b408b50f87a19…
josesimoes Mar 18, 2025
9506542
Add missing operand type in build dependencies
josesimoes Mar 19, 2025
7a0a53e
Fix issue with getting TypeSpec from list
josesimoes Mar 19, 2025
08587e2
Unit test running real apps now output the output of those
josesimoes Mar 20, 2025
d39466f
Add attributes in other assembly to test app
josesimoes Mar 20, 2025
23a35ad
Manual merge from main
josesimoes Apr 1, 2025
b5e6140
Update sub-modules
josesimoes Apr 1, 2025
e789435
Fix order of calls in test app
josesimoes Apr 1, 2025
b7049b0
Fix dumper test output
josesimoes Apr 1, 2025
ca0a1fd
Merge branch 'main' of https://github.com/nanoframework/metadata-proc…
josesimoes Apr 1, 2025
07bf7d8
Fix merge
josesimoes Apr 1, 2025
807b693
Code format fixes
josesimoes Apr 1, 2025
24273b0
Fix .NET version
josesimoes Apr 1, 2025
027f8d9
Fix merge
josesimoes Apr 1, 2025
208e819
Update sub-modules
josesimoes Apr 3, 2025
e8de20f
Add README to solution items
josesimoes Apr 3, 2025
0bdb45d
Add sync tags
josesimoes Apr 3, 2025
1276c96
Addressing code review
josesimoes Apr 3, 2025
8950034
Replace hardcoded nanoCLR path with env var
josesimoes Apr 3, 2025
daff999
Update sub-module
josesimoes Apr 3, 2025
1520eb1
Delete nf-interpreter sub-module
josesimoes Apr 3, 2025
596893a
Delete sub-module nf-interpreter
josesimoes Apr 3, 2025
0568381
Add back nf-interpreter sub-module
josesimoes Apr 3, 2025
a9fcff7
Fix README code style
josesimoes Apr 3, 2025
b22a2ce
Update sub-modules
josesimoes Apr 3, 2025
09aa401
Update mscorlib sub-module
josesimoes Apr 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
url = https://github.com/nanoframework/CoreLibrary
[submodule "native/nf-interpreter"]
path = native/nf-interpreter
url = https://github.com/nanoframework/nf-interpreter
url = https://github.com/nanoframework/nf-interpreter.git
9 changes: 9 additions & 0 deletions .runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<TestSessionTimeout>120000</TestSessionTimeout><!-- Milliseconds -->
<TargetFrameworkVersion>net472</TargetFrameworkVersion>
<TargetPlatform>x64</TargetPlatform>
</RunConfiguration>
</RunSettings>
19 changes: 6 additions & 13 deletions MetadataProcessor.Console/Program.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
//
// Copyright (c) .NET Foundation and Contributors
// Original work from Oleg Rakhmatulin.
// See LICENSE file in the project root for full license information.
//
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Mono.Cecil;
using nanoFramework.Tools.MetadataProcessor.Core;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Xml;
using Mono.Cecil;
using nanoFramework.Tools.MetadataProcessor.Core;

namespace nanoFramework.Tools.MetadataProcessor.Console
{
Expand Down Expand Up @@ -93,10 +89,7 @@ public void Compile(
_assemblyBuilder.Write(GetBinaryWriter(writer));
}

using (var writer = XmlWriter.Create(Path.ChangeExtension(fileName, "pdbx")))
{
_assemblyBuilder.Write(writer);
}
_assemblyBuilder.Write(Path.ChangeExtension(fileName, "pdbx"));

if (DumpMetadata)
{
Expand Down Expand Up @@ -188,7 +181,7 @@ public void GenerateDependency(string fileName)

public static void Main(string[] args)
{
FileVersionInfo fileVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
FileVersionInfo fileVersion = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);

bool isCoreLibrary = false;

Expand Down
8 changes: 5 additions & 3 deletions MetadataProcessor.Console/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Reflection;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle ("nanoFramework.MetadataProcessor.Console")]
[assembly: AssemblyTitle("nanoFramework.MetadataProcessor.Console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("nanoFramework project contributors")]
Expand Down
13 changes: 13 additions & 0 deletions MetadataProcessor.Core/MetadataProcessor.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@
<None Include="packages.lock.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Git">
<Version>8.0.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.Common">
<Version>8.0.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>8.0.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -75,6 +85,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Text.Json">
<Version>8.0.5</Version>
</PackageReference>
</ItemGroup>
<Import Project="..\MetadataProcessor.Shared\MetadataProcessor.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
19 changes: 11 additions & 8 deletions MetadataProcessor.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
using System.Reflection;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("nanoFramework.MetadataProcessor.Core")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("nanoFramework project contributors")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("Copyright (c) 2019 The nanoFramework project contributors")]
[assembly: AssemblyTitle("nanoFramework.MetadataProcessor.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("nanoFramework project contributors")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright (c) 2019 The nanoFramework project contributors")]

[assembly: InternalsVisibleTo("nanoFramework.Tools.MetadataProcessor.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010035b49090a010c2970b2f8df8f66ad47a09583d654c0f2375980cf4afcfb48141ec9fd27d464b93a3216545588a5119d779c0ec66eed7c715567c2315cb908f70403b3bb59018b34096ad29c1c91f8d3c83ad407052ead9112e694660dec0ce7a361bff67781cf041e19d78afd128603dd188eb238186ac5aa6caf418891d5bb2")]
[assembly: InternalsVisibleTo("nanoFramework.Tools.MetadataProcessor.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")]
Binary file modified MetadataProcessor.Core/key.snk
Binary file not shown.
81 changes: 77 additions & 4 deletions MetadataProcessor.Core/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
"version": 1,
"dependencies": {
".NETFramework,Version=v4.7.2": {
"Microsoft.Build.Tasks.Git": {
"type": "Direct",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
},
"Microsoft.SourceLink.Common": {
"type": "Direct",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
"requested": "[8.0.0, )",
Expand Down Expand Up @@ -30,15 +42,76 @@
"resolved": "3.7.115",
"contentHash": "EpXamaAdRfG/BMxGgvZlTM0npRnkmXUjAj8OdNKd17t4oN+2nvjdv/KnFmzOOMDqvlwB49UCwtOHJrAQTfUBtQ=="
},
"Microsoft.Build.Tasks.Git": {
"System.Text.Json": {
"type": "Direct",
"requested": "[8.0.5, )",
"resolved": "8.0.5",
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==",
"dependencies": {
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
"System.Buffers": "4.5.1",
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "8.0.0",
"System.Threading.Tasks.Extensions": "4.5.4",
"System.ValueTuple": "4.5.0"
}
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
"contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw==",
"dependencies": {
"System.Threading.Tasks.Extensions": "4.5.4"
}
},
"Microsoft.SourceLink.Common": {
"System.Buffers": {
"type": "Transitive",
"resolved": "4.5.1",
"contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg=="
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.5",
"contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==",
"dependencies": {
"System.Buffers": "4.5.1",
"System.Numerics.Vectors": "4.5.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.3"
}
},
"System.Numerics.Vectors": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ=="
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==",
"dependencies": {
"System.Buffers": "4.5.1",
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "4.5.3"
}
},
"System.ValueTuple": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
}
},
".NETFramework,Version=v4.7.2/win": {},
Expand Down
60 changes: 44 additions & 16 deletions MetadataProcessor.MsBuildTask/MetaDataProcessorTask.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
//
// Copyright (c) .NET Foundation and Contributors
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
// See LICENSE file in the project root for full license information.
//
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.ComponentModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using nanoFramework.Tools.Utilities;
using System.Xml;
using nanoFramework.Tools.MetadataProcessor.Core;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Mono.Cecil;
using nanoFramework.Tools.MetadataProcessor.Core;
using nanoFramework.Tools.Utilities;

namespace nanoFramework.Tools.MetadataProcessor.MsBuildTask
{
Expand Down Expand Up @@ -126,7 +123,7 @@ public override bool Execute()
// developer note: to debug this task set an environment variable like this:
// set NFBUILD_TASKS_DEBUG=1
// this will cause the execution to pause bellow so a debugger can be attached
DebuggerHelper.WaitForDebuggerIfEnabled(TasksConstants.BuildTaskDebugVar);
DebuggerHelper.WaitForDebuggerIfEnabled(TasksConstants.BuildTaskDebugVar, Log);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

try
Expand Down Expand Up @@ -298,6 +295,26 @@ private void ExecuteParse(
private void ExecuteCompile(
string fileName)
{
FileStream logOutputStream = null;
StreamWriter logWriter = null;
string logFile = "";

try
{
if (Verbose)
{
logFile = Path.ChangeExtension(fileName, "log.txt");

logOutputStream = new FileStream(logFile, FileMode.OpenOrCreate, FileAccess.Write);
logWriter = new StreamWriter(logOutputStream);
Console.SetOut(logWriter);
}
}
catch
{
Log.LogError($"Unable to create log file '{logFile}'.");
}

try
{
// compile assembly (1st pass)
Expand All @@ -319,6 +336,12 @@ private void ExecuteCompile(
{
Log.LogError($"Unable to compile output assembly file '{fileName}' - check parse command results");

if (Verbose)
{
logWriter?.Close();
logOutputStream?.Close();
}

throw;
}

Expand All @@ -342,10 +365,7 @@ private void ExecuteCompile(
}

// output PDBX
using (var writer = XmlWriter.Create(Path.ChangeExtension(fileName, "pdbx")))
{
_assemblyBuilder.Write(writer);
}
_assemblyBuilder.Write(Path.ChangeExtension(fileName, "pdbx"));

// output assembly metadata
if (DumpMetadata)
Expand Down Expand Up @@ -375,6 +395,14 @@ private void ExecuteCompile(
Log.LogError($"Exception minimizing assembly");
throw;
}
finally
{
if (Verbose)
{
logWriter?.Close();
logOutputStream?.Close();
}
}
}

private void AddClassToExclude(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<RepositoryType>git</RepositoryType>
<PackageIcon>nf-logo.png</PackageIcon>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -61,7 +63,8 @@
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.10.0" PrivateAssets="All" />
<PackageReference Include="Mono.Cecil" Version="0.11.6" PrivateAssets="All" />
<PackageReference Include="mustache-sharp" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" PrivateAssets="All" />
<PackageReference Include="System.Drawing.Common" Version="8.0.12" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<Target Name="PackTaskDependencies" BeforeTargets="GenerateNuspec">
Expand Down
9 changes: 3 additions & 6 deletions MetadataProcessor.MsBuildTask/TasksConstants.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
//
// Copyright (c) .NET Foundation and Contributors
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
// See LICENSE file in the project root for full license information.
//
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace nanoFramework.Tools
{
internal class TasksConstants
{
public const string BuildTaskDebugVar = "NFBUILD_TASKS_DEBUG";
public const string BuildTaskDebugVar = "NF_MDP_MSBUILD_TASK_DEBUG";
}
}
Loading
Loading