]> gitweb.fperrin.net Git - GpsPrune.git/commitdiff
Update build scripts github/master origin/HEAD origin/master
authoractivityworkshop <mail@activityworkshop.net>
Thu, 23 May 2019 20:02:03 +0000 (22:02 +0200)
committeractivityworkshop <mail@activityworkshop.net>
Thu, 23 May 2019 20:02:03 +0000 (22:02 +0200)
buildtools/build.properties [deleted file]
buildtools/build.sh
buildtools/build.xml
buildtools/howtobuild.txt [new file with mode: 0644]
buildtools/pom.xml

diff --git a/buildtools/build.properties b/buildtools/build.properties
deleted file mode 100644 (file)
index c3c5084..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Set build properties
-
index 2b5c0f43eaf0c79e966852a020d9ecf854e853d2..b38e2ce60f042c9a31274ee4a6dfae683219843f 100644 (file)
@@ -7,16 +7,19 @@ rm -rf compile
 rm -rf dist
 # create compile directory
 mkdir compile
+echo "building..."
 # compile java
-javac -d compile $( find tim -name "*.java" -print )
+# TODO: If your java3d libraries are not under /usr/share/java, please edit the following line with the correct path
+javac -d compile -cp /usr/share/java/vecmath.jar:/usr/share/java/j3dutils.jar:/usr/share/java/j3dcore.jar $( find src -name "*.java" -print )
 # add other required resources
-cp -r tim/prune/lang compile/tim/prune/
-cp -r tim/prune/*.txt compile/tim/prune/
-cp -r tim/prune/gui/images compile/tim/prune/gui/
-cp tim/prune/function/srtm/srtmtiles.dat compile/tim/prune/function/srtm
+cp -r src/tim/prune/lang compile/tim/prune/
+cp -r src/tim/prune/*.txt compile/tim/prune/
+cp -r src/tim/prune/gui/images compile/tim/prune/gui/
+cp src/tim/prune/function/srtm/srtmtiles.dat compile/tim/prune/function/srtm
 # make dist directory
 mkdir dist
 # build into jar file
-jar cfm dist/${PRUNENAME}.jar MANIFEST.MF -C compile .
+jar cfm dist/${PRUNENAME}.jar buildtools/MANIFEST.MF -C compile .
 # finished!
 echo "build complete"
+
index 01e49e89af07b91a61e9bcd288c2efc1a5d81c69..50dd1389150b4f86c518ded36d3d46807e845ad0 100644 (file)
@@ -1,14 +1,17 @@
 <?xml version="1.0"?>\r
 \r
-<project name="Prune" default="dist" basedir=".">\r
+<project name="GpsPrune" default="jar" basedir=".">\r
        <!-- This file was supplied by Denny from the OpenSuse build service project -->\r
 \r
-       <property file="build.properties" />\r
        <property file="version.properties" />\r
-       <property name="src" value="." />\r
+       <property name="src" value="src" />\r
        <property name="build" value="build" />\r
        <property name="dist" value="dist" />\r
 \r
+       <path id="j3dlibs">\r
+               <fileset dir="/usr/share/java/" includes="*.jar"/>\r
+       </path>\r
+\r
        <!-- Init -->\r
 \r
        <target name="init">\r
        <!-- Build -->\r
 \r
        <target name="build" description="Build from source" depends="clean,init">\r
-               <javac srcdir="${src}" destdir="${build}" />\r
-       </target>\r
-\r
-       <!-- Distribution -->\r
-\r
-       <target name="dist" description="Create distributable jar from sources" depends="build,jar">\r
-               <fileset dir="${build}" casesensitive="yes">\r
-                       <include name="**/*" />\r
-                       <exclude name="**/*test*" />\r
-               </fileset>\r
+               <javac srcdir="${src}" destdir="${build}">\r
+                       <classpath refid="j3dlibs" />\r
+               </javac>\r
        </target>\r
 \r
        <!-- Jar -->\r
 \r
-       <target name="jar" description="Create jar file">\r
+       <target name="jar" description="Create jar file" depends="build">\r
+               <copy todir="${build}/tim/prune/lang">\r
+                       <fileset dir="${src}/tim/prune/lang"/>\r
+               </copy>\r
+               <copy todir="${build}/tim/prune/gui/images">\r
+                       <fileset dir="${src}/tim/prune/gui/images"/>\r
+               </copy>\r
+               <copy todir="${build}/tim/prune/">\r
+                       <fileset dir="${src}/tim/prune">\r
+                               <include name="*.txt"/>\r
+                       </fileset>\r
+               </copy>\r
+               <copy file="${src}/tim/prune/function/srtm/srtmtiles.dat" todir="${build}/tim/prune/function/srtm"/>\r
                <fileset dir="${build}" casesensitive="yes">\r
                        <include name="build/*" />\r
-                       <include name="tim/prune/lang/*" />\r
-                       <include name="license.txt" />\r
-                       <include name="readme.txt" />\r
-                       <include name="tim/prune/gui/images/*" />\r
-                       <exclude name="tim/prune/test/*" />\r
                </fileset>\r
                <jar destfile="${dist}/${ant.project.name}-${version}.jar" basedir="${build}">\r
                        <!-- define MANIFEST.MF -->\r
                                <attribute name="Implementation-Title" value="${ant.project.name}" />\r
                                <attribute name="Implementation-Version" value="${version}" />\r
                                <!-- details -->\r
-                               <attribute name="Main-Class" value="GpsPruner" />\r
+                               <attribute name="Main-Class" value="tim.prune.GpsPrune" />\r
                                <attribute name="Class-Path" value="${ant.project.name}.jar" />\r
-                               <section name="AntDemo.class">\r
-                                       <attribute name="Sealed" value="false" />\r
-                               </section>\r
                        </manifest>\r
                </jar>\r
        </target>\r
diff --git a/buildtools/howtobuild.txt b/buildtools/howtobuild.txt
new file mode 100644 (file)
index 0000000..a8efe96
--- /dev/null
@@ -0,0 +1,85 @@
+How to build GpsPrune
+=====================
+
+As with any Java program, there are several different ways to build the GpsPrune application from source, and which method you choose depends a lot on what other Java technologies you're familiar with.
+
+The most popular methods used to build GpsPrune are probably:
+
+ 1.  Using any Java IDE, and linking the project to your installed Java3d jars
+ 2.  Using a build script
+ 2.  Using ant
+ 3.  Using maven
+ 4.  Using gradle
+
+Note: in order not to pollute the root directory with every configuration file for each and every possible build tool, they have all been collected into the separate "buildtools" subdirectory.  For some of these methods (such as ant and maven), the corresponding configuration files should first be selected and moved up to the parent directory before running the tool from there.
+
+
+1.  Using an IDE
+================
+
+There are many IDEs to choose from, including Eclipse, IntelliJ, Netbeans and many others.  A list can be found at https://en.wikipedia.org/wiki/Java_IDEs#Java
+
+Most of these will have the ability to automatically build, run and debug the GpsPrune application, providing that they are told where the Java3d libraries can be found.  This can be done by editing the project dependencies to additionally include the external jar files.  Where these jar files can be found will vary from system to system, but on most linux systems they are in /usr/share/java/.
+
+
+2.  Using a build script
+========================
+
+Requirements: some kind of linux, unix or osx system; build.sh modified to your own paths
+
+First it is necessary to manually edit the build.sh script to add the paths to where your java3d libraries are installed.  This tells the javac tool where to find them for compilation.  An example is shown in build.sh using the -cp parameter to javac with a colon-separated list of jar files.
+
+To compile the code and build a jar file, run:
+   sh buildtools/build.sh
+
+It should be easily possible to modify the script to run on Windows systems, and any contributions in this direction would be gratefully received.
+
+
+3.  Using ant
+=============
+
+Requirements: ant already installed (eg apt-get install ant); build.xml and version.properties
+Firstly, these two configuration files ("build.xml" and "version.properties") should be moved from the "buildtools" directory to the parent directory.
+Secondly, the paths to the java3d jars should be checked and if necessary corrected in the build.xml file.  This is shown in the section beginning with <path id="j3dlibs">.
+Thirdly, from this directory where the configuration files (and the src directory) are located, run the ant tool:
+    ant
+
+This will firstly compile the java files from "src" into class files under "compile", and then bundle these together (along with the required resources) into a jar file under "dist".
+
+
+4.  Using Maven
+===============
+
+Requirements: Maven already installed (eg apt-get install maven); pom.xml
+Also an internet connection is required whenever a target is run for the first time.
+Note that as well as downloading a variety of plugins, Maven will also download its own versions of the java3d dependencies and store them in its own "repository" to use for the building step.
+
+Before you can use Maven, you need to move the file "pom.xml" from the "buildtools" directory into the parent directory.
+
+Then, to build GpsPrune, execute from this directory:
+   mvn clean install
+
+This doesn't actually install anything, but compiles the code and produces a jar file.  The resulting jar will be placed in the target/ folder.
+
+To rebuild, package and run GpsPrune, execute:
+   mvn clean install exec:java
+
+The resources in pom.xml are changed (so they are not the maven common ones) because of the backward compatibility with the project.
+
+4.1.  Using Maven to setup Eclipse
+==================================
+
+Requirements: Eclipse already installed (eg apt-get install eclipse-jdt); Maven setup as above
+You can import the project in Eclipse either by calling:
+   mvn eclipse:eclipse
+
+and then File > Import > Existing Projects into Workspace or using File > Import > Existing Maven Projects.
+
+
+5.  Using Gradle
+================
+
+TODO
+Requirements: Gradle already installed (eg apt-get install gradle); build.gradle file
+Any contributions to provide a suitable gradle file would be gratefully received.
+
index 8d4c8c570f5558285cb598303d8d5362ec1e09a7..82b29ac8a8969475038b95377cacefb182b26d52 100644 (file)
@@ -7,7 +7,7 @@
 
        <groupId>tim.prune</groupId>
        <artifactId>gpsprune</artifactId>
-       <version>19.3-SNAPSHOT</version>
+       <version>19.2</version>
        <packaging>jar</packaging>
 
        <name>tim.prune.gpsprune</name>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
                <app.mainClass>tim.prune.GpsPrune</app.mainClass>
-               <java3d.version>1.5.1</java3d.version>
+               <java3d.version>1.3.1</java3d.version>
+               <j3dutils.version>1.5.2</j3dutils.version>
        </properties>
        <repositories>
                <repository>
-                       <id>TUDelft</id>
-                       <url>http://simulation.tudelft.nl/maven/</url>
+                       <id>talanlabs-releases-repository</id>
+                       <url>http://nexus.talanlabs.com/content/repositories/releases/</url>
                </repository>
        </repositories>
 
@@ -40,8 +41,8 @@
                </dependency>
                <dependency>
                        <groupId>java3d</groupId>
-                       <artifactId>j3d-core-utils</artifactId>
-                       <version>${java3d.version}</version>
+                       <artifactId>j3dutils</artifactId>
+                       <version>${j3dutils.version}</version>
                </dependency>
        </dependencies>
 
@@ -51,7 +52,7 @@
                <sourceDirectory>${project.basedir}/</sourceDirectory>
                <resources>
                        <resource>
-                               <directory>${project.basedir}/</directory>
+                               <directory>${project.basedir}/src/</directory>
                                <includes>
                                        <include>tim/prune/gui/images/*</include>
                                        <include>tim/prune/lang/*</include>
@@ -61,8 +62,8 @@
                        </resource>
                </resources>
 
-               <pluginManagement><!-- lock down plugins versions to avoid using Maven 
-                               defaults (may be moved to parent pom) -->
+               <pluginManagement>
+                       <!-- lock down plugins versions to avoid using Maven defaults -->
                        <plugins>
                                <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
                                <plugin>