<commit_before>#
# CMakeLists.txt for openwsman/bindings/java
#
#
# This creates several files
#  1. libjwsman.so
#  2. *.java
#

enable_testing()

add_subdirectory(tests)


MESSAGE(STATUS "Java compiler: ${JAVA_COMPILE}")
MESSAGE(STATUS "Java runtime: ${JAVA_RUNTIME}")
MESSAGE(STATUS "Java archiver: ${JAVA_ARCHIVE}")
MESSAGE(STATUS "Java include path: ${JAVA_INCLUDE_PATH}")

SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/openwsman_wrap.c" )
SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/../openwsman.i" )

ADD_CUSTOM_COMMAND (
   OUTPUT  ${SWIG_OUTPUT}
   COMMAND ${CMAKE_COMMAND} -E echo_append "Creating wrapper code for Java ..."
   COMMAND ${SWIG_EXECUTABLE} -java -package org.openwsman -features autodoc -I${CMAKE_SOURCE_DIR}/include -o ${SWIG_OUTPUT} ${SWIG_INPUT}
   COMMAND ${CMAKE_COMMAND} -E echo "Done."
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../*.i
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.c
)

SET( jar_NAME "openwsman-${PACKAGE_ARCHITECTURE}-${VERSION}.jar" )

ADD_CUSTOM_COMMAND (
   OUTPUT ${jar_NAME}
   POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E echo_append "Compiling Java files ..."
   COMMAND ${JAVA_COMPILE} -d . ${CMAKE_CURRENT_SOURCE_DIR}/JWsManBase.java *.java
   COMMAND ${CMAKE_COMMAND} -E echo_append "Creating JAR ..."
   COMMAND ${JAVA_ARCHIVE} cvf ${jar_NAME} *.so org/*
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/JWsManBase.java
   DEPENDS ${SWIG_OUTPUT}
)

ADD_CUSTOM_TARGET ( jwsman_all ALL
   COMMAND ${CMAKE_COMMAND} -E echo_append "Building Java bindings ..."
   DEPENDS ${jar_NAME}
)

SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )<commit_msg>Java bindings: Compile in two steps<commit_after>#
# CMakeLists.txt for openwsman/bindings/java
#
#
# This creates several files
#  1. libjwsman.so
#  2. *.java
#

enable_testing()

add_subdirectory(tests)


MESSAGE(STATUS "Java compiler: ${JAVA_COMPILE}")
MESSAGE(STATUS "Java runtime: ${JAVA_RUNTIME}")
MESSAGE(STATUS "Java archiver: ${JAVA_ARCHIVE}")
MESSAGE(STATUS "Java include path: ${JAVA_INCLUDE_PATH}")

SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/openwsman_wrap.c" )
SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/../openwsman.i" )

ADD_CUSTOM_COMMAND (
   OUTPUT  ${SWIG_OUTPUT}
   COMMAND ${CMAKE_COMMAND} -E echo_append "Creating wrapper code for Java ..."
   COMMAND ${SWIG_EXECUTABLE} -java -package org.openwsman -features autodoc -I${CMAKE_SOURCE_DIR}/include -o ${SWIG_OUTPUT} ${SWIG_INPUT}
   COMMAND ${CMAKE_COMMAND} -E echo "Done."
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../*.i
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.c
)

SET( jar_NAME "openwsman-${PACKAGE_ARCHITECTURE}-${VERSION}.jar" )

ADD_CUSTOM_COMMAND (
   OUTPUT ${jar_NAME}
   POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E echo_append "Compiling Java files ..."
   COMMAND ${JAVA_COMPILE} -d . ${CMAKE_CURRENT_SOURCE_DIR}/JWsManBase.java
   COMMAND ${JAVA_COMPILE} -d . *.java
   COMMAND ${CMAKE_COMMAND} -E echo_append "Creating JAR ..."
   COMMAND ${JAVA_ARCHIVE} cvf ${jar_NAME} *.so org/*
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/JWsManBase.java
   DEPENDS ${SWIG_OUTPUT}
)

ADD_CUSTOM_TARGET ( jwsman_all ALL
   COMMAND ${CMAKE_COMMAND} -E echo_append "Building Java bindings ..."
   DEPENDS ${jar_NAME}
)

SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
{'fraction_non_alphanumeric': 0.13595166163141995, 'fraction_numerical': 0.0012084592145015106, 'mean_word_length': 5.053016453382084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6617803', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1250, 'n_words': 252}