Add specific directory and its content to Universal target

ifrain

I am switching from maven to sbt for a Scala project I am working on. I used to work with the maven assembly plugin where you can map any directory in the workspace to a target directory in the assembly. I didn't find any equivalent in sbt-native-package, it worth provide this feature for the Universe kind.

I understood that everything that is present in the universal subdirectory is copied to the package as such, and it works like a charm, but I lack something like the following snippet.

mappings in Universal += {
  directory("my/local/dir") -> "static/dirInPackage"
}

I would like to know if there is already a way to do that, in such case, I would be happy to know how to do it, and I propose my help to commit documentation for that part if you want. If there is no way to do this kind of customization, I will be happy to propose a patch for that after having discussed specifications.

By the way, great job, your packager is working very well, thanks !

ifrain

After having discussed with the sbt-native-manager team and a first "rejected" pull request, here is the way to do this directory mapping in the build.sbt file (see pull request https://github.com/sbt/sbt-native-packager/pull/160 which provides mode detailed documentation) :

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

To reduce verbosity of the above snippet, there is an issue (https://github.com/sbt/sbt-native-packager/issues/161) to propose a more human readable way to express this directory mapping:

mappings in Universal ++= allFilesRelativeTo(file(target / "scala-2.10" / "api"))

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Get the size of a directory (not its content)

From Dev

CMake: target_include_directories() prints an error when I try to add the source directory itself, or one of its subdirectories

From Dev

Target individual XCTest unit test cases in Xcode 5 to a specific iOS device for a universal app?

From Dev

Add trailing slash for specific directory (Slim framework)

From Dev

Copy recursively a directory excluding a subdirectory and ITS CONTENT

From Dev

VBscript to target specific IP of NIC and change its DNS settings

From Dev

Python: add content to file without deleting its old content

From Dev

Lock or unlock a directory and its content recursively

From Dev

Add-Content - append to specific line

From Dev

delete directory object and its content in powershell

From Dev

Redirecting the content of a directory, but not the directory itself as well as some of its subdirectories and files

From Dev

How to remove a directory without removing its content?

From Dev

How to remove a directory without removing its content?

From Dev

Target individual XCTest unit test cases in Xcode 5 to a specific iOS device for a universal app?

From Dev

Add to a prefix filename the name of its directory

From Dev

archive a directory and its content to a zip archive

From Dev

How to build a custom view that will add its content to one of its children?

From Dev

Add specific directory and its content to Universal target

From Dev

Python: add content to file without deleting its old content

From Dev

Search for a specific file and change to its directory

From Dev

What command should I use to display specific information about a directory, not its content?

From Dev

How to target clicked element to a specific element to show its description

From Dev

Robocopy copy directory instead of just its content

From Dev

Get size of directory (including all its content) irrespective of disk usage

From Dev

Target specific files that include text in a particular directory?

From Dev

Add a directory as a target in chocolatey nuspec file

From Dev

puppet copy directory but not its content

From Dev

Copy specific files from a directory and subdirectories into a target folder in mac

From Dev

Dynamically add a div and its content

Related Related

  1. 1

    Get the size of a directory (not its content)

  2. 2

    CMake: target_include_directories() prints an error when I try to add the source directory itself, or one of its subdirectories

  3. 3

    Target individual XCTest unit test cases in Xcode 5 to a specific iOS device for a universal app?

  4. 4

    Add trailing slash for specific directory (Slim framework)

  5. 5

    Copy recursively a directory excluding a subdirectory and ITS CONTENT

  6. 6

    VBscript to target specific IP of NIC and change its DNS settings

  7. 7

    Python: add content to file without deleting its old content

  8. 8

    Lock or unlock a directory and its content recursively

  9. 9

    Add-Content - append to specific line

  10. 10

    delete directory object and its content in powershell

  11. 11

    Redirecting the content of a directory, but not the directory itself as well as some of its subdirectories and files

  12. 12

    How to remove a directory without removing its content?

  13. 13

    How to remove a directory without removing its content?

  14. 14

    Target individual XCTest unit test cases in Xcode 5 to a specific iOS device for a universal app?

  15. 15

    Add to a prefix filename the name of its directory

  16. 16

    archive a directory and its content to a zip archive

  17. 17

    How to build a custom view that will add its content to one of its children?

  18. 18

    Add specific directory and its content to Universal target

  19. 19

    Python: add content to file without deleting its old content

  20. 20

    Search for a specific file and change to its directory

  21. 21

    What command should I use to display specific information about a directory, not its content?

  22. 22

    How to target clicked element to a specific element to show its description

  23. 23

    Robocopy copy directory instead of just its content

  24. 24

    Get size of directory (including all its content) irrespective of disk usage

  25. 25

    Target specific files that include text in a particular directory?

  26. 26

    Add a directory as a target in chocolatey nuspec file

  27. 27

    puppet copy directory but not its content

  28. 28

    Copy specific files from a directory and subdirectories into a target folder in mac

  29. 29

    Dynamically add a div and its content

HotTag

Archive