List:Commits« Previous MessageNext Message »
From:jonas oreland Date:July 17 2011 4:26pm
Subject:bzr push into mysql-5.5-cluster branch (jonas.oreland:3434)
View as plain text  
 3434 jonas oreland	2011-07-17 [merge]
      ndb - merge 55-main into local 55

    modified:
      mysql-test/suite/ndb_rpl/r/ndb_rpl_conflict_epoch.result
      mysql-test/suite/ndb_rpl/t/disabled.def
      mysql-test/suite/ndb_rpl/t/ndb_rpl_conflict_epoch.cnf
      mysql-test/suite/ndb_rpl/t/ndb_rpl_conflict_epoch.test
=== modified file 'storage/ndb/clusterj/CMakeLists.txt'
--- a/storage/ndb/clusterj/CMakeLists.txt	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/clusterj/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -25,11 +25,28 @@ IF("${WITH_CLASSPATH}" MATCHES "openjpa-
   SET(HAVE_OPENJPA TRUE)
 ENDIF()
 
-SET(BASE_NAMES api core tie)
+SET(DEP ndbjtie.jar
+        tie.jar
+        clusterj-api.jar
+        clusterj-core.jar
+        clusterj-tie.jar)
+
+SET(JARS ${CMAKE_CURRENT_BINARY_DIR}/../src/ndbjtie/ndbjtie.jar
+         ${CMAKE_CURRENT_BINARY_DIR}/../src/ndbjtie/jtie/jtie.jar
+         ${CMAKE_CURRENT_BINARY_DIR}/clusterj-api/clusterj-api.jar
+         ${CMAKE_CURRENT_BINARY_DIR}/clusterj-core/clusterj-core.jar
+         ${CMAKE_CURRENT_BINARY_DIR}/clusterj-tie/clusterj-tie.jar)
+
+ADD_SUBDIRECTORY(clusterj-api)
+ADD_SUBDIRECTORY(clusterj-core)
+ADD_SUBDIRECTORY(clusterj-tie)
 
 IF(HAVE_OPENJPA)
-  LIST(APPEND BASE_NAMES openjpa)
+  ADD_SUBDIRECTORY(clusterj-openjpa)
+  LIST(APPEND DEP clusterjpa.jar)
+  LIST(APPEND JARS ${CMAKE_CURRENT_BINARY_DIR}/clusterj-openjpa/clusterjpa.jar)
 ENDIF(HAVE_OPENJPA)
+
 IF(HAVE_JUNIT)
   ADD_SUBDIRECTORY(clusterj-test)
   IF(HAVE_OPENJPA)
@@ -37,41 +54,10 @@ IF(HAVE_JUNIT)
   ENDIF(HAVE_OPENJPA)
 ENDIF(HAVE_JUNIT)
 
-FOREACH(BASE_NAME ${BASE_NAMES})
-
-  ADD_SUBDIRECTORY(clusterj-${BASE_NAME})
-
-  SET(BASE_DIR ${CMAKE_SOURCE_DIR}/storage/ndb/clusterj/clusterj-${BASE_NAME})
-  SET(BUNDLE ${BASE_DIR}/src/main/resources/com/mysql/clusterj/${BASE_NAME}/Bundle.properties)
-
-  LIST(APPEND JAVA_CLASS_DIRS "${BASE_DIR}/target/classes" "com/mysql/clusterj")
-
-  IF(EXISTS ${BASE_DIR}/src/main/resources/META-INF/services)
-    LIST(APPEND JAVA_CLASS_DIRS "${BASE_DIR}/src/main/resources" "META-INF/services")
-  ENDIF()  
-  IF(EXISTS ${BUNDLE})
-    LIST(APPEND JAVA_CLASS_DIRS "${BASE_DIR}/src/main/resources" "com/mysql/clusterj/${BASE_NAME}/Bundle.properties")
-  ENDIF() 
-
-  # Generate clusterj.jar dependencies from the BASE_NAME
-  IF(BASE_NAME STREQUAL openjpa)
-    # Exception to confirm rule:
-    # "jar built in clusterj-openjpa is called clusterjpa"
-    SET(CLUSTERJ_JAR_DEPENDS ${CLUSTERJ_JAR_DEPENDS} clusterjpa.jar)
-  ELSE()
-    SET(CLUSTERJ_JAR_DEPENDS ${CLUSTERJ_JAR_DEPENDS} clusterj-${BASE_NAME}.jar)
-  ENDIF()
-
-
-ENDFOREACH(BASE_NAME ${BASE_NAMES})
-
-LIST(APPEND JAVA_CLASS_DIRS "${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/target/classes" "com/mysql/ndbjtie")
-LIST(APPEND JAVA_CLASS_DIRS "${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes" "com/mysql/jtie")
-
 SET(CLUSTERJ_EXPORTS com.mysql.clusterj,com.mysql.clusterj.query,com.mysql.clusterj.annotation,com.mysql.clusterj.metadata,com.mysql.clusterj.spi,com.mysql.clusterj.store,com.mysql.clusterj.util,com.mysql.clusterj.tie)
 CREATE_MANIFEST(clusterj_manifest.mf ${CLUSTERJ_EXPORTS} clusterj)
-CREATE_JAR_FROM_CLASSES(clusterj ${JAVA_CLASS_DIRS}
-  MANIFEST clusterj_manifest.mf
-  DEPENDENCIES ndbjtie.jar jtie.jar ${CLUSTERJ_JAR_DEPENDS})
-
 
+CREATE_JAR(clusterj
+  MERGE_JARS ${JARS}
+  MANIFEST clusterj_manifest.mf
+  DEPENDENCIES ${DEP} )

=== modified file 'storage/ndb/clusterj/clusterj-api/CMakeLists.txt'
--- a/storage/ndb/clusterj/clusterj-api/CMakeLists.txt	2011-01-31 09:07:01 +0000
+++ b/storage/ndb/clusterj/clusterj-api/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -14,14 +14,19 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 SET ( JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/*.java
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/annotation/*.java
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/query/*.java)
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/annotation
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/query)
+
+SET ( JAVA_SOURCES "")
+FOREACH(D ${JAVA_SOURCE_DIRS})
+  FILE(GLOB tmp ${D}/*.java)
+  LIST(APPEND JAVA_SOURCES ${tmp})
+ENDFOREACH()
 
 SET(CLUSTERJ_API_EXPORTS com.mysql.clusterj,com.mysql.clusterj.query,com.mysql.clusterj.annotation)
 CREATE_MANIFEST(manifest.mf ${CLUSTERJ_API_EXPORTS} clusterj-api)
 
-CREATE_JAR(clusterj-api ${JAVA_SOURCE_DIRS} 
+CREATE_JAR(clusterj-api ${JAVA_SOURCES}
   CLASSPATH target/classes
   MANIFEST manifest.mf)
-  

=== modified file 'storage/ndb/clusterj/clusterj-core/CMakeLists.txt'
--- a/storage/ndb/clusterj/clusterj-core/CMakeLists.txt	2011-01-31 09:07:01 +0000
+++ b/storage/ndb/clusterj/clusterj-core/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -14,19 +14,25 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 SET ( JAVA_SOURCE_DIRS
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/*.java
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/metadata/*.java
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/query/*.java
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/spi/*.java
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/store/*.java
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/util/*.java)
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/metadata
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/query
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/spi
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/store
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/core/util)
+
+SET ( JAVA_SOURCES "")
+FOREACH(D ${JAVA_SOURCE_DIRS})
+  FILE(GLOB tmp ${D}/*.java)
+  LIST(APPEND JAVA_SOURCES ${tmp})
+ENDFOREACH()
 
 SET ( CLASSPATH 
   target/classes
   ${CMAKE_SOURCE_DIR}/storage/ndb/clusterj/clusterj-api/target/classes)
 
-CREATE_JAR(clusterj-core ${JAVA_SOURCE_DIRS} 
+CREATE_JAR(clusterj-core ${JAVA_SOURCES}
   CLASSPATH ${CLASSPATH}
-  DEPENDENCIES clusterj-api.jar)
-
-
+  DEPENDENCIES clusterj-api.jar
+  EXTRA_FILES src/main/resources/META-INF
+              src/main/resources/com)

=== modified file 'storage/ndb/clusterj/clusterj-jpatest/CMakeLists.txt'
--- a/storage/ndb/clusterj/clusterj-jpatest/CMakeLists.txt	2011-01-31 09:07:01 +0000
+++ b/storage/ndb/clusterj/clusterj-jpatest/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -14,8 +14,14 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 SET ( JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/jpatest/*.java
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/jpatest/model/*.java)
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/jpatest
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/jpatest/model)
+
+SET ( JAVA_SOURCES "")
+FOREACH(D ${JAVA_SOURCE_DIRS})
+  FILE(GLOB tmp ${D}/*.java)
+  LIST(APPEND JAVA_SOURCES ${tmp})
+ENDFOREACH()
 
 SET ( CLASSPATH 
   target/classes
@@ -25,10 +31,9 @@ SET ( CLASSPATH
 SET(CLUSTERJ_JPATEST_EXPORTS com.mysql.clusterj.jpatest,com.mysql.clusterj.jpatest.model)
 CREATE_MANIFEST(manifest.mf ${CLUSTERJ_JPATEST_EXPORTS} clusterj-jpatest)
 
-CREATE_JAR(clusterj-jpatest ${JAVA_SOURCE_DIRS} 
+CREATE_JAR(clusterj-jpatest ${JAVA_SOURCES} 
   CLASSPATH ${CLASSPATH}
   MANIFEST manifest.mf
   ENHANCE ${CMAKE_CURRENT_SOURCE_DIR}/src/main/resources/META-INF/persistence.xml
   DEPENDENCIES clusterjpa.jar
-  EXTRA_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/main/resources META-INF/persistence.xml)
-
+  EXTRA_FILES src/main/resources/META-INF)

=== modified file 'storage/ndb/clusterj/clusterj-openjpa/CMakeLists.txt'
--- a/storage/ndb/clusterj/clusterj-openjpa/CMakeLists.txt	2011-01-31 09:07:01 +0000
+++ b/storage/ndb/clusterj/clusterj-openjpa/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -13,31 +13,21 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-SET(BASE_NAMES api core tie)
-
-FOREACH(BASE_NAME ${BASE_NAMES})
-
-  SET(BASE_DIR ${CMAKE_SOURCE_DIR}/storage/ndb/clusterj/clusterj-${BASE_NAME})
-  SET(BUNDLE ${BASE_DIR}/src/main/resources/com/mysql/clusterj/${BASE_NAME}/Bundle.properties)
-
-  LIST(APPEND JAVA_CLASS_DIRS "${BASE_DIR}/target/classes" "com/mysql/clusterj")
-
-  IF(EXISTS ${BASE_DIR}/src/main/resources/META-INF/services)
-    LIST(APPEND JAVA_CLASS_DIRS "${BASE_DIR}/src/main/resources" "META-INF/services")
-  ENDIF()
-  IF(EXISTS ${BUNDLE})
-    LIST(APPEND JAVA_CLASS_DIRS "${BASE_DIR}/src/main/resources" "com/mysql/clusterj/${BASE_NAME}/Bundle.properties")
-  ENDIF()
-
-ENDFOREACH(BASE_NAME ${BASE_NAMES})
-
-LIST(APPEND JAVA_CLASS_DIRS "${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/target/classes" "com/mysql/ndbjtie")
-LIST(APPEND JAVA_CLASS_DIRS "${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes" "com/mysql/jtie")
+SET(DEP ndbjtie.jar
+        tie.jar
+        clusterj-api.jar
+        clusterj-core.jar
+        clusterj-tie.jar)
+
+SET(JARS ${CMAKE_CURRENT_BINARY_DIR}/../../src/ndbjtie/ndbjtie.jar
+         ${CMAKE_CURRENT_BINARY_DIR}/../../src/ndbjtie/jtie/jtie.jar
+         ${CMAKE_CURRENT_BINARY_DIR}/../clusterj-api/clusterj-api.jar
+         ${CMAKE_CURRENT_BINARY_DIR}/../clusterj-core/clusterj-core.jar
+         ${CMAKE_CURRENT_BINARY_DIR}/../clusterj-tie/clusterj-tie.jar)
 
 SET(CLUSTERJ_EXPORTS com.mysql.clusterj,com.mysql.clusterj.query,com.mysql.clusterj.annotation,com.mysql.clusterj.metadata,com.mysql.clusterj.spi,com.mysql.clusterj.store,com.mysql.clusterj.util,com.mysql.clusterj.tie)
 
-SET (JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/openjpa/*.java)
+FILE(GLOB JAVA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/openjpa/*.java)
 
 SET(CLASSPATH 
   target/classes
@@ -47,9 +37,9 @@ SET(CLASSPATH
 
 SET(CLUSTERJPA_EXPORTS "${CLUSTERJ_EXPORTS},com.mysql.clusterj.openjpa")
 CREATE_MANIFEST(clusterjpa_manifest.mf ${CLUSTERJPA_EXPORTS} clusterjpa)
-CREATE_JAR(clusterjpa ${JAVA_SOURCE_DIRS}
+CREATE_JAR(clusterjpa ${JAVA_SOURCES}
   CLASSPATH ${CLASSPATH}
   MANIFEST clusterjpa_manifest.mf
-  DEPENDENCIES clusterj-tie.jar
-  EXTRA_FILES ${JAVA_CLASS_DIRS})
+  DEPENDENCIES ${DEP}
+  MERGE_JARS ${JARS})
 

=== modified file 'storage/ndb/clusterj/clusterj-test/CMakeLists.txt'
--- a/storage/ndb/clusterj/clusterj-test/CMakeLists.txt	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/clusterj/clusterj-test/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -14,9 +14,15 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 SET ( JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/testsuite/clusterj/*.java
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/testsuite/clusterj/domaintypehandler/*.java
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/testsuite/clusterj/model/*.java)
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/testsuite/clusterj
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/testsuite/clusterj/domaintypehandler
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/testsuite/clusterj/model)
+
+SET ( JAVA_SOURCES "")
+FOREACH(D ${JAVA_SOURCE_DIRS})
+  FILE(GLOB tmp ${D}/*.java)
+  LIST(APPEND JAVA_SOURCES ${tmp})
+ENDFOREACH()
 
 SET ( CLASSPATH 
   target/classes
@@ -27,11 +33,9 @@ SET ( CLASSPATH
 SET(CLUSTERJ_TEST_EXPORTS regression,testsuite.clusterj,testsuite.clusterj.model,testsuite.clusterj.domaintypehandler)
 CREATE_MANIFEST(manifest.mf ${CLUSTERJ_TEST_EXPORTS} clusterj-test)
 
-CREATE_JAR(clusterj-test ${JAVA_SOURCE_DIRS} 
+CREATE_JAR(clusterj-test ${JAVA_SOURCES}
   CLASSPATH ${CLASSPATH}
   MANIFEST manifest.mf
-  DEPENDENCIES clusterj-tie.jar
-  EXTRA_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/main/resources META-INF
-              ${CMAKE_CURRENT_SOURCE_DIR}/src/main/resources schema.sql)
-
-
+  DEPENDENCIES clusterj.jar
+  EXTRA_FILES src/main/resources/META-INF
+              src/main/resources/schema.sql)

=== modified file 'storage/ndb/clusterj/clusterj-tie/CMakeLists.txt'
--- a/storage/ndb/clusterj/clusterj-tie/CMakeLists.txt	2011-01-31 09:07:01 +0000
+++ b/storage/ndb/clusterj/clusterj-tie/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -13,8 +13,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-SET ( JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/tie/*.java)
+FILE(GLOB JAVA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/main/java/com/mysql/clusterj/tie/*.java)
 
 SET ( CLASSPATH 
   target/classes
@@ -27,8 +26,8 @@ SET ( JAR_DEPENDENCIES
   clusterj-core.jar
   ndbjtie.jar)
 
-CREATE_JAR(clusterj-tie ${JAVA_SOURCE_DIRS} 
+CREATE_JAR(clusterj-tie ${JAVA_SOURCES}
   CLASSPATH ${CLASSPATH}
-  DEPENDENCIES ${JAR_DEPENDENCIES})
-
-
+  DEPENDENCIES ${JAR_DEPENDENCIES}
+  EXTRA_FILES src/main/resources/META-INF
+              src/main/resources/com)

=== modified file 'storage/ndb/config/type_JAVA.cmake'
--- a/storage/ndb/config/type_JAVA.cmake	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/config/type_JAVA.cmake	2011-07-17 16:24:18 +0000
@@ -40,70 +40,10 @@ Bundle-Name: ${NAME}
 Bundle-Description: ClusterJ")
 ENDMACRO(CREATE_MANIFEST)
 
-MACRO(ADD_FILES_TO_JAR TARGET)
-
-  MYSQL_PARSE_ARGUMENTS(ARG
-    ""
-    ""
-    ${ARGN}
-  )
-
-  SET(JAVA_CLASSES ${ARG_DEFAULT_ARGS})
-
-  LIST(LENGTH JAVA_CLASSES CLASS_LIST_LENGTH)
-  MATH(EXPR EVEN "${CLASS_LIST_LENGTH}%2")
-  IF(EVEN GREATER 0)
-    MESSAGE(SEND_ERROR "CREATE_JAR_FROM_CLASSES has ${CLASS_LIST_LENGTH} but needs equal number of class parameters")
-  ENDIF()
-
-  MATH(EXPR CLASS_LIST_LENGTH "${CLASS_LIST_LENGTH} - 2")
-
-  SET_JAVA_NDB_VERSION()
-
-  FOREACH(I RANGE 0 ${CLASS_LIST_LENGTH} 2)
-
-    MATH(EXPR J "${I} + 1")
-    LIST(GET JAVA_CLASSES ${I} DIR)
-    LIST(GET JAVA_CLASSES ${J} IT)
-    SET(CLASS_DIRS -C ${DIR} ${IT})
-
-    ADD_CUSTOM_COMMAND( TARGET  ${TARGET}.jar POST_BUILD
-      COMMAND echo \"${JAVA_ARCHIVE} ufv ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-${JAVA_NDB_VERSION}.jar ${CLASS_DIRS}\"
-      COMMAND ${JAVA_ARCHIVE} ufv ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-${JAVA_NDB_VERSION}.jar ${CLASS_DIRS}
-      COMMENT "adding ${CLASS_DIRS} to target ${TARGET}-${JAVA_NDB_VERSION}.jar")
-
-  ENDFOREACH(I RANGE 0 ${CLASS_LIST_LENGTH} 2)
-
-ENDMACRO(ADD_FILES_TO_JAR)
-
-
-MACRO(CREATE_JAR_FROM_CLASSES TARGET)
-
-  MYSQL_PARSE_ARGUMENTS(ARG
-    "DEPENDENCIES;MANIFEST"
-    ""
-    ${ARGN}
-  )
-
-  SET_JAVA_NDB_VERSION()
-
-  ADD_CUSTOM_TARGET( ${TARGET}.jar ALL
-      COMMAND echo \"${JAVA_ARCHIVE} cfvm ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-${JAVA_NDB_VERSION}.jar ${ARG_MANIFEST}\"
-      COMMAND ${JAVA_ARCHIVE} cfvm ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-${JAVA_NDB_VERSION}.jar ${ARG_MANIFEST} )
-  FOREACH(DEP ${ARG_DEPENDENCIES})
-    ADD_DEPENDENCIES(${TARGET}.jar ${DEP})
-  ENDFOREACH(DEP ${ARG_DEPENDENCIES})
-
-  ADD_FILES_TO_JAR(${TARGET} "${ARG_DEFAULT_ARGS}")
-
-ENDMACRO(CREATE_JAR_FROM_CLASSES)
-
-
-# the target
 MACRO(CREATE_JAR)
 
   MYSQL_PARSE_ARGUMENTS(ARG
-    "CLASSPATH;DEPENDENCIES;MANIFEST;ENHANCE;EXTRA_FILES"
+    "CLASSPATH;MERGE_JARS;DEPENDENCIES;MANIFEST;ENHANCE;EXTRA_FILES"
     ""
     ${ARGN}
   )
@@ -112,19 +52,12 @@ MACRO(CREATE_JAR)
   SET(JAVA_FILES ${ARG_DEFAULT_ARGS})
   LIST(REMOVE_AT JAVA_FILES 0)
 
-  SET (CLASS_DIR "target/classes")
-  SET (JAR_DIR ".")
-
-  FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_DIR})
-  FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${JAR_DIR})
-  SET(TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_DIR})
+  SET (BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/target")
+  SET (CLASS_DIR "${BUILD_DIR}/classes")
+  SET (TARGET_DIR "${CLASS_DIR}")
 
   SET_JAVA_NDB_VERSION()
 
-  ADD_CUSTOM_TARGET( ${TARGET}.jar ALL
-    COMMAND echo \"${JAVA_ARCHIVE} cfv ${JAR_DIR}/${TARGET}-${JAVA_NDB_VERSION}.jar -C ${CLASS_DIR} .\"
-    COMMAND ${JAVA_ARCHIVE} cfv ${JAR_DIR}/${TARGET}-${JAVA_NDB_VERSION}.jar -C ${CLASS_DIR} .)
-
   # Concatenate the ARG_CLASSSPATH(a list of strings) into a string
   # with platform specific separator
   SET(separator) # Empty separator to start with
@@ -140,28 +73,123 @@ MACRO(CREATE_JAR)
   ENDFOREACH()
   # MESSAGE(STATUS "classpath_str: ${classpath_str}")
 
+  # Target jar-file
+  SET(JAR ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-${JAVA_NDB_VERSION}.jar)
+
+  # Marker for dependency handling
+  SET(MARKER_BASE ${BUILD_DIR}/create_jar)
+  SET(COUNTER 0)
+  SET(MARKER "${MARKER_BASE}.${COUNTER}")
+
+  # Add target
+  ADD_CUSTOM_TARGET(${TARGET}.jar ALL DEPENDS ${JAR})
+
+  # Compile
+  IF (JAVA_FILES)
+    ADD_CUSTOM_COMMAND(
+      OUTPUT ${MARKER}
+      COMMAND ${CMAKE_COMMAND} -E remove_directory ${BUILD_DIR}
+      COMMAND ${CMAKE_COMMAND} -E make_directory ${CLASS_DIR}
+      COMMAND echo \"${JAVA_COMPILE} -d ${TARGET_DIR} -classpath ${classpath_str} ${JAVA_FILES}\"
+      COMMAND ${JAVA_COMPILE} -d ${TARGET_DIR} -classpath "${classpath_str}" ${JAVA_FILES}
+      COMMAND ${CMAKE_COMMAND} -E touch ${MARKER}
+      DEPENDS ${JAVA_FILES}
+      COMMENT "Building objects for ${TARGET}.jar"
+    )
+  ELSE()
+    ADD_CUSTOM_COMMAND(
+      OUTPUT ${MARKER}
+      COMMAND ${CMAKE_COMMAND} -E remove_directory ${BUILD_DIR}
+      COMMAND ${CMAKE_COMMAND} -E make_directory ${CLASS_DIR}
+      COMMAND ${CMAKE_COMMAND} -E touch ${MARKER}
+      DEPENDS ${JAVA_FILES}
+      COMMENT "No files to compile for ${TARGET}.jar"
+    )
+  ENDIF()
+
+  # Copy extra files/directories
+  FOREACH(F ${ARG_EXTRA_FILES})
+
+    SET(OLD_MARKER ${MARKER})
+    MATH(EXPR COUNTER "${COUNTER} + 1")
+    SET(MARKER "${MARKER_BASE}.${COUNTER}")
+
+    GET_FILENAME_COMPONENT(N ${F} NAME)
+    IF(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${F})
+      ADD_CUSTOM_COMMAND(
+        OUTPUT ${MARKER}
+        COMMAND ${CMAKE_COMMAND} -E copy_directory ${F} ${CLASS_DIR}/${N}
+        COMMAND ${CMAKE_COMMAND} -E touch ${MARKER}
+        DEPENDS ${F} ${OLD_MARKER}
+        COMMENT "Adding directory ${N} to ${TARGET}.jar"
+      )
+    ELSE()
+      ADD_CUSTOM_COMMAND(
+        OUTPUT ${MARKER}
+        COMMAND ${CMAKE_COMMAND} -E copy_if_different ${F} ${CLASS_DIR}/${N}
+        COMMAND ${CMAKE_COMMAND} -E touch ${MARKER}
+        DEPENDS ${F} ${OLD_MARKER}
+        COMMENT "Adding file ${N} to ${TARGET}.jar"
+      )
+    ENDIF()
+  ENDFOREACH()
 
+  # Enhance
   IF(EXISTS ${ARG_ENHANCE})
-    MESSAGE(STATUS "enhancing ${TARGET}.jar")
     SET(ENHANCER org.apache.openjpa.enhance.PCEnhancer)
-    ADD_CUSTOM_COMMAND( TARGET ${TARGET}.jar PRE_BUILD
-      COMMAND echo \"${JAVA_COMPILE} -d ${TARGET_DIR} -classpath ${classpath_str} ${JAVA_FILES}\"
-      COMMAND ${JAVA_COMPILE} -d ${TARGET_DIR} -classpath ${classpath_str} ${JAVA_FILES}
+
+    SET(OLD_MARKER ${MARKER})
+    MATH(EXPR COUNTER "${COUNTER} + 1")
+    SET(MARKER "${MARKER_BASE}.${COUNTER}")
+
+    ADD_CUSTOM_COMMAND(
+      OUTPUT ${MARKER}
       COMMAND echo \"${JAVA_RUNTIME} -classpath ${classpath_str}${separator}${WITH_CLASSPATH} ${ENHANCER} -p ${ARG_ENHANCE} -d ${TARGET_DIR}\"
       COMMAND ${JAVA_RUNTIME} -classpath "${classpath_str}${separator}${WITH_CLASSPATH}" ${ENHANCER} -p ${ARG_ENHANCE} -d ${TARGET_DIR}
-    )
-  ELSE()
-    ADD_CUSTOM_COMMAND( TARGET ${TARGET}.jar PRE_BUILD
-      COMMAND echo \"${JAVA_COMPILE} -d ${TARGET_DIR} -classpath ${classpath_str} ${JAVA_FILES}\"
-      COMMAND ${JAVA_COMPILE} -d ${TARGET_DIR} -classpath "${classpath_str}" ${JAVA_FILES}
+      
+      COMMAND ${CMAKE_COMMAND} -E touch ${MARKER}
+      DEPENDS ${OLD_MARKER}
+      COMMENT "Enhancing objects for ${TARGET}.jar"
     )
   ENDIF()
 
-  LIST(LENGTH ARG_EXTRA_FILES LIST_LENGTH)
-  IF(LIST_LENGTH GREATER 0)
-    ADD_FILES_TO_JAR(${TARGET} "${ARG_EXTRA_FILES}")
+  # Unpack extra jars
+  FOREACH(_J ${ARG_MERGE_JARS})
+
+    SET(OLD_MARKER ${MARKER})
+    MATH(EXPR COUNTER "${COUNTER} + 1")
+    SET(MARKER "${MARKER_BASE}.${COUNTER}")
+
+    GET_FILENAME_COMPONENT(P ${_J} PATH)
+    GET_FILENAME_COMPONENT(N ${_J} NAME_WE)
+    SET(J ${P}/${N}-${JAVA_NDB_VERSION}.jar)
+
+    ADD_CUSTOM_COMMAND(
+      OUTPUT ${MARKER}
+      COMMAND ${JAVA_ARCHIVE} xf ${J}
+      COMMAND ${CMAKE_COMMAND} -E touch ${MARKER}
+      DEPENDS ${J} ${OLD_MARKER}
+      WORKING_DIRECTORY ${CLASS_DIR}
+      COMMENT "Unpacking ${N}.jar"
+    )
+  ENDFOREACH()
+
+  # Create JAR
+  SET(_ARG cf)
+  IF(ARG_MANIFEST)
+    SET(_ARG cfm)
   ENDIF()
 
+  ADD_CUSTOM_COMMAND(
+    OUTPUT ${JAR}
+    COMMAND echo \"${JAVA_ARCHIVE} ${_ARG} ${JAR}.tmp ${ARG_MANIFEST} -C ${CLASS_DIR} .\"
+    COMMAND ${JAVA_ARCHIVE} ${_ARG} ${JAR}.tmp ${ARG_MANIFEST} -C ${CLASS_DIR} .
+    COMMAND ${CMAKE_COMMAND} -E rename ${JAR}.tmp ${JAR}
+    COMMENT "Creating ${TARGET}.jar"
+    DEPENDS ${MARKER}
+  )
+
+  # Add CMake dependencies
   FOREACH(DEP ${ARG_DEPENDENCIES})
     ADD_DEPENDENCIES(${TARGET}.jar ${DEP})
   ENDFOREACH(DEP ${ARG_DEPENDENCIES})

=== modified file 'storage/ndb/src/ndbjtie/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/CMakeLists.txt	2011-01-31 09:07:01 +0000
+++ b/storage/ndb/src/ndbjtie/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -30,13 +30,19 @@ IF(HAVE_JDK)
 ENDIF(HAVE_JDK)
 
 SET ( JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/mysql/*.java
- ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/mgmapi/*.java
- ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/ndbapi/*.java)
+ ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/mysql
+ ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/mgmapi
+ ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/ndbapi)
+
+SET ( JAVA_SOURCES "")
+FOREACH(D ${JAVA_SOURCE_DIRS})
+  FILE(GLOB tmp ${D}/*.java)
+  LIST(APPEND JAVA_SOURCES ${tmp})
+ENDFOREACH()
 
 SET ( CLASSPATH jtie/target/classes)
 
-CREATE_JAR(ndbjtie ${JAVA_SOURCE_DIRS} 
+CREATE_JAR(ndbjtie ${JAVA_SOURCES}
   CLASSPATH ${CLASSPATH} 
   DEPENDENCIES jtie.jar)
 

=== modified file 'storage/ndb/src/ndbjtie/jtie/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/CMakeLists.txt	2011-01-31 09:07:01 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -16,9 +16,8 @@
 
 ADD_SUBDIRECTORY(test)
 
-SET ( JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/jtie/*.java)
+FILE(GLOB JAVA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/jtie/*.java)
 
-CREATE_JAR(jtie ${JAVA_SOURCE_DIRS} 
+CREATE_JAR(jtie ${JAVA_SOURCES} 
   CLASSPATH target/classes)
 

=== modified file 'storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -14,9 +14,10 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-CREATE_JAR(jtie-test-myjapi 
-  ${CMAKE_CURRENT_SOURCE_DIR}/myjapi/*.java 
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java
+FILE(GLOB src1 ${CMAKE_CURRENT_SOURCE_DIR}/myjapi/*.java)
+FILE(GLOB src2 ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
+
+CREATE_JAR(jtie-test-myjapi ${src1} ${src2}
   CLASSPATH ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes
   DEPENDENCIES jtie.jar)
 

=== modified file 'storage/ndb/src/ndbjtie/jtie/test/unload/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/test/unload/CMakeLists.txt	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/unload/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -14,8 +14,9 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-CREATE_JAR(jtie-test-unload
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java
+FILE(GLOB src ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
+
+CREATE_JAR(jtie-test-unload ${src}
   CLASSPATH ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes
   DEPENDENCIES jtie.jar)
 

=== modified file 'storage/ndb/src/ndbjtie/test/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/test/CMakeLists.txt	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/test/CMakeLists.txt	2011-07-17 16:24:18 +0000
@@ -13,15 +13,14 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-SET ( JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
+FILE(GLOB JAVA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
 
 SET ( CLASSPATH 
   ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/target/classes
   ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes
   ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie/test/myjapi/target/classes)
 
-CREATE_JAR(ndbjtie-test ${JAVA_SOURCE_DIRS} 
+CREATE_JAR(ndbjtie-test ${JAVA_SOURCES} 
   CLASSPATH ${CLASSPATH} 
   DEPENDENCIES ndbjtie.jar jtie-test-myjapi.jar)
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster branch (jonas.oreland:3434) jonas oreland19 Jul