Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Remove ViewCompilation from publish manifest #167

Merged
merged 2 commits into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build/repo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@
<!--Drop a nuspec file in artifacts for packing zip files into a nupkg-->
<Copy SourceFiles="$(RepositoryRoot)build\Build.RS.nuspec" DestinationFolder="$(ArtifactsDir)" Condition="'$(OSPlatform)'=='Linux'" />
<WriteLinesToFile File="$(ArtifactsDir)version.txt" Lines="$(VersionPrefix)-$(VersionSuffix)" Overwrite="true" Condition="'$(OSPlatform)'=='Linux'" />

<!-- Preview 2 Workaround: remove Microsoft.AspNetCore.Mvc.Razor.ViewCompilation from publish manifest -->
<Exec Command="sed -i -e '/microsoft.aspnetcore.mvc.razor.viewcompilation/d' $(ArtifactsDir)%(PackageStoreManifestFiles.TimestampDestinationFile)" Condition="'$(OS)' != 'Windows_NT'" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we just remove the package reference? Why mess with the build output?

Copy link
Contributor Author

@JunTaoLuo JunTaoLuo Jun 20, 2017

Choose a reason for hiding this comment

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

I thought this may be pulled in transitively and we want to change as few things as possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, it's a standalone top-level package. Should be safe to just remove the package reference.

Copy link
Contributor Author

@JunTaoLuo JunTaoLuo Jun 20, 2017

Choose a reason for hiding this comment

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

Actually wouldn't we need to make it a FullMetaPackagePackageNoRuntimeStoreReference? We want it to be a transitive dependency I assume? But not in the runtime store.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we'd need to remove the PrivateAssets=All metadata

Copy link
Contributor

Choose a reason for hiding this comment

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

Spoke to @JunTaoLuo offline. Seems like this is the only way right now to get a reference in the package, but not have the package in the store.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To clarify, we are not removing the package from the store, we just never use the one in the store by forcing ViewCompilation to be bin deployed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel the alternative which is to remove it from the store completely is doable, but I'd want to test it more since it's slightly more riskier. Figured better to unblock the build with this now.

</Target>

<Target Name="ConvertZipToTGZ">
Expand Down
9 changes: 0 additions & 9 deletions src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,4 @@
<Content Include="build\**\*.targets" PackagePath="%(Identity)" />
</ItemGroup>

<Target Name="UpdateManifestVersionNumbers" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<ManifestTargetsFile>$(MSBuildThisFileDirectory)build\PublishWithAspNetCoreTargetManifest.targets</ManifestTargetsFile>
</PropertyGroup>

<Exec Command="powershell.exe -command &quot;(Get-Content $(ManifestTargetsFile)).replace('__MANIFEST_VERSION__','$(VersionPrefix)-$(VersionSuffix)') | Set-Content $(ManifestTargetsFile)&quot;" Condition="'$(OS)' == 'Windows_NT'"/>
<Exec Command="sed -i -e &quot;s/__MANIFEST_VERSION__/$(VersionPrefix)-$(VersionSuffix)/g&quot; $(ManifestTargetsFile)" Condition="'$(OS)' != 'Windows_NT'"/>
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<PublishWithAspNetCoreTargetManifest Condition="'$(PublishWithAspNetCoreTargetManifest)'=='' and '$(RuntimeIdentifier)'=='' and '$(RuntimeIdentifiers)'=='' and '$(PublishableProject)'=='true'">true</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

<PropertyGroup Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true'">
<TargetManifestFiles>$(TargetManifestFiles);$(MSBuildThisFileDirectory)aspnetcore-store-__MANIFEST_VERSION__-win7-x64.xml;$(MSBuildThisFileDirectory)aspnetcore-store-__MANIFEST_VERSION__-win7-x86.xml;$(MSBuildThisFileDirectory)aspnetcore-store-__MANIFEST_VERSION__-osx-x64.xml;$(MSBuildThisFileDirectory)aspnetcore-store-__MANIFEST_VERSION__-linux-x64.xml</TargetManifestFiles>
</PropertyGroup>

<!--
******************************************************************************
Target: PublishWithAspNetCoreTargetManifest
Expand All @@ -15,12 +11,19 @@ Error if PublishWithAspNetCoreTargetManifest is set to true for standalone app
-->
<Target
Name="PublishWithAspNetCoreTargetManifest"
BeforeTargets="Publish"
DependsOnTargets="PrepareForPublish"
AfterTargets="PrepareForPublish"
Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true'" >

<Error
Text="PublishWithAspNetCoreTargetManifest cannot be set to true for standalone apps."
Condition="'$(RuntimeIdentifier)'!='' or '$(RuntimeIdentifiers)'!=''" />

<ItemGroup>
<AspNetCoreTargetManifestFiles Include="$(MSBuildThisFileDirectory)aspnetcore-store-*.xml"/>
</ItemGroup>

<PropertyGroup>
<TargetManifestFiles>$(TargetManifestFiles);@(AspNetCoreTargetManifestFiles)</TargetManifestFiles>
</PropertyGroup>
</Target>
</Project>