Skip to content
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

Add EmbedAllSources build task parameter #23656

Merged
merged 1 commit into from
Jan 4, 2018
Merged

Conversation

tmat
Copy link
Member

@tmat tmat commented Dec 8, 2017

Customer scenario

Expose /embed command line option thru csc and vbc build tasks.
Introduce EmbedAllSources property to enables customers to embed all source files without writing custom targets.

Bugs this fixes

#19127

Workarounds, if any

The customer can add

  <Target Name="PopulateEmbeddedFiles"
          AfterTargets="BeforeCompile"
          BeforeTargets="CoreCompile">
    <ItemGroup>
      <EmbeddedFiles Include="@(Compile)" />
    </ItemGroup>
  </Target>

to their targets file.

Risk

Small.

Performance impact

None.

Is this a regression from a previous update?

No.

Root cause analysis

How was the bug found?

Customer.

Test documentation updated?

@tmat tmat requested a review from a team as a code owner December 8, 2017 01:12
@@ -98,6 +98,7 @@
DelaySign="$(DelaySign)"
DisabledWarnings="$(NoWarn)"
DocumentationFile="@(DocFileItem)"
EmbedAllSources="$(EmbedAllSources)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sense doing it this way? For the MSBuild experience, I assume you'd just write:

<ItemGroup>
   <EmbeddedFiles Include="@(Compile)" />
</ItemGroup>

or something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler already has /embed command line option. That's much more efficient since we avoid copying all Compile items.

if (EmbeddedFiles != null)
// If EmbedAllSources is specified we can ignore files explicitly specified in EmbeddedFiles.
// They do not contribute to the set of files included in the compilation.
// They only designate which files that are being compiled should be also embedded.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I say "embed all sources and this one extra file like a XAML file or something?" not possible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I was mistaken. Fixing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@jasonmalinowski
Copy link
Member

@tmat Does this ultimately appear as a CompilationOption or EmitOption? Language service threading is coming in another PR if appropriate?

@tmat
Copy link
Member Author

tmat commented Dec 8, 2017

@jasonmalinowski There is no option. The parser populates the embedded files list like so:

http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/CommandLine/CSharpCommandLineParser.cs,1241

@tmat tmat added this to the 15.6 milestone Dec 8, 2017
@tmat
Copy link
Member Author

tmat commented Dec 9, 2017

test failure: #21559

@tmat
Copy link
Member Author

tmat commented Dec 11, 2017

@dotnet/roslyn-compiler Please review.

@tmat
Copy link
Member Author

tmat commented Dec 13, 2017

@dotnet/roslyn-compiler Ping

@@ -98,6 +98,7 @@
DelaySign="$(DelaySign)"
DisabledWarnings="$(NoWarn)"
DocumentationFile="@(DocFileItem)"
EmbedAllSources="$(EmbedAllSources)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it should say EmbedAllSource or EmbedAllSourceFiles.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, EmbedAllSourceFiles would be probably somewhat better but F# already uses EmbedAllSources and it's good to be consistent across the board.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(F# could introduce an alternative property, but then that would just add complexity that's not worth it).

@tmat
Copy link
Member Author

tmat commented Dec 21, 2017

@Pilchie for approval

@tmat
Copy link
Member Author

tmat commented Jan 4, 2018

@Pilchie ping.

@Pilchie
Copy link
Member

Pilchie commented Jan 4, 2018

For compiler changes, please get approval from @MeiChin-Tsai

@tmat
Copy link
Member Author

tmat commented Jan 4, 2018

@MeiChin-Tsai Could you please take a look and approve?

@MeiChin-Tsai
Copy link

approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants