Q: How to publish transformed file to multiple directories
mwpowellhtx opened this issue · 2 comments
To be fair, have not tried yet, I have the following scenario.
I have a source .props
or .targets
, or anything that needs transforming, and I want to deploy the result to either build
or buildMultiTargeting
directories.
<None Update="build\BumpAssemblyVersions.Release.targets">
<IsTransformFile>true</IsTransformFile>
<DependentUpon>BumpAssemblyVersions.targets</DependentUpon>
</None>
Starting from a base source, for instance:
<ItemGroup>
<None Include="build\BumpAssemblyVersionCommons.targets">
<Pack>true</Pack>
<PackagePath>build;buildMultiTargeting</PackagePath>
<PackageCopyToOutput>true</PackageCopyToOutput>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
The naive outlook on the objectives says I factor the package, copy, other similar aspects, to the transform update. Again, have not tested that hypothesis. Was wondering is that was accurate.
It is key that I need to include some of these outputs in the resulting package as well.
I have tried these couple of scenarios, neither of which seems to be copying, packaging, etc, as expected.
<None Include="build\BumpAssemblyVersions.props">
<TransformOnBuild>true</TransformOnBuild>
<Pack>true</Pack>
<PackagePath>build;buildMultiTargeting</PackagePath>
<PackageCopyToOutput>true</PackageCopyToOutput>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="build\BumpAssemblyVersions.Debug.props">
<IsTransformFile>true</IsTransformFile>
<DependentUpon>BumpAssemblyVersions.props</DependentUpon>
</None>
<None Update="build\BumpAssemblyVersions.Release.props">
<IsTransformFile>true</IsTransformFile>
<DependentUpon>BumpAssemblyVersions.props</DependentUpon>
</None>
Also:
<None Include="build\BumpAssemblyVersions.props">
<TransformOnBuild>true</TransformOnBuild>
</None>
<None Update="build\BumpAssemblyVersions.Debug.props">
<IsTransformFile>true</IsTransformFile>
<DependentUpon>BumpAssemblyVersions.props</DependentUpon>
<Pack>true</Pack>
<PackagePath>build;buildMultiTargeting</PackagePath>
<PackageCopyToOutput>true</PackageCopyToOutput>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="build\BumpAssemblyVersions.Release.props">
<IsTransformFile>true</IsTransformFile>
<DependentUpon>BumpAssemblyVersions.props</DependentUpon>
<Pack>true</Pack>
<PackagePath>build;buildMultiTargeting</PackagePath>
<PackageCopyToOutput>true</PackageCopyToOutput>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Either of these seem like the most plausible way of adding packaging support.
Under a prior attempt, I think I had gone the route with a <Target/>
based approach, and doing the packaging manually that way, unfortunately. Otherwise, we are not sure that it cooperates that well natural MSBuild packaging pipelines.
Is there another, better way? Or is the Target
approach our only recourse?
Thanks...
Bottom line there, would be nice to publish to multiple locations, as well as relaying additional packaging aspects, but I do not think it is possible coordinating SC
and the NuGet
packaging, at least not in its natural default form. I gather will still be necessary to coordinate packaging via .nuspec
, custom properties, things of this nature.