Skip to content

Commit

Permalink
Some cleanups. Added small build script for Eclipse.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawi committed May 16, 2011
1 parent 7cfa30b commit 396a33a
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 96 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
*/felix-cache/
*/target/
eclipse/run/
*/.DS_Store/
**/.project
**/.classpath
Expand Down
2 changes: 2 additions & 0 deletions build.sh
@@ -1,3 +1,5 @@
#!/bin/sh

mvn -Dpackage.osx.skip=true $@
cd ols.distribution/target
unzip ols-v*-full.zip plugins/
76 changes: 76 additions & 0 deletions eclipse/build.xml
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="OLS IDE integration" default="noop" basedir=".">
<description>
provides some integration for IDEs like Eclipse
</description>

<property name="ols.base.dir" value="${basedir}/.." />
<property name="ols.ide.base.dir" value="${basedir}/run" />
<property name="ols.ide.plugin.target.dir" value="${ols.ide.base.dir}/plugins" />
<property name="ols.ide.fw.target.dir" value="${ols.ide.base.dir}/bin" />

<!-- PUBLIC TARGETS -->

<target name="build" depends="init" description="Sets up a project structure for running OLS">
<!-- extract distribution file to target directory -->
<unzip dest="${ols.ide.base.dir}">
<fileset refid="ols.distribution.tarball" />
<patternset>
<include name="**/bin/*.jar" />
<include name="**/plugins/*.jar" />
</patternset>
<cutdirsmapper dirs="1" />
</unzip>
<!-- copy the individual bundles as well -->
<copy todir="${ols.ide.plugin.target.dir}">
<fileset refid="ols.plugins" />
<cutdirsmapper dirs="2" />
</copy>
<!-- copy the configuration files as well -->
<copy todir="${ols.ide.plugin.target.dir}">
<fileset refid="ols.configfiles" />
<cutdirsmapper dirs="4" />
</copy>
</target>


<target name="run" description="Runs the client from the created structure.">
<java classname="nl.lxtreme.ols.runner.Runner" fork="true" failonerror="true">
<sysproperty key="nl.lxtreme.ols.bundle.dir" value="${ols.ide.plugin.target.dir}" />
<classpath>
<fileset dir="${ols.ide.fw.target.dir}">
<include name="*.jar" />
</fileset>
</classpath>
</java>
</target>


<target name="clean" description="Cleans the mess made earlier">
<delete dir="${ols.ide.base.dir}" failonerror="false" />
</target>

<!-- PRIVATE TARGETS -->

<target name="init">
<!-- searches for all latest greatest bundle files -->
<fileset dir="${ols.base.dir}" id="ols.plugins">
<include name="**/target/*.jar" />
</fileset>
<!-- searches for all configuration files -->
<fileset dir="${ols.base.dir}" id="ols.configfiles">
<include name="**/src/main/config/*.cfg" />
</fileset>
<!-- searches for the latest tarball matching '*.tar.gz' -->
<fileset dir="${ols.base.dir}/ols.distribution/target" id="ols.distribution.tarball">
<include name="*-full.zip" />
</fileset>
<!-- create target directories -->
<mkdir dir="${ols.ide.plugin.target.dir}" />
<mkdir dir="${ols.ide.fw.target.dir}" />
</target>

<target name="noop">
</target>

</project>
73 changes: 2 additions & 71 deletions runner/pom.xml
Expand Up @@ -31,85 +31,16 @@
<artifactId>org.apache.felix.configadmin</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.log</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.prefs</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>looks</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols</groupId>
<artifactId>api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols</groupId>
<artifactId>client</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols</groupId>
<artifactId>logging</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols</groupId>
<artifactId>service.io</artifactId>
<scope>runtime</scope>
<artifactId>util</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols</groupId>
<artifactId>org.rxtx</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols</groupId>
<artifactId>util</artifactId>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols.device</groupId>
<artifactId>test</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols.device</groupId>
<artifactId>logicsniffer</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols.tool</groupId>
<artifactId>base</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols.tool</groupId>
<artifactId>i2c</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols.tool</groupId>
<artifactId>spi</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols.tool</groupId>
<artifactId>state</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols.tool</groupId>
<artifactId>uart</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
15 changes: 11 additions & 4 deletions runner/src/main/java/nl/lxtreme/ols/runner/Runner.java
Expand Up @@ -240,15 +240,22 @@ private static String getPluginDir() throws IOException
return pluginDir.getCanonicalPath();
}

pluginDir = new File( "./plugins" );
String pluginProperty = System.getProperty( "nl.lxtreme.ols.bundle.dir", "./plugins" );
pluginDir = new File( pluginProperty );
if ( pluginDir.exists() && pluginDir.isDirectory() )
{
return pluginDir.getCanonicalPath();
}
else
{
pluginDir = new File( pluginDir, "plugins" );
if ( pluginDir.exists() && pluginDir.isDirectory() )
{
return pluginDir.getCanonicalPath();
}
}

String pluginProperty = System.getProperty( "nl.lxtreme.ols.bundle.dir", "./plugins" );
pluginDir = new File( pluginProperty );
return pluginDir.getCanonicalPath();
throw new RuntimeException( "Failed to find plugins folder! Is '-Dnl.lxtreme.ols.bundle.dir' specified?" );
}

/**
Expand Down
6 changes: 0 additions & 6 deletions rxtx/pom.xml
Expand Up @@ -41,12 +41,6 @@
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
Expand Down
20 changes: 5 additions & 15 deletions test.util/pom.xml
Expand Up @@ -12,11 +12,11 @@
<version>1.1.0</version>
<name>OLS Testing Utilities</name>
<dependencies>
<dependency>
<groupId>nl.lxtreme.ols</groupId>
<artifactId>api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>nl.lxtreme.ols</groupId>
<artifactId>api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -27,16 +27,6 @@
<artifactId>mockito-all</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down

0 comments on commit 396a33a

Please sign in to comment.