Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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"); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
Contributor 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 Contributor 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/ MemberAuthor 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 Member 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? Member 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. Member 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 :)
| ||||||||||||||||||||||
| 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"); | |
| returnthis.GenerationEnvironment.ToString(); | |
| } |
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");returnthis.GenerationEnvironment.ToString();}The generated .cs files are created from their corresponding .tt T4 template files. The change would occur there. I left a comment on the .cs as it shows the output.
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.
@JakeRadMSFT it's auto-gen, I didn't modify those cs file a bit :)
| 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 comment
The reason will be displayed to describe this comment to others. Learn more.
What's diverging between CLI and MB that we need
MLNETCLIGeneratedvsModelBuilderGenerated?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.