From 7de0b868c0b3bf598ce3bb0d4d4d439a11a0d0c1 Mon Sep 17 00:00:00 2001 From: Jan Volckaert Date: Thu, 13 Feb 2014 10:16:04 +0100 Subject: [PATCH] add extra guidelines in markdown add support for annotation-ds and the osgi compendium annotations for SCR services --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ build.gradle | 2 ++ 2 files changed, 51 insertions(+) diff --git a/README.md b/README.md index 8cddee0..7343dfa 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,52 @@ gradle-scr-plugin ================= Generates the OSGI-INF/serviceComponent.xml based on the Apache scr annotations + + +How To +====== +To use this plugin add a buildscript dependency of the gradle-scr-plugin to your build.grade script +e.g.: buildscript { + dependencies { + classpath 'be.jlrhome.gradle.scr:scrPlugin:0.0.+' + } + } + +Once the buildscript is added, apply the scr plugin: +e.g.: apply plugin: 'scr' + + +Troubleshouting +================ +* If the gradle-scr-plugin throws an exception like: Could not create an instance of type be.jlrhome.gradle.scr.ScrPluginExtension_Decorated. + Then make sure you also apply the java plugin : apply plugin: 'java' + + +Simple Example +============== +buildscript { + dependencies { + classpath 'be.jlrhome.gradle.scr:scrPlugin:0.0.+' + } +} + +apply plugin: 'java' +apply plugin: 'osgi' +apply plugin: 'scr' +apply plugin: 'groovy' +apply plugin: 'maven' + +sourceCompatibility = 1.6 +targetCompatibility = 1.6 + +version = '0.0.1-SNAPSHOT' +group = 'be.jlrhome.gradle.scr' +description = 'Gradle scr example' + +dependencies { + compile 'org.osgi:org.osgi.compendium:5.0.0' +// or + compile 'org.osgi:org.osgi.compendium:4.3.+' +// or + compile 'org.apache.felix:org.apache.felix.scr.annotations:1.9.+' +} diff --git a/build.gradle b/build.gradle index c237616..a1fb2d0 100644 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,8 @@ dependencies { dependencies { compile 'org.apache.felix:org.apache.felix.scr.generator:1.8.+' + compile 'org.apache.felix:org.apache.felix.scr.ds-annotations:1.2.+' + compile 'org.osgi:org.osgi.compendium:5.0.0' compile 'org.codehaus.plexus:plexus-utils:3.0.15' testCompile 'junit:junit:4.+' }