On Apr 17, 2015, at 16:02 , Bill Phillips <william.r....@gmail.com> wrote:All,We have an existing gradle script, which is a multi-project build containing number of libraries, two wars, and many OSGI bundles (uses gradle version 1.12 and bndtools version 2.2.2).When this script was development bndtools was not integrated with gradle at the time, so the portion of the script which builds the bundles was custom script based on an open source project.I was delighted to find that the recent versions of bndtools contain gradle scripts by default. Thanks to all those who made this happen.
My current task is update the multi-project build to use gradle 2.3, bndtools 2.4.1, and (hopefully) to use the bndtools default gradle scripts.This has not been straight forward because a gradle multi-project build only supports one settings.gradle file, which we already have.Bndtools provides a settings.gradle, but the contents of this file cannot be copied into our multi-project build without modification.The modifications are required because the bndtools settings.gradle assumes:
- that the root directory of the build is where all of the bndtools projects live (not true in our case)
- that everything in the root directory is a bndtools project (not true in our case)
- that subprojects to non-bndtools projects are bndtools subprojects (not true in our case)
I am also confused about the role of the defaultProjectName in the settings.gradle:
- It is set to to bnd_build property (blank by default)
- It is then set to be the root-most directory which is not the gradle root directory
- If the start parameter task name is not splitable with ":", the default project is added to the dependency graph (via "include")
- If the current dir is a subdir and project name is empty, the default project is added to the dependency graph (via "include")
This has the effect of changing the dependency graph depending on which directory you compile from.
I am no gradle expert, but I was under the impression that the best practice in the settings.gradle was to include all gradle project and subprojects unconditionally.
This allows gradle to calculate the necessary dependency graph.Thanks,Bill
--
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.
On Apr 20, 2015, at 05:15 , jan.winte...@googlemail.com <jan.winte...@gmail.com> wrote:gradle.build (line 33,34):Where is the function/methode 'bnd( bnd-id-string )' declared?
line 33: group bnd('groupid')line 34: version bnd('groupid')AndWhich statement make this call possible?- 'line 32: plugins.apply 'biz.aQuote.bnd' ‘ ?
- If Yes: Where is the corresponding class?
On Apr 20, 2015, at 09:00 , jan.winte...@googlemail.com <jan.winte...@gmail.com> wrote:Thanks BJ.I found both:)One question regarding 'BndPluginConvention.groovy'11 import org.gradle.api.Project13 class BndPluginConvention {14 private final Project project...18 String bnd(String name) {19 return project.bnd.get(name)20 }Line 19: is hard to understand:- Why has 'org.gradle.api.Project project' a methode or field 'bnd' ?
On Apr 20, 2015, at 09:47 , jan.winte...@googlemail.com <jan.winte...@gmail.com> wrote:I try to understand the bnd-graddle build to move some small projects from me to bnd-graddle.- mostly single-projects (rootDir == projectDir)
But I dont want to share graddle-cofiguration in so many files like the bnd-build do that.- settings.gradle, build.gradle (for each project + root), cnf/eclipse/jrt.properties.
Exist maybe a minimized bnd-gradle example anywhere?- because this was not working proper for me
The default bnd gradle supports assumes the bnd workspace model. That is, all projects are peers in the “root” folder and that there is a cnf folder for workspace wide things including build.bnd, the central bnd instructions.
Gradle root
|-- settings.gradle
|-- gradle.properties
|-- build.gradle
|
|-- bundles
| |-- build.gradle
| |-- cnf
| |-- bundle1
| |-- bundle2
| |-- bundle3
|
|--- lib1
|--- lib2
|--- lib3
|--- war1
|--- war2
--
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.
-- Ferry Huberts
On Apr 21, 2015, at 11:24 , Bill Phillips <william.r....@gmail.com> wrote:Thanks for your reply and taking the time to help me out.The default bnd gradle supports assumes the bnd workspace model. That is, all projects are peers in the “root” folder and that there is a cnf folder for workspace wide things including build.bnd, the central bnd instructions.Given your description of the workspace model (cnf and all bundle projects are peer directories), I believe that our build script mostly uses this model, with the exception being that the workspace isn't in the root of the gradle build.Gradle root
|-- settings.gradle
|-- gradle.properties
|-- build.gradle
|
|-- bundles
| |-- build.gradle
| |-- cnf
| |-- bundle1
| |-- bundle2
| |-- bundle3
|
|--- lib1
|--- lib2
|--- lib3
|--- war1
|--- war2When I move the contents of the bnd settings.gradle into the root dir settings.gradle, it attempts to load in lib1, lib2, etc. as bnd workspace projects.I can work around this, of course, but this was the source of the observations I made in my initial questions.
Given that this is our structure, do you still recommend using the new bnd gradle plugin?
I am using the 2.4.1 version of the plugin (which I understand is the latest). However, the gradle files generated by the plugin do not match what is in the github.Is it safe to use what is in the github with plugin version 2.4.1?
Thanks again,Bill
--
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.
Assuming you can move cnf and the bundle projects to the root, you should be able to use the ‘biz.aQute.bnd’ plugin.
On Apr 21, 2015, at 12:59 , Bill Phillips <william.r....@gmail.com> wrote:Assuming you can move cnf and the bundle projects to the root, you should be able to use the ‘biz.aQute.bnd’ plugin.Moving the cnf and bundle projects into the root isn't a feasible option (many reasons for this).Is the fact that the cnf must been in the root directory a limitation of the script implementation, or is it related to the bndtools implementation?
I was hoping that by using relative paths in the various scripts that I could work around this.
I was hoping that by using relative paths in the various scripts that I could work around this.This won’t work since bnd is “in-charge” not the build scripts which use bnd to setup the gradle build
A problem occurred evaluating project ':bundles'.
> Failed to apply plugin [id 'biz.aQute.bnd']
> Project with path ':projectA' could not be found in project ':bundles:projectB'.