[ 
https://issues.apache.org/jira/browse/LUCENE-3167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Luca Stancapiano updated LUCENE-3167:
-------------------------------------

    Attachment: lucene_trunk.patch

I expose this patch:

  <macrodef name="build-manifest" description="Builds a manifest file">
        <attribute name="title" default="Lucene Search Engine: 
${ant.project.name}" />
        <attribute name="bndtempDir" default="${build.dir}/temp"/>
        <sequential>
      <xmlproperty file="${ant.file}" collapseAttributes="true" prefix="bnd"/>
      <property name="bndclasspath" refid="classpath"/>
          <taskdef resource="aQute/bnd/ant/taskdef.properties" /> 
          <mkdir dir="@{bndtempDir}"/>
          <bnd 
              classpath="${bndclasspath}" 
              eclipse="false" 
              failok="false" 
              exceptions="true"
              files="${common.dir}/lucene.bnd" 
              output="@{bndtempDir}/${final.name}-temp.jar" /> 
          <copy todir="${common.dir}/build" flatten="true">
              <resources>
                  <url 
url="jar:file://@{bndtempDir}/${final.name}-temp.jar!/META-INF/MANIFEST.MF"/>
              </resources>
          </copy>
        </sequential>
  </macrodef>

It rewrites the build-manifest macrodef because bndlib cannot append the 
information of the manifest.mf. I moved the information of the manifest in the 
lucene.bnd file appending the new osgi info:


Export-Package: *;-split-package:=merge-first
Specification-Title: Lucene Search Engine: ${ant.project.name}
Specification-Version: ${spec.version}
Specification-Vendor: The Apache Software Foundation
Implementation-Title: org.apache.lucene
Implementation-Version: ${version} ${svnversion} - ${DSTAMP} ${TSTAMP}
Implementation-Vendor: The Apache Software Foundation
X-Compile-Source-JDK: ${javac.source}
X-Compile-Target-JDK: ${javac.target}
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-SymbolicName: org.apache.lucene.${name}
Bundle-Name: Lucene Search Engine: ${ant.project.name}
Bundle-Vendor: The Apache Software Foundation
Bundle-Version: ${version}
Bundle-Description: ${bnd.project.description}
Bundle-DocUR: http://www.apache.org/


I tested on lucene and solr modules and all jars are created with the correct 
OSGI info in the manifest.mf. Unluckily bndlib is not flexible so if you use 
bndlib you are forced to:

- precompile the classes
- create a temp directory with a temporary jar
- extract the new manifest from the jar and put it in the shared directory




> Make lucene/solr a OSGI bundle through Ant
> ------------------------------------------
>
>                 Key: LUCENE-3167
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3167
>             Project: Lucene - Java
>          Issue Type: New Feature
>         Environment: bndtools
>            Reporter: Luca Stancapiano
>         Attachments: lucene_trunk.patch
>
>
> We need to make a bundle thriugh Ant, so the binary can be published and no 
> more need the download of the sources. Actually to get a OSGI bundle we need 
> to use maven tools and build the sources. Here the reference for the creation 
> of the OSGI bundle through Maven:
> https://issues.apache.org/jira/browse/LUCENE-1344
> Bndtools could be used inside Ant

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to