# Add release extra bundles

**URL:** <https://bnd.discourse.group/t/add-release-extra-bundles/70>\
**Category:** GENERAL\
**Created:** [January 8, 2021, 5:17pm UTC](https://bnd.discourse.group/t/add-release-extra-bundles/70 "2021-01-08T17:17:45Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![pkriens](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/pkriens/32/3_2.png) [@pkriens](https://bnd.discourse.group/u/pkriens)\
**Post date:** [January 20, 2021, 8:32am UTC](https://bnd.discourse.group/t/add-release-extra-bundles/70/21 "2021-01-20T08:32:06Z")

</div>

> [@juergen-albert](#):
>
> With this, an extension can provide multiple use declarations and provide more then one feature.

I am not sure I understand? In my proposal there were already multiple extension per bundle/JAR in the repository with the `where` attribute?

> [@juergen-albert](#):
>
> This requires magical knowledge and is limiting at the same time. limiting in the sense that an extension can only provide one set of additional properties properties to a project. Thus I would suggest a declarative approach.

This is the only solution to have an extension that can register itself inside the workspace. You need an anchor point. The `where` attribute allows you to define the root of the extension inside a bundle so you can have multiple extensions per bundle. However, the layout there is more than ok to have some fixed points like a `workspace.bnd` and `project.bnd`. This is similar to `package.json`, `pom.xml`, etc. Simple to use, easy to understand, and very familiar to any developer.

> [@juergen-albert](#):
>
> `bnd.use.extension`

You seem to be thinking the wrong way around? The capability is _inside_ the bundle that _provides_ the extensionS in my proposal. Clearly they need a version? And I am not sure what the `bnd.use.extension` would do? Transitive?

From the workspace that wants to use the extension, you need to have some _requirement_ so you can find it in the repository. The `-workspace-extension` in the `build.bnd` is the corresponding _requirement_, selecting the extensions. Each selected extension is copied to the cache and then the `workspace.bnd` file is read to _install_ the extension. The `-use` is only for projects, and provide an _activation_ of that extension for that project. I.e. the `workspace.bnd` would install a repository, the `-use` would augment the `-buildpath` et. al.

I do not think it should use parameters. The `project.bnd` in the extension would have full access to all the properties in the macro language. Keep it minimal, especially in the beginning.

---

<div class="post-metadata">

**Author:** ![juergen-albert](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/juergen-albert/32/20_2.png) [@juergen-albert](https://bnd.discourse.group/u/juergen-albert)\
**Post date:** [January 21, 2021, 10:54am UTC](https://bnd.discourse.group/t/add-release-extra-bundles/70/22 "2021-01-21T10:54:26Z")

</div>

> [@pkriens](#):
>
> Clearly they need a version?

Not necessarily, because we could use the bundle version here. Putting the Version in the capability however would make it easier to create the requirement without jumping through an extra hoop here. So, point taken.

> [@pkriens](#):
>
> I do not think it should use parameters. The `project.bnd` in the extension would have full access to all the properties in the macro language. Keep it minimal, especially in the beginning.

True. I had similar feelings while I had the idea but I wanted to validate them.

Just a quick recap regarding the other point from my side to make sure, I’m on the same page as you:

A Bundle provides one or more `bnd.workspace.extension`s. The where points to a folder in the bundle. If named by a `-wokspace-extension`, the folder will be unpacked somewhere in the cache. The folder requires at least a `workspace.bnd` that will then be included in the workspace, but may contain other files as well that can be references (e.g. an index file for a maven repository). I can apply further properties to a project bnd or a bndrun by declaring `-use` with the extension name. In this case a project.bnd must be present in the extension folder that then will be applied.

In this scenario I have one option for `-use` per extension. What I want to achieve is having more then one `-use` option per extension. In the scenario I have in mind the `workspace.bnd` would provide the repository with all my dependencies. It then want to provide different additional properties for different situations, that all require the same basic workspace configuration (in this case the available repo). Thus I would at least need multiple `project.bnd`s that can be applied depending on the `-use` I define.

---

<div class="post-metadata">

**Author:** ![pkriens](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/pkriens/32/3_2.png) [@pkriens](https://bnd.discourse.group/u/pkriens)\
**Post date:** [January 21, 2021, 11:24am UTC](https://bnd.discourse.group/t/add-release-extra-bundles/70/23 "2021-01-21T11:24:48Z")

</div>

> [@juergen-albert](#):
>
> Thus I would at least need multiple `project.bnd` s that can be applied depending on the `-use` I define.

Why not use your own instructions:

```
  bnd.bnd:
  -use foo/bar, aQute/awesome
  -awesome gen-src/*

```

That way your extension instructions can be full blow Parameters, with the `-use` instruction they would need to be only attributes.

---

<div class="post-metadata">

**Author:** ![juergen-albert](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/juergen-albert/32/20_2.png) [@juergen-albert](https://bnd.discourse.group/u/juergen-albert)\
**Post date:** [January 23, 2023, 3:10pm UTC](https://bnd.discourse.group/t/add-release-extra-bundles/70/24 "2023-01-23T15:10:08Z")

</div>

If anybody ever stumbles upon this, the discussion resulted in [-library library ( ‘,’ library )\* | bnd](https://bnd.bndtools.org/instructions/library.html)

[Previous page](https://bnd.discourse.group/t/add-release-extra-bundles/70.md?page=1)
