From 5a709d2397bbf72672bb138dda28ec8349cda695 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Mon, 21 Apr 2014 18:43:56 -0500 Subject: [PATCH] Updated Image-Tools to use Java 8. Java 8 is now required to run Image-Tools. PHash functionality initially failed tests. Generated databases or caches of PHash output may need to be regenerated to avoid false positives. --- build.sh | 2 +- buildWithoutTests.sh | 2 +- package.sh | 2 +- pom.xml | 75 +++++++++++++++---- src/includes/startCLI.sh | 4 +- src/includes/startGUI.sh | 2 +- .../imagetools/hash/HashServiceTest.scala | 8 +- 7 files changed, 70 insertions(+), 25 deletions(-) diff --git a/build.sh b/build.sh index 266b2fb..829d2c6 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,2 @@ #!/bin/bash -mvn clean jfx:jar +mvn clean package diff --git a/buildWithoutTests.sh b/buildWithoutTests.sh index a0785c7..fd41f9c 100755 --- a/buildWithoutTests.sh +++ b/buildWithoutTests.sh @@ -1,2 +1,2 @@ #!/bin/bash -mvn -Dmaven.test.skip=true clean jfx:jar +mvn -Dmaven.test.skip=true clean package diff --git a/package.sh b/package.sh index 831cb28..be3ded5 100755 --- a/package.sh +++ b/package.sh @@ -8,7 +8,7 @@ PACKAGEZIP=$PACKAGENAME.zip TARGET=$PWD/target #Packaging Jar Distributable -cd target/jfx/app/ +cd target/release/ echo "creating $PACKAGETAR in $TARGET" tar -zcvf $TARGET/$PACKAGETAR . echo "creating $PACKAGEZIP in $TARGET" diff --git a/pom.xml b/pom.xml index 0598d17..2fde5c5 100644 --- a/pom.xml +++ b/pom.xml @@ -27,14 +27,13 @@ UTF-8 - 1.7 + 1.8 3.8.1 2.0 1.0.13 1.7.5 1.0.1 2.10.3 - 8.0.0-M3 2.2.3 1.1 2.8.0 @@ -205,24 +204,16 @@ - - - com.zenjava - javafx-maven-plugin - 2.0 - - com.sothr.imagetools.App - - + net.alchim31.maven scala-maven-plugin 3.1.6 - org.apache.maven.plugins - maven-resources-plugin - 2.6 + org.apache.maven.plugins + maven-resources-plugin + 2.6 @@ -256,6 +247,7 @@ + com.code54.mojo buildversion-plugin @@ -268,6 +260,7 @@ + org.apache.maven.plugins maven-compiler-plugin @@ -285,6 +278,7 @@ + net.alchim31.maven scala-maven-plugin @@ -312,7 +306,30 @@ --> + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + copy-dependencies + package + + copy-dependencies + + + runtime + + ${project.build.directory}/release/lib + + + + + + + org.apache.maven.plugins maven-resources-plugin 2.6 @@ -339,7 +356,7 @@ copy-resources - ${project.build.directory}/jfx/app + ${project.build.directory}/release src/includes @@ -354,6 +371,34 @@ + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + package + + jar + + + + + true + lib/ + com.sothr.imagetools.App + + + + ${project.build.directory}/release + + + + + + maven-antrun-plugin 1.4 diff --git a/src/includes/startCLI.sh b/src/includes/startCLI.sh index ccfb4e4..50c53dc 100755 --- a/src/includes/startCLI.sh +++ b/src/includes/startCLI.sh @@ -5,7 +5,7 @@ while (( "$#" )); do args="$args $1" shift done -command="-Xmx1500m -cp ${project.name}-${project.version}-jfx.jar:lib/* com.sothr.imagetools.AppCLI" +command="-Xmx1500m -cp ${project.name}-${project.version}.jar:lib/* com.sothr.imagetools.AppCLI" correct=false #Check for existing commands and use them instead of asking if possible if [[ -z "$args" ]] @@ -33,4 +33,4 @@ else No ) exit;; esac done -fi \ No newline at end of file +fi diff --git a/src/includes/startGUI.sh b/src/includes/startGUI.sh index af6b315..c3ec40b 100755 --- a/src/includes/startGUI.sh +++ b/src/includes/startGUI.sh @@ -1,4 +1,4 @@ #!/bin/bash echo "Welcome to Image Tools version: ${project.version}" -command="-Xmx1500m -jar ${project.name}-${project.version}-jfx.jar" +command="-Xmx1500m -jar ${project.name}-${project.version}.jar" java $command diff --git a/src/test/scala/com/sothr/imagetools/hash/HashServiceTest.scala b/src/test/scala/com/sothr/imagetools/hash/HashServiceTest.scala index 5f1ec8e..9aad23e 100644 --- a/src/test/scala/com/sothr/imagetools/hash/HashServiceTest.scala +++ b/src/test/scala/com/sothr/imagetools/hash/HashServiceTest.scala @@ -220,8 +220,8 @@ class HashServiceTest extends BaseTest { val image = ImageIO.read(sample) debug(s"Image: width: ${image.getWidth} height: ${image.getHeight}") val hash = HashService.getPhash(image) - debug(s"Testing that $hash = -9154589787976242949L") - assert(hash == -9154589787976242949L) + debug(s"Testing that $hash = -9154554603604154117L") + assert(hash == -9154554603604154117L) } test("Calculate PHash Medium Sample Image 1") { @@ -389,8 +389,8 @@ class HashServiceTest extends BaseTest { test("Calculate ImageHash Large Sample Image 1") { debug("Starting 'Calculate ImageHash Large Sample Image 1' test") val hash = HashService.getImageHashes(TestParams.LargeSampleImage1) - debug(s"Testing that ${hash.hashCode} = -812836666") - assert(hash.hashCode == -812836666) + debug(s"Testing that ${hash.hashCode} = -812844858") + assert(hash.hashCode == -812844858) } test("Calculate ImageHash Medium Sample Image 1") {