qetza/vsts-xdttransform-task

Wildcard support for path

Closed this issue · 12 comments

TooTz commented

It is not possible to use a wildcard. like

*.Release.config => *.config
*.$(Release.EnvironmentName).config => *.config

This would indeed be a very nice feature :)

qetza commented

Hi,

This could be possible but needs to be clarrified on your expectations :)

Let's say you have the following files:

  • app.config
  • log.config
  • app.release.config
  • log.release.config

So what should the configuration *.Release.config => *.config do?

  1. apply app.release.config to app.config and log.config and apply log.release.config to app.config and log.config (so we get all files which matches the target pattern except those matching the source pattern)
  2. apply app.release.config to app.config and apply log.release.config to log.config (so using the the wildcard in the target pattern more as a token to be replaced with the prefix found in the source pattern)

For me, it would be great to see the behavior described in option 2.
And maybe extend that with: *.Release.config => *.config => transformed\*.config
Obviously that would mean that app.release.config gets applied to app.config and the result is saved in transformed\app.config.

While we're looking at wildcards/tokens/patterns, it would also be nice to be able to allow for all files in subfolders as well. We have for example for each release some new config files that are organized in a folder with the version number as name. So it would help us if we could just say all files in this folder and it's subfolders.

I am looking for this feature as well. Has there been any progress on it?

qetza commented

I'm should have some time to work on this feature this week.

@qetza have you had any luck with completing this feature?

qetza commented

I’ve done some progress but it’s not finished yet.

Hello Guillaume,

I am not sure if this is completely related to that task or not.
Currently (unless I have misunderstood something), a task will target a specific folder.
Thus if we have files to transform in 5 folders, we must add 5 tasks.

It would be nice to be able to add wildcard also for the Working Folder.

qetza commented

Hi @pedautreppe,

Currently the task works file by file so you need to specify each file on which to apply transformations. You don't need to add multiple task, you can enter multiple lines in the Transformations parameter, one line per file.

The idea if the feature is that you can use wildcard to automatically find target files and associated transformation files.

Created a PR: #12

For me, it would be great to see the behavior described in option 2.
And maybe extend that with: *.Release.config => *.config => transformed\*.config
Obviously that would mean that app.release.config gets applied to app.config and the result is saved in transformed\app.config.

While we're looking at wildcards/tokens/patterns, it would also be nice to be able to allow for all files in subfolders as well. We have for example for each release some new config files that are organized in a folder with the version number as name. So it would help us if we could just say all files in this folder and it's subfolders.

i want this functionality e.g.
**/.Release.xml => ? => ? (? means the match part)
**/
.Release.xml => ? => ?.transformed.xml (? here is match part and you can modify it)
so
abc.release.xml applies transform to abc.xml and creates abc.xml as output
xyz.release.xml applies transform to xyz.xml and creates xyz.transformed.xml

qetza commented

The feature is now live with version 3.0.0!
Thanks @luuksommers