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

Exclusion syntax in paket.template files #880

Closed
devboy opened this issue Jun 18, 2015 · 15 comments
Closed

Exclusion syntax in paket.template files #880

devboy opened this issue Jun 18, 2015 · 15 comments

Comments

@devboy
Copy link
Contributor

devboy commented Jun 18, 2015

It would be nice to be able to exclude file patterns in paket.template files.

Something like:

files
    relative/to/template/file ==> folder/in/nupkg
    second/thing/to/pack ==> folder/in/nupkg
    second/thing/**/file.* ==> folder/in/nupkg
    -- third/*
    -- .DS_Store

What do you think?

@forki
Copy link
Member

forki commented Jun 18, 2015

are you volunteering? ;-)

I think we already have FAKE's Globbing in place, so there must be a relatively easy way to do this.

@devboy
Copy link
Contributor Author

devboy commented Jun 18, 2015

Yeah, if we can agree on syntax ;)

@devboy
Copy link
Contributor Author

devboy commented Jun 18, 2015

files
    relative/to/template/file ==> folder/in/nupkg
    second/thing/to/pack ==> folder/in/nupkg
    second/thing/**/file.* ==> folder/in/nupkg
    ! third/*
    ! .DS_Store

would also be an idea, more glob-like...

@forki
Copy link
Member

forki commented Jun 18, 2015

/cc @agross @mavnn

@agross
Copy link
Contributor

agross commented Jun 18, 2015

Looks good! Perhaps we should align the ! syntax with .gitignore and not require the space between e.g. ! and third/*.

@devboy
Copy link
Contributor Author

devboy commented Jun 19, 2015

Just saw your comment @agross ... will change it

@mavnn
Copy link
Contributor

mavnn commented Jun 19, 2015

I'm with @agross - you can always use ./!stupidfilename.txt if you've named a file starting with a "!" and it makes things consistent with other systems.

@mavnn
Copy link
Contributor

mavnn commented Jun 19, 2015

In fact: we should probably disallow the space to avoid ambiguity.

@devboy
Copy link
Contributor Author

devboy commented Jun 19, 2015

Put that into the parser ;)

Now trying to wrap my head around the NupkgWriter and how to apply the exclusion pattern there....

@devboy
Copy link
Contributor Author

devboy commented Jun 19, 2015

files
    relative/to/template/file ==> folder/in/nupkg
    second/thing/to/pack ==> folder/in/nupkg
    second/thing/**/file.* ==> folder/in/nupkg
    !third/*
    !.DS_Store

@devboy
Copy link
Contributor Author

devboy commented Jun 19, 2015

Would this be the right point to check files/dirs against exclude patterns?
https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/NupkgWriter.fs#L237-L248

And how could Fake.Globbing help with that?

@devboy
Copy link
Contributor Author

devboy commented Jun 19, 2015

Globbing is hard ...

@mavnn
Copy link
Contributor

mavnn commented Jun 19, 2015

/me couldn't possible comment on why the initial version didn't include
exclusions/globbing...

On Fri, 19 Jun 2015 18:12 Dominic Graefen notifications@github.com wrote:

Globbing is hard ...

https://camo.githubusercontent.com/3d2c79d83b2416084c2f5a10c77ec26cf3ba43e7/687474703a2f2f6d656469612e67697068792e636f6d2f6d656469612f355a6573753556504e474a6c6d2f67697068792e676966


Reply to this email directly or view it on GitHub
#880 (comment).

@devboy
Copy link
Contributor Author

devboy commented Jun 20, 2015

So, as of devboy@be5e406, the following is possible:

  • !MyFile.txt will exclude that file in the working dir
  • !**/MyFile.txt will exclude that file in all dirs
  • !../MyFile.txt will exclude that file outside the working dir
  • !../**/MyFile.txt will exclude that file in all dirs outside the working dir
  • !Properties/*.* will exclude ./Properties/AssemblyInfo.cs

These are not possible yet and I am not sure if they are necessary:

  • !Properties will exclude ./Properties/AssemblyInfo.cs
  • !Properties/* will exclude ./Properties/AssemblyInfo.cs

@forki
Copy link
Member

forki commented Jun 20, 2015

Cool

@forki forki closed this as completed Jun 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants