From: DRC Date: Wed, 5 Oct 2011 09:18:55 +0000 (+0000) Subject: Only sign JAR when it is built X-Git-Tag: v1.1.90~107 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d000252926e7de93c62937df7cf5cd06cde5e8d7;p=tigervnc.git Only sign JAR when it is built git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4703 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/cmake/SignJar.cmake b/cmake/SignJar.cmake index 3b0d0c86..abc35ba6 100644 --- a/cmake/SignJar.cmake +++ b/cmake/SignJar.cmake @@ -6,6 +6,8 @@ if(NOT JAR_FILE) message(FATAL_ERROR "JAR_FILE must be defined") endif() +message(STATUS "Signing ${JAR_FILE}") + set(KEYTOOL "${Java_PATH}/keytool") set(JARSIGNER "${Java_PATH}/jarsigner") diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 7ab9fc67..7048dd91 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -72,6 +72,8 @@ add_custom_command(OUTPUT ${JAVA_BINDIR}/tigervnc.ico ${JAVA_SRCDIR}/tigervnc.ico ${JAVA_BINDIR}/tigervnc.ico DEPENDS ${JAVA_SRCDIR}/tigervnc.ico) +string(REGEX REPLACE "jar" "" Java_PATH ${Java_JAR_EXECUTABLE}) + add_custom_command(OUTPUT VncViewer.jar DEPENDS ${JAVA_CLASSES_FULL} ${JAVA_SRCDIR}/MANIFEST.MF @@ -88,17 +90,14 @@ add_custom_command(OUTPUT VncViewer.jar com/jcraft/jzlib/*.class com/tigervnc/vncviewer/tigervnc.png com/tigervnc/vncviewer/tigervnc.ico + COMMAND ${CMAKE_COMMAND} + ARGS -DJava_PATH=${Java_PATH} + -DJAR_FILE=${CMAKE_CURRENT_BINARY_DIR}/VncViewer.jar + -P ${CMAKE_SOURCE_DIR}/cmake/SignJar.cmake WORKING_DIRECTORY ${OBJDIR}) add_custom_target(java ALL DEPENDS VncViewer.jar) -string(REGEX REPLACE "jar" "" Java_PATH ${Java_JAR_EXECUTABLE}) - -add_custom_command(TARGET java POST_BUILD COMMAND - ${CMAKE_COMMAND} -DJava_PATH=${Java_PATH} - -DJAR_FILE=${CMAKE_CURRENT_BINARY_DIR}/VncViewer.jar - -P ${CMAKE_SOURCE_DIR}/cmake/SignJar.cmake) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VncViewer.jar ${JAVA_SRCDIR}/README