Skip to content

Commit

Permalink
Fix code generation to express tail arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Dec 7, 2020
1 parent 1064342 commit 58d203d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/Nuke.CodeGeneration/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ bool NotExistent(Property property)
foreach (var delegateProperty in property.Delegates)
delegateProperty.DataClass = task.SettingsClass;
}

task.SettingsClass.Properties = task.SettingsClass.Properties.OrderBy(x => x.IsTailArgument).ToList();
}

foreach (var dataClass in tool.DataClasses)
Expand Down
2 changes: 2 additions & 0 deletions source/Nuke.CodeGeneration/Model/Property.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,7 @@ public DataClass DataClass
public string DeprecationMessage { get; set; }

public bool OnlyDelegates { get; set; }

public bool IsTailArgument { get; set; }
}
}
5 changes: 4 additions & 1 deletion source/Nuke.CodeGeneration/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@
},
"onlyDelegates": {
"type": "boolean"
},
"isTailArgument": {
"type": "boolean"
}
},
"required": [
Expand Down Expand Up @@ -363,4 +366,4 @@
"name",
"officialUrl"
]
}
}

0 comments on commit 58d203d

Please sign in to comment.