Comments (6)
I admit I never tried adding a Java project directly to the platform. Really awesome that it actually works like this
Does the rest work fine? i.e. are the instructions correctly represented in the bundle manifest?
Some of the settings you specify in the bnd-Closure are actually plugin settings, I'm not sure if they will work properly in there. Could you move those up to the platform call like this?
platform {
fetchSources = true
addQualifier = true
eclipseHome = new File(eclipseHomePath)
featureId = 'org.py4j.feature'
featureName = 'Py4J Library'
featureVersion = bundleVersion
featureProvider = 'Py4J'
categoryId = 'py4j'
categoryName = 'Py4J'
bundle project
bnd(project) {
symbolicName = 'py4j-java'
bundleName = 'py4j-java'
version = bundleVersion
instruction 'Eclipse-BuddyPolicy', 'global'
instruction 'Import-Package', '!javax.net'
instruction 'Export-Package', 'py4j,py4j.commands,py4j.model,py4j.reflection'
instruction 'Bundle-RequiredExecutionEnvironment', 'JavaSE-1.6'
instruction 'Bundle-Description', 'Bridge between Python and Java'
instruction 'Bundle-DocURL', 'http://www.py4j.org'
}
}
Can you provide a link to a repo for your project? Then I might be able to take a look during the weekend how this could be made to work (if the configuration change does not help).
from bnd-platform.
Hi, thanks for your quick response. I admit I discovered how to add a java project directly to the platform after many trials and errors :-)
I moved the settings but it still did not create a source bundle. You can see the whole project here: https://github.com/bartdag/py4j/tree/gradle (the gradle config is in the gradle branch for now).
You can build the project like this:
cd py4j-java
gradle assemble
gradle bundles
gradle updateSite
As far as I can tell, the osgi bundle is valid and I can import it in Eclipse and other plugins can use it.
from bnd-platform.
Hi, did you have time to look into this issue? Thanks!
from bnd-platform.
Hi. I had a look at it. The mechanism that I use for getting the sources seems to only work for external dependencies. At this point I'm not sure how I could find the source Jar for the project based on the dependency.
A workaround is the following:
- Add the project Jar as a file dependency (then the source is automatically picked up based on the name)
bundle tasks.jar.outputs.files, {
bnd {
...
}
}
- You also need to make sure that the
bundles
task is executed after the Jar is created, e.g.
tasks.bundles.dependsOn('assemble')
- Include project dependency configurations in platform configuration, if applicable, to include the project's dependencies in the update site
configurations {
platform {
extendsFrom compile
}
}
I tried this on your project with success, see my fork here: https://github.com/stempler/py4j/tree/gradle-wa1
The way you added the dependency is definitely the more elegant way, I'm open to ideas to include the source Jar in a different way, using the Gradle API.
from bnd-platform.
Thanks a lot for you help, that seems to work. I'm not familiar with gradle subprojects, but would having a global project that depends on subprojects (e.g., py4j that would depend on py4j-java and py4j-python) makes it look like an external dependency?
from bnd-platform.
No, that would still be project dependencies, with transitive project dependencies probably complicating it more. I did a few more attempts yesterday to solve the issue in a better way, but always had problems when it came to resolving sources for project dependencies.
As a workaround I tried also letting the bundles task depend on the install task, and adding the dependency by group and name to the platform configuration. That was a way of trying to externalise it. But that failed because it seems to be a conflict to have an external dependency that is the same group and name as a project. Thus externalising it is probably only possible when using two different builds.
from bnd-platform.
Related Issues (20)
- Only transitive dependencies being bundled without parent plugin HOT 2
- Configuration platformaux seems to ignore fetchSources = false HOT 1
- Is it possible to prevent feature-group in generated update-site HOT 1
- About updateSite run from root folder ? HOT 3
- Support for Gradle 3/4 HOT 3
- Create 1.6 release and publish 1.7 snapshot? HOT 4
- "Could not retrieve POM" spam HOT 2
- SSL issues with cloudfront.net when trying to download Eclipse HOT 4
- Avoid 'Require-Capability' header? HOT 2
- Generated update site does not work HOT 3
- OptionalImport not working HOT 2
- feature.xml does not contain all dependencies HOT 2
- Setting buildDir does not work HOT 2
- fetchSources = true adds source bundles to feature HOT 11
- Getting java.util.NoSuchElementException on updateSite goal HOT 3
- Generated updatesite not working due to missing filters HOT 2
- Gradle 6 Incompatibility HOT 8
- extracting Bundle-License from pom.xml does not work HOT 1
- Not all bundles are downloaded HOT 2
- Default location of eclipseMirror no longer available HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bnd-platform.