Repository navigation
Fixes #309 #371
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
Merged
Merged
Fixes #309 #371
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,35 @@ | ||
| <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
|
||
| <!-- ==================================================================================== | ||
|
|
||
| Support for in-place modification of the compiled binary. | ||
| Since there may be more than one post compile modification, we must take care not | ||
| to break incremental builds. A timestemp file is written out when all modification | ||
| targets have completed. | ||
| Note that the targets participating in post compile modification must list the | ||
| sentinel file as one of their outputs, but they should not modify it. | ||
|
|
||
| ==================================================================================== --> | ||
|
|
||
| <PropertyGroup> | ||
| <PostCompileBinaryModificationSentinelFile>$(IntermediateOutputPath)$(TargetFileName).pcbm</PostCompileBinaryModificationSentinelFile> | ||
| <CompileDependsOn>$(CompileDependsOn);PostCompileBinaryModification</CompileDependsOn> | ||
| <CleanDependsOn>$(CleanDependsOn);CleanPostCompileBinaryModification</CleanDependsOn> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="PostCompileBinaryModification" | ||
| DependsOnTargets="ApplyOptimizations;FakeSign" | ||
| Inputs="@(IntermediateAssembly)" | ||
| Outputs="@(IntermediateAssembly);$(PostCompileBinaryModificationSentinelFile)"> | ||
|
|
||
| <!-- Write out a sentinel timestamp file to prevent unnecessary work in incremental builds. --> | ||
| <Touch AlwaysCreate="true" Files="$(PostCompileBinaryModificationSentinelFile)" /> | ||
| </Target> | ||
|
|
||
| <Target Name="CleanPostCompileBinaryModification"> | ||
| <Delete Files="$(PostCompileBinaryModificationSentinelFile)" /> | ||
| </Target> | ||
|
|
||
| <!-- ==================================================================================== | ||
|
|
||
| Support for rolling optimization data into assemblies. | ||
|
|
@@ -13,25 +44,44 @@ | |
|
|
||
| <Target Name="ApplyOptimizations" | ||
| Condition="'$(Configuration)' == 'Release' AND '$(NonShipping)' != 'true' AND '$(SkipApplyOptimizations)' != 'true' AND Exists('$(OptimizationDataFile)')" | ||
| DependsOnTargets="CoreCompile" | ||
| Inputs="@(IntermediateAssembly)" | ||
| Outputs="@(IntermediateAssembly);@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')"> | ||
| Outputs="@(IntermediateAssembly);$(PostCompileBinaryModificationSentinelFile)"> | ||
|
|
||
| <Message Text="Adding optimization data to @(IntermediateAssembly)"/> | ||
| <Exec Command=""$(IbcMergePath)" -q -f -partialNGEN -minify -mo "@(IntermediateAssembly)" -incremental "$(OptimizationDataFile)"" /> | ||
|
|
||
| <Message Text="Re-signing after merging optimization data" Condition="'$(DelaySign)' != 'true' AND '$(SignAssembly)' == 'true'" /> | ||
| <Exec Command=""$(SnToolPath)" -q -R "@(IntermediateAssembly)" "$(AssemblyOriginatorKeyFile)"" Condition="'$(DelaySign)' != 'true' AND '$(SignAssembly)' == 'true'" /> | ||
|
|
||
| </Target> | ||
|
|
||
| <!-- ==================================================================================== | ||
|
|
||
| Support for signing files that are in VSIXes. | ||
|
|
||
| <!-- Write out a sentinel timestamp file. Since the rewrite happens in-place, this extra output enables incremental build to work. --> | ||
| <Touch AlwaysCreate="true" Files="@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')" /> | ||
| ==================================================================================== --> | ||
|
|
||
| </Target> | ||
| <PropertyGroup> | ||
| <RunningInMicroBuild Condition="Exists('$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll')">true</RunningInMicroBuild> | ||
| <ShouldSignBuild Condition="'$(RealSignBuild)' == 'true' OR ('$(RunningInMicroBuild)' == 'true' AND '$(SignType)' == 'real')">true</ShouldSignBuild> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="CleanApplyOptimizations"> | ||
| <Delete Files="@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')" /> | ||
| <Target Name="FakeSign" | ||
| Condition="'$(DelaySign)' == 'true' AND '$(ShouldSignBuild)' != 'true' AND ('$(Language)' == 'C#' OR '$(Language)' == 'VB')" | ||
| Inputs="@(IntermediateAssembly)" | ||
| Outputs="@(IntermediateAssembly);$(PostCompileBinaryModificationSentinelFile)"> | ||
|
|
||
| <Exec Command="$(VSLOutDir)\FakeSign.exe "$(IntermediateOutputPath)$(TargetFileName)"" /> | ||
|
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. Re-use @(IntermediateAssembly) just so it's clear the Exec is on the same file as the Target Inputs/Outputs? |
||
|
|
||
| </Target> | ||
|
|
||
| <!-- ==================================================================================== | ||
|
|
||
| Support for signing phone assemblies. | ||
|
|
||
| ==================================================================================== --> | ||
| <UsingTask TaskName="SignFiles" AssemblyFile="$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll" Condition="'$(RunningInMicroBuild)' == 'true'" /> | ||
|
|
||
| <Target Name="CreateAndSignPhoneCopy" | ||
| Condition="'$(NeedsPhoneCopy)' == 'true'" | ||
| DependsOnTargets="Compile" | ||
|
|
@@ -63,40 +113,21 @@ | |
| </Target> | ||
|
|
||
| <PropertyGroup> | ||
| <CompileDependsOn>$(CompileDependsOn);ApplyOptimizations</CompileDependsOn> | ||
| <CleanDependsOn>$(CleanDependsOn);CleanApplyOptimizations;CleanPhoneCopy</CleanDependsOn> | ||
| <CleanDependsOn>$(CleanDependsOn);CleanPhoneCopy</CleanDependsOn> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- ==================================================================================== | ||
|
|
||
| Support for signing files that are in VSIXes, and also signing the resulting package | ||
| Support for signing VSIXes | ||
|
|
||
| ==================================================================================== --> | ||
|
|
||
| <PropertyGroup> | ||
| <RunningInMicroBuild Condition="Exists('$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll')">true</RunningInMicroBuild> | ||
| <ShouldSignBuild Condition="'$(RealSignBuild)' == 'true' OR ('$(RunningInMicroBuild)' == 'true' AND '$(SignType)' == 'real')">true</ShouldSignBuild> | ||
| <CompileDependsOn>$(CompileDependsOn);FakeSignAssembly</CompileDependsOn> | ||
| <FakeSignSentinelFile>$(IntermediateOutputPath)$(TargetFileName).fakesign</FakeSignSentinelFile> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="FakeSignAssembly" | ||
| Condition="'$(DelaySign)' == 'true' AND '$(ShouldSignBuild)' != 'true' AND ('$(Language)' == 'C#' OR '$(Language)' == 'VB')" | ||
| DependsOnTargets="CoreCompile" | ||
| Inputs="$(IntermediateOutputPath)$(TargetFileName)" | ||
| Outputs="$(FakeSignSentinelFile)"> | ||
| <Exec Command="$(VSLOutDir)\FakeSign.exe "$(IntermediateOutputPath)$(TargetFileName)"" /> | ||
| <Touch Files="$(FakeSignSentinelFile)" AlwaysCreate="true" /> | ||
| </Target> | ||
|
|
||
| <UsingTask TaskName="SignFiles" AssemblyFile="$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll" Condition="'$(RunningInMicroBuild)' == 'true'" /> | ||
|
|
||
| <PropertyGroup> | ||
| <CreateVsixContainerDependsOn>$(CreateVsixContainerDependsOn);SignVsixInputs</CreateVsixContainerDependsOn> | ||
| <PrepareForRunDependsOn>$(PrepareForRunDependsOn);SignVsix</PrepareForRunDependsOn> | ||
| <ProducingSignedVsix Condition="'$(ShouldSignBuild)' == 'true' AND '$(NonShipping)' != 'true' AND '$(CreateVsixContainer)' == 'true'">true</ProducingSignedVsix> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- GetTargetPath returns the path under $(OutDir) for each project. | ||
| This target adds the $(AuthenticodeCertificateName) as metadata. --> | ||
| <Target Name="GetTargetPathWithAuthenticodeCertificateName" DependsOnTargets="GetTargetPath" Returns="@(TargetPathWithAuthenticodeCertificateName)"> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The easier option is to put the ...SentinelFile item into the "FileWrites" item group. Those get stored and clean will delete it automatically.