Open paulvi opened 8 years ago
@paulvi I like this idea! But I think you can already achieve something really similar using existing Gradle features.
Try something like this:
runOsgi {
if (hasProperty('equinox')) {
configSettings = 'equinox'
osgiMain = 'org.eclipse.osgi:org.eclipse.osgi:3.7.1'
javaArgs = '-DmyProp=someValue'
programArgs = '-console'
config += [ 'osgi.clean': true ] // add properties to the Equinox config
} else { // use felix, which is already the default
// maybe specify which felix version to use here...
}
// properties used for all containers
bundles += allprojects.toList() + IPOJO_BUNDLE // bundles are: this project + subprojects + IPojo
outDir = 'runtime' // the environment will be built at "${project.buildDir}/runtime"
copyManifestTo file( 'auto-generated/MANIFEST.MF' ) // make the manifest visible to the IDE for OSGi support
}
To run with Equinox, do:
gradle -Dequinox=true runOsgi
To run with Felix:
gradle runOsgi
PS. didn't try, but pretty sure this works. Let me know if you run into trouble.
This is already nice, can be in README but with #39 fix,
however this one users can't self discover the feature, because when there are added tasks (runOsgiFelix, runOsgiEquinox, runOsgiKnopflerfish) they are visible in gradle tasks
CLI and in IDEs
On the other hand implementing this will make some users believe, that this should all work out-of-box and raise dummy question like I do..
Can this be open for a while to see if more users want this
[feature request] please vote with :+1: from the top right menu
run any time any osgi container with
runOsgiFelix
,runOsgiEquinox
,runOsgiKnopflerfish
Currently this plugin makes a great job to run one of 3 major OSGi containers. However what container to run is written inside
build.gradle
. To try other container user have to change.What if user could run any time any osgi container with
gradle runOsgiFelix
,gradle runOsgiEquinox
,gradle runOsgiKnopflerfish
That would still require some preferences inside
build.gradle
, but they may look similar tothat is additional preferences not to runOsgi, but specific container option.
then there can be
runOsgi.default = felix
(orrunOsgi { felix { default = true ...
) to specify for use with$ gradle runOsgi