Parameterise gradle release

40 views
Skip to first unread message

andreas...@codecentric.de

unread,
Aug 12, 2016, 7:53:44 AM8/12/16
to bndtools-users
Hi,

I'm wondering if it's possible to parameterise a gradle release job.

More concrete:

I want to set the 
-releaserepo
parameter in cnf/ext/repositories.bnd.

I imagine a usage like this:

gradle com.bundle.name:relase -Preleaserepo=nexus

or

gradle com.bundle.name:relase -Preleaserepo=local

Looking forward to your answers :)

BJ Hargrave

unread,
Aug 12, 2016, 11:38:07 AM8/12/16
to bndtool...@googlegroups.com
Yes it is possible. In the repositorties.bnd file you could do:

    -releaserepo: $(def;releaserepo;local}

So if the releaserepo property is unset, local is used.

On the command line:

    ./gradlew -Dreleaserepo=nexus :com.bundle.name:release

Note you need to use -D to set a system property. -P are gradle properties which are not visible in bnd.


--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
BJ

andreas...@codecentric.de

unread,
Aug 15, 2016, 1:15:01 AM8/15/16
to bndtools-users
Thank you for your answer. That helps.

Would you mind elaborating what happens here? Is that bnd, gradle or java functionality?

Can I read about this in some documentation? Why does one need to write def before the first semicolon?

Peter Kriens

unread,
Aug 15, 2016, 2:31:10 AM8/15/16
to bndtool...@googlegroups.com
This is bnd functionality.

See http://bnd.bndtools.org/chapters/850-macros.html and http://bnd.bndtools.org/macros/def.html

Kind regards,

Peter Kriens

andreas...@codecentric.de

unread,
Aug 15, 2016, 2:37:38 AM8/15/16
to bndtools-users
Thank you very much.
Reply all
Reply to author
Forward
0 new messages