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 a human readable helper method for directory mappings #161

Closed
ivanfrain opened this issue Feb 10, 2014 · 4 comments
Closed

Add a human readable helper method for directory mappings #161

ivanfrain opened this issue Feb 10, 2014 · 4 comments

Comments

@ivanfrain
Copy link
Contributor

NOTE: pull request #159 follow up.

Currently, a directory mapping can be done in build.sbt with the following snippet (see #160 ):

mappings in Universal <++= (packageBin in Compile, target ) map { (_, target) =>
        val dir = target / "scala-2.10" / "api"
        (dir.***) pair relativeTo(dir.getParentFile)
} 

The idea behind this code is to put in the generated package an api directory with all its content. The original directory is located in target/scala-2.10/api. The target directory will be located at the pacakge root in the "api" directory.

A great enhancement would be to have a helper method simplifying the above snippet to something more comprehensive for human being, for example :

mappings in Universal ++= allFilesRelativeTo(file(target / "scala-2.10" / "api"))
@muuki88
Copy link
Contributor

muuki88 commented Mar 3, 2014

I think this one is done.

@muuki88 muuki88 closed this as completed Mar 3, 2014
@belgacea
Copy link

@muuki88 Is this feature abandoned?

@nigredo-tori
Copy link
Collaborator

nigredo-tori commented Aug 20, 2019

@belgacea, I don't know if this was ever implemented in SNP itself, but if you're on SBT 1.0, sbt.Path.directory seems to do exactly this.

@muuki88
Copy link
Contributor

muuki88 commented Aug 21, 2019

We move some of those helpers to sbt-io itself and they added quite some more :)

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