Permalink
Browse files

Various updates to build process and documentation

  • Loading branch information...
1 parent 67559a9 commit 7c0a5b0fa31a71cc031e5989ec56e443da58d439 @aled committed Aug 10, 2012
Showing with 935 additions and 931 deletions.
  1. +3 −0 .gitignore
  2. +27 −23 doc/BUILD.txt
  3. +3 −16 doc/README.txt
  4. BIN lib/test/sil-0.44.2b.jar
  5. +93 −32 pom.xml
  6. +0 −26 src/main/assembly/full-zip.xml
  7. +0 −19 src/main/assembly/project-zip.xml
  8. +31 −0 src/main/assembly/with-dependencies-zip.xml
  9. +0 −3 src/main/java/com/infomatiq/jsi/BuildProperties.java
  10. +0 −3 src/main/java/com/infomatiq/jsi/Point.java
  11. +0 −2 src/main/java/com/infomatiq/jsi/PriorityQueue.java
  12. +0 −3 src/main/java/com/infomatiq/jsi/Rectangle.java
  13. +0 −3 src/main/java/com/infomatiq/jsi/SpatialIndex.java
  14. +0 −3 src/main/java/com/infomatiq/jsi/rtree/Node.java
  15. +0 −3 src/main/java/com/infomatiq/jsi/rtree/RTree.java
  16. +0 −3 src/main/java/com/infomatiq/jsi/rtree/SortedList.java
  17. +1 −1 src/main/resources/build.properties
  18. +6 −0 src/site/site.xml
  19. +16 −16 src/site/xdoc/index.xml
  20. +0 −3 src/test/java/com/infomatiq/jsi/ListDecorator.java
  21. +70 −70 src/test/java/com/infomatiq/jsi/MoveEntriesTest.java
  22. +5 −8 src/test/java/com/infomatiq/jsi/NullIndex.java
  23. +0 −3 src/test/java/com/infomatiq/jsi/PerformanceTest.java
  24. +5 −8 src/test/java/com/infomatiq/jsi/RTreeWrapper.java
  25. +0 −3 src/test/java/com/infomatiq/jsi/RectangleTest.java
  26. +0 −3 src/test/java/com/infomatiq/jsi/ReferenceCompareTest.java
  27. +5 −8 src/test/java/com/infomatiq/jsi/SILWrapper.java
  28. +539 −541 src/test/java/com/infomatiq/jsi/Script.java
  29. +6 −9 src/test/java/com/infomatiq/jsi/SimpleIndex.java
  30. +0 −3 src/test/java/com/infomatiq/jsi/SortedListDecorator.java
  31. +109 −112 src/test/java/com/infomatiq/jsi/SortedListTest.java
  32. +2 −4 src/test/java/com/infomatiq/jsi/SpatialIndexFactory.java
  33. +14 −0 src/test/resources/logback.xml
View
@@ -5,4 +5,7 @@
.settings
target
*~
+*.swp
+*.log
+
View
@@ -1,23 +1,27 @@
-To build the JSI library from source, install maven and run the following:
-
-% cd <location-of-pom.xml>
-% mvn compile
-
-This will generate two jar files; target/jsi-1.0.jar and target/jsi-test-1.0.jar.
-The second is only required for running tests, and is not needed for production use.
-
-The following is a list of useful maven targets:
- o clean
- o compile
- o test
- o -Dtest=ReferenceCompareTest_10000 test
- o package
- o site
- o assembly:single (create package only)
- o site:deploy
- o deploy
-
-
-
-
-
+To build the JSI library from source, install maven 2 (NOT maven 3) and run the following:
+
+% cd <location-of-pom.xml>
+% mvn package
+
+This will generate the binary package (jsi-x.y.z.jar) in the target subdirectory.
+
+The following is a list of useful maven targets:
+ o eclipse:eclipse (generate eclipse project files; see below)
+ o clean
+ o compile
+ o test
+ o -Dtest=ReferenceCompareTest_10000 test
+ o package
+ o site
+ o assembly:single (create package only)
+ o site:deploy
+ o deploy
+
+To import the project into eclipse, run mvn eclipse:eclipse, and then set the M2_REPO variable
+in Window -> Preferences -> Java -> Build Path -> Classpath Variables to point to your local
+maven repository.
+
+
+
+
+
View
@@ -1,16 +1,3 @@
-This release contains the following directories/files.
-
-doc/ - documentation
-lib/ - contains the sil-0.44.2b library that is not available through maven
-pom.xml - maven build configuration. See BUILD.txt.
-src/ - source code to the JSI library. Test code is in the com.infomatiq.jsi.test package.
-
-The target directory is normally created as part of the build. However, the following are
-included in jsi-1.0-full.zip.
-
-target/apidocs - javadocs
-target/classes - compiled non-test classes
-target/dependencies - libraries that are downloaded by maven during the build
-target/jsi-1.0.jar - the jsi library
-target/test-classes - compiled test classes
-
+This is the Java Spatial Index library.
+
+For examples of usage, please see https://github.com/aled/jsi-examples
View
Binary file not shown.
View
125 pom.xml
@@ -4,7 +4,7 @@
<groupId>net.sourceforge.jsi</groupId>
<artifactId>jsi</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jsi</name>
@@ -14,6 +14,51 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
+ <repositories>
+
+ <!--
+ Maven is UNBELIEVABLY STUPID. By default, it will install corrupt dependencies in your local repository,
+ DESPITE the fact that checksum verification has failed. Change that default here using 'checksumPolicy'.
+
+ (Note: this is required, because we are using sourceforge to host a maven repository for one of the dependencies.
+ Unfortunately sourceforge returns an 'error' html page if you try to download a dependency that doesn't exist there;
+ it fails checksum validation but maven installs it anyway, thus breaking all future builds until you delete the offending
+ file. I can't find any way to prevent maven randomly querying the jsi maven repo for dependencies that I know don't exist there.)
+ -->
+
+ <repository>
+ <id>maven central</id>
+ <name>maven central</name>
+ <url>http://repo1.maven.org/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </snapshots>
+ </repository>
+
+ <repository>
+ <id>jsi.sourceforge.net</id>
+ <name>sourceforge jsi repository</name>
+ <url>http://sourceforge.net/projects/jsi/files/m2_repo</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+
<build>
<resources>
<resource>
@@ -47,29 +92,32 @@
</plugin>
</plugins>
</pluginManagement>
-
- <plugins>
+
+ <plugins>
+
+ <!-- Build currently tested on maven 2.2.1. Maven 3 does NOT work. -->
+ <!-- Allow versions that are greater or equal to 2.2.1, and less than 3.0.0 -->
<plugin>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.3.1</version>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.1.1</version>
<executions>
<execution>
- <id>install-sil-library</id>
- <phase>initialize</phase>
- <configuration>
- <file>lib/test/sil-0.44.2b.jar</file>
- <groupId>sil</groupId>
- <artifactId>sil</artifactId>
- <packaging>jar</packaging>
- <version>0.44.2b</version>
- </configuration>
+ <id>enforce-versions</id>
<goals>
- <goal>install-file</goal>
+ <goal>enforce</goal>
</goals>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>[2.2.1,3.0.0)</version>
+ </requireMavenVersion>
+ </rules>
+ </configuration>
</execution>
</executions>
</plugin>
-
+
<!-- This plugin checks that the source is compatible with Java 1.5 -->
<!-- Commented out as not necessary to run on every build -->
<!--
@@ -99,6 +147,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
+ <version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -123,8 +172,6 @@
</executions>
</plugin>
- <!-- Uncomment this to have dependences copied to the target directory -->
- <!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
@@ -149,22 +196,19 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
- <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
+ <outputDirectory>${project.build.directory}/test-dependencies</outputDirectory>
<excludeScope>compile</excludeScope>
</configuration>
</execution>
</executions>
</plugin>
- -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<descriptors>
- <descriptor>src/main/assembly/project-zip.xml</descriptor>
-
- <!--<descriptor>src/main/assembly/full-zip.xml</descriptor>-->
+ <descriptor>src/main/assembly/with-dependencies-zip.xml</descriptor>-->
</descriptors>
</configuration>
<executions>
@@ -182,8 +226,18 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>
-
</plugins>
+
+ <!-- the following needed for maven version 3 -->
+ <!--
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ <version>2.2</version>
+ </extension>
+ </extensions>
+ -->
</build>
<dependencies>
@@ -195,21 +249,28 @@
<scope>compile</scope>
</dependency>
- <!-- actual logging at runtime (e.g. when running tests) will be done by the JDK -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-jdk14</artifactId>
- <version>1.6.3</version>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>net.sf.trove4j</groupId>
<artifactId>trove4j</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
+ <!-- actual logging at runtime (e.g. when running tests) will be done by logback -->
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.0.6</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <version>1.0.6</version>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -1,26 +0,0 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
- <id>full</id>
- <formats>
- <format>zip</format>
- </formats>
- <fileSets>
- <fileSet>
- <directory>${project.basedir}</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>src/**</include>
- <include>doc/**</include>
- <include>lib/**</include>
- <include>target/apidocs/**</include>
- <include>target/classes/**</include>
- <include>target/test-classes/**</include>
- <include>target/dependencies/**</include>
- <include>target/jsi-${version}.jar</include>
- <include>.gitignore/**</include>
- <include>pom.xml</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
@@ -1,19 +0,0 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
- <id>project</id>
- <formats>
- <format>zip</format>
- </formats>
- <fileSets>
- <fileSet>
- <directory>${project.basedir}</directory>
- <outputDirectory>/</outputDirectory>
- <useDefaultExcludes>true</useDefaultExcludes>
- <excludes>
- <exclude>**/*.log</exclude>
- <exclude>**/${project.build.directory}/**</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-</assembly>
@@ -0,0 +1,31 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>with-dependencies</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}/target/dependencies</directory>
+ <outputDirectory>/lib</outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${project.basedir}/target</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${project.basedir}/doc</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>README.txt</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
@@ -27,9 +27,6 @@
/**
* Allows build properties to be retrieved at runtime. Currently, version and
* scmRevisionId are implemented.
- *
- * @author aled@sourceforge.net
- * @version 1.0
*/
public class BuildProperties {
private static final Logger log = LoggerFactory.getLogger(BuildProperties.class);
@@ -20,9 +20,6 @@
/**
* Currently hardcoded to 2 dimensions, but could be extended.
- *
- * @author aled@sourceforge.net
- * @version 1.0
*/
public class Point {
/**
@@ -65,8 +65,6 @@
* implemented here - if this functionality is required, then a heap probably
* isn't the right data structure.
* </p>
- * @author Aled Morris <aled@sourceforge.net>
- * @version 1.0
*/
public class PriorityQueue {
public static final boolean SORT_ORDER_ASCENDING = true;
Oops, something went wrong.

0 comments on commit 7c0a5b0

Please sign in to comment.