how to define artifacts using custom names in build.sbt

804 views
Skip to first unread message

rollinsruss

unread,
Aug 5, 2011, 12:14:43 PM8/5/11
to simple-build-tool
Generally speaking I'm confused about how to provide dynamic names for
additional Artifact definitions. But, more specifically, my first case
to tackle is reusing the jarName from the Assembly plugin when calling
addArtifact in my build.sbt. Based on what I've read in the groups, my
initial attempt has come up short:

addArtifact(Artifact( (jarName){(name:String) => name},"jar","jar"),
assembly)

I thought using an apply on jarName would be sufficient to retrieve
its value, but I was wrong and this isn't working. Does the above
approach need slight tweaking?

Or would it be more appropriate to create a specific project-level
value and then reference it both in jarName definition as well as
addArtifact? Originally thought something like:

assembledName <<=(name,version){...}

would work, but that's also the wrong approach (error: not found:
value assembledName, and also error: reassignment to val)

Thanks for the help,
-Russ-

Arjan Blokzijl

unread,
Aug 6, 2011, 2:09:15 AM8/6/11
to simple-b...@googlegroups.com
Hi Russ,

I've done something similar (although not using the assembly plugin) and have an example that publishes a custom artifact, where the published artifact uses the name of the main jar artifact as its name: http://pastie.org/2328797
You may be able to do something like this for your requirements.

Cheers, Arjan



--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.


rollinsruss

unread,
Aug 15, 2011, 4:56:11 PM8/15/11
to simple-build-tool
Arjan,

Thanks for your contribution via Pastie! I just got back into the
office and have spent some time evaluating your suggestion.

Mark, is it possible to avoid creating a custom task in order to
create an Artifact entry on-the-fly with a reference to an existing
setting? I just need to pass in "jarName in Assembly" to
addArtifact(Artifact("jarName in Assembly","jar","jar"),assembly) and
am stuck on proper reference syntax.

Thanks,
-Russ-


On Aug 6, 12:09 am, Arjan Blokzijl <arjanblokz...@gmail.com> wrote:
> Hi Russ,
>
> I've done something similar (although not using the assembly plugin) and
> have an example that publishes a custom artifact, where the published
> artifact uses the name of the main jar artifact as its name:http://pastie.org/2328797
> You may be able to do something like this for your requirements.
>
> Cheers, Arjan
>

Mark Harrah

unread,
Aug 16, 2011, 10:43:15 AM8/16/11
to simple-b...@googlegroups.com
Russ,

On Mon, 15 Aug 2011 13:56:11 -0700 (PDT)
rollinsruss <russell....@gmail.com> wrote:
> ...


> Mark, is it possible to avoid creating a custom task in order to
> create an Artifact entry on-the-fly with a reference to an existing
> setting? I just need to pass in "jarName in Assembly" to
> addArtifact(Artifact("jarName in Assembly","jar","jar"),assembly) and
> am stuck on proper reference syntax.

Not in 0.10.1, but if you open a bug, it will make it into the next release.

-Mark

rollinsruss

unread,
Sep 29, 2011, 3:26:37 PM9/29/11
to simple-build-tool
K, will open an issue, thanks Mark!


On Aug 16, 8:43 am, Mark Harrah <dmhar...@gmail.com> wrote:
> Russ,
>
> On Mon, 15 Aug 2011 13:56:11 -0700 (PDT)
>
> rollinsruss<russell.c.roll...@gmail.com> wrote:
> > ...
> > Mark, is it possible to avoid creating a custom task in order to
> > create an Artifact entry on-the-fly with a reference to an existing
> > setting? I just need to pass in "jarName in Assembly" to
> > addArtifact(Artifact("jarName in Assembly","jar","jar"),assembly) and
> > am stuck on proper reference syntax.
>
> Not in 0.10.1, but if you open a bug, it will make it into the next release.
>
> -Mark
>
>
>
>
>
>
>
> > Thanks,
> > -Russ-
>
> > On Aug 6, 12:09 am, Arjan Blokzijl <arjanblokz...@gmail.com> wrote:
> > > Hi Russ,
>
> > > I've done something similar (although not using the assembly plugin) and
> > > have an example that publishes a custom artifact, where the published
> > > artifact uses the name of the main jar artifact as its name:http://pastie.org/2328797
> > > You may be able to do something like this for your requirements.
>
> > > Cheers, Arjan
>
Reply all
Reply to author
Forward
0 new messages