You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/10/15 03:56:23 UTC
svn commit: r704767 - in /tuscany/branches/sca-equinox:
modules/thirdparty-library/
tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/
Author: jsdelfino
Date: Tue Oct 14 18:56:22 2008
New Revision: 704767
URL: http://svn.apache.org/viewvc?rev=704767&view=rev
Log:
Added a parameter to the bundle plugin to allow configuration of the bundle symbolic name. Use that parameter in thirdparty-library/pom.xml. Ignore .classpath file if it doesn't exist yet.
Modified:
tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml
tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java
tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java
Modified: tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml?rev=704767&r1=704766&r2=704767&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml (original)
+++ tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml Tue Oct 14 18:56:22 2008
@@ -63,6 +63,9 @@
<goals>
<goal>assemble-thirdparty-bundle</goal>
</goals>
+ <configuration>
+ <symbolicName>org.apache.tuscany.sca.thirdparty.library</symbolicName>
+ </configuration>
</execution>
</executions>
</plugin>
Modified: tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java?rev=704767&r1=704766&r2=704767&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java (original)
+++ tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java Tue Oct 14 18:56:22 2008
@@ -124,7 +124,7 @@
}
}
- static Manifest libraryManifest(Set<File> jarFiles, String name, String version)
+ static Manifest libraryManifest(Set<File> jarFiles, String name, String symbolicName, String version)
throws IllegalStateException {
try {
@@ -162,7 +162,7 @@
Attributes attributes = manifest.getMainAttributes();
attributes.putValue("Manifest-Version", "1.0");
attributes.putValue(BUNDLE_MANIFESTVERSION, "2");
- attributes.putValue(BUNDLE_SYMBOLICNAME, name);
+ attributes.putValue(BUNDLE_SYMBOLICNAME, symbolicName);
attributes.putValue(BUNDLE_NAME, name);
attributes.putValue(BUNDLE_VERSION, version);
attributes.putValue(DYNAMICIMPORT_PACKAGE, "*");
Modified: tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java?rev=704767&r1=704766&r2=704767&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java (original)
+++ tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java Tue Oct 14 18:56:22 2008
@@ -153,6 +153,13 @@
*/
private ArtifactResolver artifactResolver;
+ /**
+ * The bundle symbolic name
+ *
+ * @parameter
+ */
+ private String symbolicName;
+
public void execute() throws MojoExecutionException {
Log log = getLog();
@@ -232,7 +239,7 @@
version = version.substring(0, version.length() - Artifact.SNAPSHOT_VERSION.length() - 1);
}
- Manifest mf = BundleUtil.libraryManifest(jarFiles, project.getName(), version);
+ Manifest mf = BundleUtil.libraryManifest(jarFiles, project.getName(), symbolicName, version);
File file = new File(project.getBasedir(), "META-INF");
file.mkdir();
file= new File(file, "MANIFEST.MF");
Modified: tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java?rev=704767&r1=704766&r2=704767&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java (original)
+++ tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java Tue Oct 14 18:56:22 2008
@@ -80,6 +80,9 @@
try {
// Adjust .classpath, make all classpath entries point to the lib directory
File classpath = new File(basedir, ".classpath");
+ if (!classpath.exists()) {
+ return;
+ }
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(classpath)));
StringWriter buffer = new StringWriter();
PrintWriter printer = new PrintWriter(buffer);