Hi,
Without working this out entirely myself, I can give you some pointers
in the right direction maybe. Assuming 0.12.x
First be sure to know the basics from Getting Started
http://www.scala-sbt.org/release/docs/index.html from Welcome down
through Custom Settings and Tasks.
Second I think you will need a custom task, like your my-package, and
to take parameters it needs to be an InputTask. with a parser for the
parameters. See
http://www.scala-sbt.org/release/docs/Extending/Input-Tasks.html
Third to implement your custom task, I'm not sure of the very best
approach. The problem is that if you depend on the existing "package"
then it would run before your task, so you couldn't modify its
settings such as the file it outputs. However... the simplest hack
might be to depend on "package" (which will give you the File it
creates) and then just copy or rename the jar you get based on your
InputTask parameters. The Getting Started stuff is hopefully clear on
how to do this dependency.
Hope that gets you started... maybe someone else will have a better approach.
Havoc
On Sun, May 19, 2013 at 10:14 AM, Matthieu Taggiasco <
ma...@taggiasco.ch> wrote:
> Hi all,
>
> I'm trying to use the package task in order to package my application.
> However some properties are specific, and I would like to put them as
> arguments of the package task (or another one maybe?) in order to add a new
> resource file according to their values.
>
> I read the documentation of SBT, but I'm a bit lost with all the
> possibilities it offers. Should I implement a new task on which the package
> task would depend on ? Or should I do something else ?
>
> A simple example would be :
> package "first parameter for filename" "second parameter as file content"
>
> Or if needed :
> my-package "first parameter for filename" "second parameter as file content"
>
> I put the quotes just as examples, I don't if I have to put them somewhere
> else (I think so, as I read the doc).
>
> May anyone help ?
>
> Thanks,
> Matt
>
> --
> You received this message because you are subscribed to the Google Groups
> "simple-build-tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
simple-build-t...@googlegroups.com.
> To post to this group, send email to
simple-b...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/simple-build-tool?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>