Skip to content

Commit

Permalink
Merge pull request #5907 from chrisrueger/improve-code-templates
Browse files Browse the repository at this point in the history
Improve code templates
  • Loading branch information
pkriens authored Dec 1, 2023
2 parents c23da8f + 5c9eaf6 commit 253ae2b
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
bnd.identity;id='org.apache.felix.gogo.runtime',\
bnd.identity;id='org.apache.felix.gogo.shell'

-runfw: org.apache.felix.framework;version='[7.0.3,7.0.3]'
-runfw: org.apache.felix.framework

$if(javaLevel)$
-runee: JavaSE-$javaLevel$
$endif$

-resolve: beforelaunch
-resolve: cache
4 changes: 2 additions & 2 deletions org.bndtools.templates.osgi/resources/api-help.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form>
<p>Creates a project for defining an API using OSGi R6 standard annotations. The following dependencies are added to the build path:</p>
<li>OSGi Annotation 6.0.1</li>
<p>Creates a project for defining an API using OSGi standard annotations. The following dependencies are added to the build path:</p>
<li>OSGi Annotation</li>
</form>
9 changes: 4 additions & 5 deletions org.bndtools.templates.osgi/resources/comp-help.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<form>
<p>Creates a project for developing Components with Declarative Services. The following dependencies are added to the build path:</p>
<li>OSGi Annotation 6.0.1</li>
<li>OSGi Core 5.0</li>
<li>OSGi Compendium 5.0</li>
<li>OSGi Annotation</li>
<li>OSGi Core</li>
<p>... and the following are added to the test path:</p>
<li>JUnit 4</li>
<li>Hamcrest Core 1.3</li>
<li>JUnit</li>
<li>Hamcrest Core</li>
</form>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<form>
<p>Creates a project for integration testing bundles inside an OSGi framework. The following dependencies are added to the build path:</p>
<li>OSGi Annotation 6.0.1</li>
<li>OSGi Core 6.0</li>
<li>OSGi Compendium 6.0</li>
<li>JUnit 4</li>
<li>Mockito Core 1.9</li>
<li>OSGi Annotation</li>
<li>OSGi Core</li>
<li>JUnit</li>
<li>Mockito Core</li>
</form>
9 changes: 2 additions & 7 deletions org.bndtools.templates.osgi/resources/templates/api/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
-buildpath: osgi.annotation; version=6.0.1
-buildpath: osgi.core,\
osgi.annotation
-baseline: *
$if(javaLevel)$
javac.source: $javaLevel$
javac.target: $javaLevel$
$endif$

Bundle-Version: 1.0.0.\${tstamp}
Export-Package: $basePackageName$

11 changes: 2 additions & 9 deletions org.bndtools.templates.osgi/resources/templates/ds/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
-buildpath: \
osgi.annotation; version=6.0.1,\
osgi.core; version=6.0,\
osgi.cmpn; version=6.0
org.osgi.service.component.annotations,\
osgi.core,\

-testpath: \
\${junit}

$if(javaLevel)$
javac.source: $javaLevel$
javac.target: $javaLevel$
$endif$

Bundle-Version: 0.0.0.\${tstamp}
-privatepackage: $basePackageName$
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#-runfw: org.apache.felix.framework;version=5
#-runee: JavaSE-1.8

-runprovidedcapabilities: \${native_capability}

-resolve.effective: active;skip:="osgi.service"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
# This is the version of JUnit that will be used at build time and run time
junit: org.apache.servicemix.bundles.junit;version="[4.11,5)"

# This is the version of Mockito that will be used at build time and run time
mockito: org.mockito.mockito-core;version="[1.9,2)",\
org.objenesis;version="[2.1,3)"

# Discover and run all test cases annotated with the @RunWith annotation
Test-Cases: \${classes;CONCRETE;ANNOTATED;org.junit.runner.RunWith}

# Build dependencies
-buildpath: \
\${junit},\
\${mockito},\
osgi.annotation; version=6.0.1,\
osgi.core; version=6.0,\
osgi.cmpn; version=6.0
osgi.core,\

$if(javaLevel)$
javac.source: $javaLevel$
javac.target: $javaLevel$
$endif$

# We need JUnit and Mockito to resolve the test cases at runtime.
# Other runtime dependencies should be added as necessary
-runbundles: \
\${junit},\
\${mockito}

Bundle-Version: 0.0.0.\${tstamp}
-privatepackage: $basePackageName$

# Needed for Mockito's mocking to work
-runsystempackages.objenesis: sun.misc,sun.reflect

# Use Felix by default
-runfw: org.apache.felix.framework;version=5
-runvm: -ea
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-runfw: org.apache.felix.framework;version=4
-runee: JavaSE-1.8
-runfw: org.apache.felix.framework
-runprovidedcapabilities: \${native_capability}

-resolve.effective: active;skip:="osgi.service"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
-runee: JavaSE-1.8
-runprovidedcapabilities: \${native_capability}
-resolve.effective: active; skip:="osgi.service"

0 comments on commit 253ae2b

Please sign in to comment.