[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Bundle lookup

Hi Michael,
On Sunday 22 January 2006 21:29, Michael Mangeng wrote:
> The problem is that I dont know which approach I have to take when I
> want to install "the highest version" of e.g. bundle1 so the upper
> sample-xml should install bundle1-1.2.0.jar (if this is the highest
> version available).
For our development we use ivy (http://www.jayasoft.org/ivy), and have written 
a little ant task that produces a config.ini fole that Equinox reads for 
deploying bundles. That way, we specify start levels as Ivy configurations 
and get dependency and of course version handling for free. The scenario you 
discribe is very common for us, a usual Ivy.xml file for a product assembly 
(that is, a product consisting of several bundles that are compiled using a 
previous stage in the process) would look something like:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" 
href="http://www.jayasoft.fr/org/ivyrep/ivy-doc.xsl";?>
<ivy-module version="1.0">
    <info organisation="scancoin" module="test.assembly" status="integration">
        <repository name="scancoin" url="https://test"/>
    </info>
    
    <configurations>
        <conf name="default"/>
	<!--these are the runlevels, picked up by an ant task and inserted into the 
config.ini bundles statement-->
        <conf name="1" visibility="private"/>
        <conf name="2" visibility="private"/>
        <conf name="3" visibility="private"/>
        <conf name="4" visibility="private"/>
        <conf name="5" visibility="private"/>
        <conf name="6" visibility="private"/>
        <conf name="localdir" visibility="private"/>
    </configurations>
    
    <publications>
        <artifact name="test.assembly" type="zip" conf="default"/>
    </publications>
    
    <dependencies>
        <!-- core bundles -->
        <!-- knopflerfish bundles -->
        <dependency org="knopflerfish" name="cm" rev="latest.integration" 
conf="1->*">
            <artifact name="cm_all" type="jar"/>
        </dependency>
        
        <dependency org="knopflerfish" name="console" rev="latest.integration" 
conf="1->*">
            <artifact name="console_all" type="jar"/>
        </dependency>
        
        <dependency org="knopflerfish" name="log" rev="latest.integration" 
conf="1->*">
            <artifact name="log_all" type="jar"/>
        </dependency>
        
        <!-- core bundles -->
        <dependency org="scancoin" name="com.scancoin.core.module1" 
transitive="false" rev="latest.integration" conf="3->*"/>
        <dependency org="scancoin" name="com.scancoin.core.module2" 
transitive="false" rev="latest.integration" conf="4->*"/>
        <dependency org="scancoin" name="com.scancoin.core.module3" 
transitive="false" rev="latest.integration" conf="2->*"/>

        <!-- OSGi container -->
        <dependency org="eclipse" name="org.eclipse.osgi" 
rev="latest.integration" conf="localdir->*"/>
        <dependency org="eclipse" name="org.eclipse.osgi.services" 
rev="latest.integration" conf="1->*"/>
        
    </dependencies>
</ivy-module>

Ivy will then copy the dependencies without the version into 
${basedir}/lib/3/com.scancoin.core.module1.jar etc. and the ant task builds a 
config.ini from it that looks something like 

.....
osgi.bundles=lib/3/com.scancoin.core.module1@3:start etc.
.....



This works great. If it helps and you want more info, maybe I can help you 
further.

/peter