stempler / bnd-platform

Build OSGi bundles and Eclipse Update Sites from existing JARs, e.g. from Maven repositories (Plugin for Gradle)
Apache License 2.0
79 stars 30 forks source link

Error using bnd-platform plugin with other plugin #3

Closed hellorachid closed 9 years ago

hellorachid commented 9 years ago

when i try to use bnd-platform plugin with any plugin ( like java plugin) it gives me this error

* What went wrong:
A problem occurred evaluating root project 'bnd-test'.
> Failed to apply plugin [id 'org.standardout.bnd-platform']
   > Cannot add task ':clean' as a task with that name already exists.
simonthum commented 9 years ago

You should not have a need to mix with other plugins when you build your platform and project(s) separately, as bnd-platform is intended to do.

hellorachid commented 9 years ago

@simonthum i need this plugin to work with biz.aQute.bnd plugin i need the tasks of the boths

simonthum commented 9 years ago

That sounds sensible, but unfortunately have no idea how to do it. A potential workaround:

http://forums.gradle.org/gradle/topics/remove_task_defined_in_plugin

stempler commented 9 years ago

@hellorachid Maybe you can explain what you are trying to achieve? What should be the result that bnd-platform yields, where is it used? What do you need the biz.aQute.bnd plugin for?

hellorachid commented 9 years ago

i usebndTools in eclipse, and as you know bndTools use repositories, for me i need a way to use some osgi bundles and their dependencies from maven in my project,

my idea is :

use your plugin to download and convert non-osgi bundes to osgi,after that i will copy those bundles in the repository and apply index on them , that's the whole idea

for biz.aQute.bnd plugin, i need some tasks like runBundles,release,....

How i use bnd-platform and biz.aQute.bnd

i apply the both plugin to each sub project, every project can use some bundles so the developer add them to the project build.gradle and run gradle importBundles that depond on bnd-platform bundle task

stempler commented 9 years ago

Ah, I think I get the idea. Would be interesting to see the setup.

Regarding the issue with the clean task, bnd-platform could probably be adapted to check if the task is already there, and only extend it if it is. I will have a look into that.

Note to self (check if task already exists): http://stackoverflow.com/questions/22600314/grails-gradle-a-task-with-that-name-already-exists

hellorachid commented 9 years ago

this is the important part in my setup, if you wanna to see the full file i can show it

subprojects { p ->
    plugins.apply 'biz.aQute.bnd'
    apply plugin: 'org.standardout.bnd-platform'
    repositories {
       mavenCentral()
    }

    aQute.bnd.build.Project bndProject
    bndProject = workspace.getProject(p.projectDir)
  ``
stempler commented 9 years ago

I published a version 1.3.0-SNAPSHOT that should extend an existing clean task instead of failing if it already exists to the Sonatype Snapshot repository (https://oss.sonatype.org/content/repositories/snapshots). Could you try it with that version?

hellorachid commented 9 years ago

yes, with pleasure

stempler commented 9 years ago

@hellorachid Did you have the chance to test this yet? Did it work for you?

hellorachid commented 9 years ago

@stempler i hope you are doing well, i'm soooo sory i was out of office during this periode with no connection,

thank you sooo much, it works perfectly

best regards