Skip to content

Commit

Permalink
Skip invalid meta-data in cpp projects - references #1870
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Aug 23, 2016
1 parent eea5ced commit dbdfc6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 3.15.3 - 23.08.2016
* Skip invalid meta-data in cpp projects - https://github.com/fsprojects/Paket/issues/1870

#### 3.15.2 - 23.08.2016
* Use .dll as default during pack - https://github.com/fsprojects/Paket/issues/1870

Expand Down
16 changes: 12 additions & 4 deletions src/Paket.Core/PackageMetaData.fs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,18 @@ let readAssemblyFromProjFile buildConfig buildPlatform (projectFile : ProjectFil
|> readAssembly

let loadAssemblyAttributes (assemblyReader:ProviderImplementation.AssemblyReader.ILModuleReader) =
[for inp in assemblyReader.ILModuleDef.ManifestOfAssembly.CustomAttrs.Elements do
match ProviderImplementation.AssemblyReader.decodeILCustomAttribData assemblyReader.ILGlobals inp with
| [] -> ()
| args -> yield (inp.Method.EnclosingType.BasicQualifiedName, Seq.head [ for (_,arg) in args -> if isNull arg then "" else arg.ToString()]) ]
let getMetaData inp =
try
ProviderImplementation.AssemblyReader.decodeILCustomAttribData assemblyReader.ILGlobals inp
with
| _ -> []

[for inp in assemblyReader.ILModuleDef.ManifestOfAssembly.CustomAttrs.Elements do
match getMetaData inp with
| [] -> ()
| args ->
let all = args |> Seq.map (fun (_,arg) -> if isNull arg then "" else arg.ToString())
yield (inp.Method.EnclosingType.BasicQualifiedName, Seq.head all)]


let (|Valid|Invalid|) md =
Expand Down

0 comments on commit dbdfc6c

Please sign in to comment.