Git Product home page Git Product logo

Comments (6)

stempler avatar stempler commented on July 22, 2024

How you add your bundle to the bnd-platform configuration? What mechanism are you using?

Are you adding it as Maven dependency? Then there would be two options

  • add it to the platformaux configuration instead of the platform configuration or
  • explicitly exclude the dependencies (via the corresponding Gradle syntax for that)

from bnd-platform.

reyman avatar reyman commented on July 22, 2024

Perhaps this is more clear if i give you all information using the github link : https://github.com/ANRGenstar/gamaplugin

I'm using the goomph gradle plugin, which also use bnd-platform, to download p2 (build.gradle of target.p2 folder) and maven (build.gradle of target.maven folder) dependencies used for my eclipse-plugin src/ compilation (genstar.plugin.bundle-all folder).

from bnd-platform.

stempler avatar stempler commented on July 22, 2024

I'm not so familiar with this kind of setup.The dependency seems to be added here to the bnd-platform configuration. Project dependencies behave a bit differently than Maven dependencies, so that's often not so easy to deal with.

You could try to change platform to platformaux in line 22. Not sure if that will work.

As an alternative you could exclude the dependencies you want to exclude similar to line 18.
With gradle dependencies you can check what dependencies are listed for the platform configuration.

from bnd-platform.

reyman avatar reyman commented on July 22, 2024

I try to change platform to platformaux without success :

* What went wrong:
A problem occurred evaluating project ':target.maven'.
> java.lang.NullPointerException (no error message)

I try the alternative by excluding transitive manually in genstar.plugin.bundle-all/build.gradle :

dependencies {
    compile ('p2:ummisco.gama.annotations:+')
    compile ('p2:msi.gama.core:+')
    compile ('org.genstar:genstar-core:1.0')
            {
                exclude group:'org.geotools'
            }
    compile ('org.genstar:genstar-spll:1.0')
            {
                exclude group:'org.geotools'
                exclude group:'org.jfree'
            }
    compile ('org.genstar:genstar-spin:1.0')
            {
                exclude group:'org.geotools'
            }
    compile ('org.genstar:genstar-gospl:1.0') {
        exclude group:'org.geotools'
    }

}

Hum there is something i don't understand using updatesite ... the jar created by bnd + conditional-package into /genstar.plugin.bundle-all/build/libs/genstar.plugin.bundle-all do not respect my bnd instruction :

// configure the OSGi bundle
jar.manifest.attributes(
        '-exportcontents': 'core.*, gospl.*, spin.*, spll.*',
        '-removeheaders': 'Bnd-LastModified,Bundle-Name,Created-By,Tool,Private-Package,Require-Capability',
        '-conditionalpackage': '!org.w3c.*, !org.xml.*, !javax.*, *',
        'Import-Package': '!org.w3c.*, !org.xml.*, !javax.*,*',
        'Bundle-Version': '1.0.0.${tstamp}',
        'Bundle-SymbolicName': project.name,
        'Bundle-RequiredExecutionEnvironment': 'JavaSE-1.8',
        'Require-Capability': 'osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"',
        'Bundle-Vendor': 'Gama team',
        'Bundle-License': "http://www.apache.org/licenses/LICENSE-2.0"
)

As maven permits, is it possible to push the p2repository by ssh using gradle after that ?

from bnd-platform.

nedtwigg avatar nedtwigg commented on July 22, 2024

I think there's a little confusion. goomph and bnd-platform are separate projects - they don't depend on each other, but they do complement each other.

The jar.manifest.attributes stuff that you're mentioning above, that gets used by com.diffplug.gradle.osgi.bndmanifest, not by bnd-platform. bndmanifest is Goomph plugin that uses bnd to generate manifests for the plugin YOU are developing. bnd-platform is this plugin, which downloads dependencies from maven and calls bnd to wrap YOUR DEPENDENCIES with appropriate OSGi metadata. Apparently it also has some updatesite functionality, but I don't know much about it.

Looking at your source, I think you're mixing up the place where you download your dependencies from maven, with the place where you can publish your result.

I think you want to make a separate project publish, by adding a line to your settings.gradle file. I bet something close to this will work for you as the build.gradle for that:

configurations {
    platformaux
}

dependencies {
    platformaux project(':genstar.plugin.bundle-all')
}

apply plugin: 'org.standardout.bnd-platform'

from bnd-platform.

reyman avatar reyman commented on July 22, 2024

Thanks for you help @nedtwigg and @stempler !

I separate the project like you propose :


── build.gradle
├── build.properties
├── genstar.plugin.bundle-all
│   ├── build
│   ├── build.gradle
│   ├── build.properties
│   ├── META-INF
│   └── src
├── genstar.plugin.platform
│   ├── build
│   ├── build.gradle
│   └── build.properties
├── gradle
│   └── wrapper
├── gradlew
├── gradlew.bat
├── settings.gradle
├── target.maven
│   ├── build
│   └── build.gradle
├── target.p2
│   ├── build
│   ├── build.gradle
│   └── workspace
└── workspace

This is not perfect, i run first gradle build to build my unique jar genstar.plugin.bundle-all.jar, then cd genstar.plugin.platform, then gradle updateSite to generate p2 site.

I remove all import-package into osgi bundle of my unique jar genstar.plugin.bundle-all.jar. In the future i certainly try to mix the two approaches in platform folder/subproject, by making somme dependencies (Import Package) as Optional, and ask to bnd-platform to wrap these optional dependencies and include them with into p2 repository with genstar.plugin.bundle-all.jar .

from bnd-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.