Skip to content

Commit

Permalink
fix error "target ResolveReferences" doesnt exists
Browse files Browse the repository at this point in the history
that target doesnt exists if project is crossgen
  • Loading branch information
enricosada committed Jun 20, 2017
1 parent 07fac61 commit d47494a
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/dotnet-proj-info/Inspect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,11 @@ let parsePropertiesOut outFile =
|> (fun x -> Error (UnexpectedMSBuildResult x))

let getProperties props =
let template =
let templateF isCrossgen =
"""
<Target Name="_Inspect_GetProperties"
DependsOnTargets="ResolveReferences">
<Target Name="_Inspect_GetProperties_""" + (if isCrossgen then "CrossGen" else "NotCrossGen") + """"
Condition=" '$(IsCrossTargetingBuild)' """ + (if isCrossgen then "==" else "!=") + """ 'true' "
""" + (if isCrossgen then "" else "DependsOnTargets=\"ResolveReferences\"" ) + """ >
<ItemGroup>
"""
+ (
Expand All @@ -225,6 +226,22 @@ let getProperties props =
Encoding="UTF-8"/>
</Target>
""".Trim()

//doing like that (crossgen/notcrossgen) because ResolveReferences doesnt exists
//if is crossgen

let templateAll =
"""
<Target Name="_Inspect_GetProperties"
DependsOnTargets="_Inspect_GetProperties_CrossGen;_Inspect_GetProperties_NotCrossGen" />
"""

let template =
[ templateF true
templateF false
templateAll ]
|> String.concat (System.Environment.NewLine)

let outFile = getNewTempFilePath "GetProperties.txt"
let args =
[ Target "_Inspect_GetProperties"
Expand Down

0 comments on commit d47494a

Please sign in to comment.