From 45f22abbb0f1df21429248af1d51a3375e171dd6 Mon Sep 17 00:00:00 2001
From: rishwanth1995 <rishwanth1995@hotmail.com>
Date: Tue, 27 Mar 2018 15:36:08 -0400
Subject: [PATCH] added postgres-up-to-date property to build script

---
 bindings/java/build.xml | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/bindings/java/build.xml b/bindings/java/build.xml
index c7d929afb..30b53e0f9 100755
--- a/bindings/java/build.xml
+++ b/bindings/java/build.xml
@@ -146,7 +146,7 @@
 		<jar jarfile="${dist}/sleuthkit-${VERSION}.jar" basedir="${build}"/>
 	</target>
 
-	<target name="dist-PostgreSQL" depends="check-build, init-ivy, compile, copyLibs-PostgreSQL" description="generate the PostgreSQL distribution">
+	<target name="dist-PostgreSQL" depends="check-postgresql-build, init-ivy, compile, copyLibs-PostgreSQL" unless="postgres-up-to-date" description="generate the PostgreSQL distribution">
 		<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
 		<jar jarfile="${dist}/sleuthkit-postgresql-${VERSION}.jar" basedir="${build}"/>
 	</target>
@@ -162,6 +162,18 @@
 			</and>
 		</condition>
 	</target>
+	
+	<target name="check-postgresql-build" depends="check-native-build">
+		<uptodate property="java-postgres-up-to-date" targetfile="${dist}/sleuthkit-postgresql-${VERSION}.jar">
+			<srcfiles dir="${src}" includes="**/*.java"/>
+		</uptodate>
+		<condition property="postgres-up-to-date">
+			<and>
+				<isset property="java-postgres-up-to-date"/>
+				<isset property="native-up-to-date"/>
+			</and>
+		</condition>
+	</target>
 
 	<target name="dist" depends="check-build" unless="up-to-date">
 		<antcall target="dist-SQLite"/>
@@ -176,7 +188,7 @@
 		<jar jarfile="${dist}/sleuthkit-${VERSION}.jar" basedir="${build}"/>
 	</target>
 
-	<target name="Debug-PostgreSQL" depends="init-ivy,  compile, copyLibs-PostgreSQLDebug" description="generate the PostgreSQL debug distribution">
+	<target name="Debug-PostgreSQL" depends="check-postgresql-build, init-ivy,  compile, copyLibs-PostgreSQLDebug" unless="postgres-up-to-date" description="generate the PostgreSQL debug distribution">
 		<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
 		<jar jarfile="${dist}/sleuthkit-postgresql-${VERSION}.jar" basedir="${build}"/>
 	</target>
-- 
GitLab