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 Artifact file renaming feature #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MatthieuMEZIL
Copy link
Member

Add Artifact file renaming feature

@jeffkl
Copy link
Contributor

jeffkl commented May 3, 2023

@MatthieuMEZIL can you add some examples in the pull request description on how this will work for end users? I'm having trouble picturing how to convey the intent to have files renamed.

@MatthieuMEZIL
Copy link
Member Author

MatthieuMEZIL commented May 3, 2023

@jeffkl e.g.
<Artifact Include="App.config" RenamedFiles="Foo.exe.config" DestinationFolder="$(O)" />

@jeffkl
Copy link
Contributor

jeffkl commented May 5, 2023

@MatthieuMEZIL a lot of people use wildcards when staging artifacts:

<ItemGroup>
  <Artifact Include="MyFolder\MyStuff"
            FileMatch="*.txt *.ini *.xml"
            DestinationFolder="$(ArtifactsPath)" />
</ItemGroup>

If there's more than file found in the bucket, should there be an error? We don't want to copy all files that match to the same destination file.

I think ideally users could supply a transform but that would be very complicated because we'd have to let the user supply a pattern with tokens and get it right:

<ItemGroup>
  <Artifact Include="MyFolder\MyStuff"
            FileMatch="*.txt *.ini *.xml"
            DestinationFolder="$(ArtifactsPath)"
            DestinationFile="$filename$.altered.$extension$" />
</ItemGroup>

Even then, I think there should be an error or warning if the same file was written to the same path more than once. I'm wondering if its better for the build logic to handle this rename and then have Artifacts just stage the outputs from there after the files are already renamed?

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

Successfully merging this pull request may close these issues.

None yet

2 participants