refactor Makefile to use configure to find executable for maven

This commit is contained in:
Scott Fennell 2020-01-31 13:25:38 -06:00
parent ac77bc000f
commit 69d04cae26
3 changed files with 12 additions and 4 deletions

View File

@ -11,6 +11,7 @@ SWIG = @SWIG@
PYTHON = @PYTHON@
CLANG = @CLANG@
TEE = @TEE@
MVN = @MVN@
USE_JAVA = @USE_JAVA@
JAVAC = @JAVA_CC@

View File

@ -3,4 +3,4 @@
# Build Java
###############################################################
add_custom_target(java COMMAND mvn package -Dcmake=true -DbuildDirectory=${CMAKE_BINARY_DIR}/libexec/trick/java/build WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(java COMMAND ${MAVEN_EXECUTABLE} -q package -Dcmake=true -DbuildDirectory=${CMAKE_BINARY_DIR}/libexec/trick/java/build WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -1,13 +1,20 @@
TRICK_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../..)
JAVA_BUILD_DIR = ${TRICK_HOME}/libexec/trick/java/build
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
all: ${TRICK_HOME}/libexec/trick/java/build
@echo "Java build successful"
${TRICK_HOME}/libexec/trick/java/build:
mvn package
@echo "Building java application... For details see ${JAVA_BUILD_DIR}/maven.out"
@mkdir ${JAVA_BUILD_DIR}
@${MVN} package &> ${JAVA_BUILD_DIR}/maven.out
javadoc:
mvn javadoc:javadoc
${MVN} javadoc:javadoc
clean:
mvn clean
@rm -rf ${JAVA_BUILD_DIR}
@echo java build directory cleaned.