-
Notifications
You must be signed in to change notification settings - Fork 1.9k
add projects capability in CodeGenerator #5002
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -75,7 +75,13 @@ public virtual string TransformText() | |||||||||||||||||||||
this.Write(this.ToStringHelper.ToStringWithCulture(Namespace)); | ||||||||||||||||||||||
this.Write(".Model\\"); | ||||||||||||||||||||||
this.Write(this.ToStringHelper.ToStringWithCulture(Namespace)); | ||||||||||||||||||||||
this.Write(".Model.csproj\" />\r\n </ItemGroup>\r\n</Project>\r\n"); | ||||||||||||||||||||||
this.Write(".Model.csproj\" />\r\n </ItemGroup>\r\n\r\n <ItemGroup>\r\n"); | ||||||||||||||||||||||
if (Target==CSharp.GenerateTarget.Cli) { | ||||||||||||||||||||||
this.Write(" <ProjectCapability Include=\"MLNETCLIGenerated\" />\r\n"); | ||||||||||||||||||||||
}else{ | ||||||||||||||||||||||
this.Write(" <ProjectCapability Include=\"ModelBuilderGenerated\" />\r\n"); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should modify the upstream There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same w/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What you mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @LittleLittleCloud aren't these files generated from TT files? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this PR it looks like the CS files were modified directly instead of changing the TT files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind I see them now :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The newly added code is currently being formatted as: machinelearning/src/Microsoft.ML.CodeGenerator/Templates/Console/PredictProject.cs Lines 77 to 86 in e84006b
It should be: this.Write(this.ToStringHelper.ToStringWithCulture(Namespace));
this.Write(".Model.csproj\" />\r\n </ItemGroup>\r\n\r\n <ItemGroup>\r\n");
if (Target==CSharp.GenerateTarget.Cli) {
this.Write(" <ProjectCapability Include=\"MLNETCLIGenerated\" />\r\n");
}
else {
this.Write(" <ProjectCapability Include=\"ModelBuilderGenerated\" />\r\n");
}
this.Write(" </ItemGroup>\r\n</Project>\r\n");
return this.GenerationEnvironment.ToString();
} The generated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JakeRadMSFT it's auto-gen, I didn't modify those cs file a bit :) |
||||||||||||||||||||||
this.Write(" </ItemGroup>\r\n</Project>\r\n"); | ||||||||||||||||||||||
return this.GenerationEnvironment.ToString(); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -90,6 +96,7 @@ public virtual string TransformText() | |||||||||||||||||||||
public bool IncludeRecommenderPackage {get;set;} | ||||||||||||||||||||||
public string StablePackageVersion {get;set;} | ||||||||||||||||||||||
public string UnstablePackageVersion {get;set;} | ||||||||||||||||||||||
internal CSharp.GenerateTarget Target {get;set;} | ||||||||||||||||||||||
|
||||||||||||||||||||||
} | ||||||||||||||||||||||
#region Base class | ||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,14 @@ | |
<ItemGroup> | ||
<ProjectReference Include="..\\<#= Namespace #>.Model\\<#= Namespace #>.Model.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<# if (Target==CSharp.GenerateTarget.Cli) {#> | ||
<ProjectCapability Include="MLNETCLIGenerated" /> | ||
<#}else{#> | ||
<ProjectCapability Include="ModelBuilderGenerated" /> | ||
<#}#> | ||
</ItemGroup> | ||
</Project> | ||
<#+ | ||
public string Namespace {get;set;} | ||
|
@@ -54,4 +62,5 @@ public bool IncludeResNet18Package {get; set;} | |
public bool IncludeRecommenderPackage {get;set;} | ||
public string StablePackageVersion {get;set;} | ||
public string UnstablePackageVersion {get;set;} | ||
internal CSharp.GenerateTarget Target {get;set;} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: I would think of CLI vs ModelBuilder as the Source instead of Target. It's the thing causing the projects to get generated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do |
||
#> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's diverging between CLI and MB that we need
MLNETCLIGenerated
vsModelBuilderGenerated
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's from our PM, we want to differentiate ModelBuilder-Generated from MLNet CLI Generated in telemetry data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.