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

Q: How to publish transformed file to multiple directories #298

Open
mwpowellhtx opened this issue Jun 3, 2024 · 2 comments
Open

Q: How to publish transformed file to multiple directories #298

mwpowellhtx opened this issue Jun 3, 2024 · 2 comments

Comments

@mwpowellhtx
Copy link

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.

@mwpowellhtx
Copy link
Author

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...

@mwpowellhtx
Copy link
Author

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.

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

No branches or pull requests

1 participant