<commit_before>include (LibAddMacros)
if (DEPENDENCY_PHASE)
	if (APPLE)
		execute_process (COMMAND "/usr/libexec/java_home" OUTPUT_VARIABLE JAVA_HOME)
		string (STRIP ${JAVA_HOME} JAVA_HOME)
	endif ()

	find_package (JNI)

	if (JNI_FOUND)
		include (CheckSymbolExists)
		set (DIRS
			${JNI_INCLUDE_DIRS}
			${JAVA_INCLUDE_PATH}
			${JAVA_INCLUDE_PATH2}
			${JAVA_AWT_INCLUDE_PATH}
		    )
		set (LIBS
			${JAVA_MAWT_LIBRARY}
			${JNI_LIBRARIES}
			${JAVA_AWT_LIBRARY}
			${JAVA_JVM_LIBRARY}
		    )
		# for check_symbol_exists
		set (CMAKE_REQUIRED_INCLUDES
			${DIRS}
		    )
		check_symbol_exists (JNI_VERSION_1_8 jni.h JNI_CORRECT_VERSION)
		unset (CMAKE_REQUIRED_INCLUDES)

		if (NOT JNI_CORRECT_VERSION)
			remove_plugin (jni "jni.h does not define JNI_VERSION_1_8")
		endif ()
	else ()
		remove_plugin (jni "jni not found")
	endif ()
endif ()

add_plugin(jni
	SOURCES
		jni.c
	INCLUDE_DIRECTORIES
		${DIRS}
	LINK_LIBRARIES
		${LIBS}
	)

if (ADDTESTING_PHASE)
	list (FIND BINDINGS "jna" FINDEX)
	find_program (MAVEN_EXECUTABLE mvn)

	if (ENABLE_BROKEN_TESTS AND BUILD_TESTING AND FINDEX GREATER -1 AND MAVEN_EXECUTABLE)
		add_plugintest(jni MEMLEAK)
		include_directories (${CMAKE_CURRENT_BINARY_DIR})

		# Generate header file
		set (LIBELEKTRA4J_PATH ${CMAKE_BINARY_DIR}/src/bindings/jna/libelektra4j)
		add_custom_command (
			COMMAND ${MAVEN_EXECUTABLE} ARGS dependency:build-classpath -q -Dmdep.outputFile=classpath.txt
			COMMAND ${CMAKE_COMMAND} ARGS
				-D SOURCE_PATH=${CMAKE_CURRENT_SOURCE_DIR}
				-D DESTINATION_PATH=${CMAKE_CURRENT_BINARY_DIR}
				-D LIBELEKTRA4J_PATH=${LIBELEKTRA4J_PATH}
				-D KDB_VERSION=${KDB_VERSION}
				-P ${CMAKE_SOURCE_DIR}/cmake/ElektraClasspath.cmake
			OUTPUT "${LIBELEKTRA4J_PATH}/classpath.txt" "${CMAKE_CURRENT_BINARY_DIR}/testmod_jni.h"
			WORKING_DIRECTORY ${LIBELEKTRA4J_PATH}
			DEPENDS "${LIBELEKTRA4J_PATH}/pom.xml"
		)
		add_custom_target (jni_header DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/testmod_jni.h")
		add_dependencies (testmod_jni jni_header)
	else ()
		message (WARNING "jna bindings are required for testing, test deactivated")
	endif ()
endif ()<commit_msg>jni: avoid warning<commit_after>include (LibAddMacros)
if (DEPENDENCY_PHASE)
	if (APPLE)
		execute_process (COMMAND "/usr/libexec/java_home" OUTPUT_VARIABLE JAVA_HOME)
		string (STRIP ${JAVA_HOME} JAVA_HOME)
	endif ()

	find_package (JNI)

	if (JNI_FOUND)
		include (CheckSymbolExists)
		set (DIRS
			${JNI_INCLUDE_DIRS}
			${JAVA_INCLUDE_PATH}
			${JAVA_INCLUDE_PATH2}
			${JAVA_AWT_INCLUDE_PATH}
		    )
		set (LIBS
			${JAVA_MAWT_LIBRARY}
			${JNI_LIBRARIES}
			${JAVA_AWT_LIBRARY}
			${JAVA_JVM_LIBRARY}
		    )
		# for check_symbol_exists
		set (CMAKE_REQUIRED_INCLUDES
			${DIRS}
		    )
		check_symbol_exists (JNI_VERSION_1_8 jni.h JNI_CORRECT_VERSION)
		unset (CMAKE_REQUIRED_INCLUDES)

		if (NOT JNI_CORRECT_VERSION)
			remove_plugin (jni "jni.h does not define JNI_VERSION_1_8")
		endif ()
	else ()
		remove_plugin (jni "jni not found")
	endif ()
endif ()

add_plugin(jni
	SOURCES
		jni.c
	INCLUDE_DIRECTORIES
		${DIRS}
	LINK_LIBRARIES
		${LIBS}
	)

if (ADDTESTING_PHASE)
	list (FIND BINDINGS "jna" FINDEX)
	find_program (MAVEN_EXECUTABLE mvn)

	if (ENABLE_BROKEN_TESTS)
	if (BUILD_TESTING AND FINDEX GREATER -1 AND MAVEN_EXECUTABLE)
		add_plugintest(jni MEMLEAK)
		include_directories (${CMAKE_CURRENT_BINARY_DIR})

		# Generate header file
		set (LIBELEKTRA4J_PATH ${CMAKE_BINARY_DIR}/src/bindings/jna/libelektra4j)
		add_custom_command (
			COMMAND ${MAVEN_EXECUTABLE} ARGS dependency:build-classpath -q -Dmdep.outputFile=classpath.txt
			COMMAND ${CMAKE_COMMAND} ARGS
				-D SOURCE_PATH=${CMAKE_CURRENT_SOURCE_DIR}
				-D DESTINATION_PATH=${CMAKE_CURRENT_BINARY_DIR}
				-D LIBELEKTRA4J_PATH=${LIBELEKTRA4J_PATH}
				-D KDB_VERSION=${KDB_VERSION}
				-P ${CMAKE_SOURCE_DIR}/cmake/ElektraClasspath.cmake
			OUTPUT "${LIBELEKTRA4J_PATH}/classpath.txt" "${CMAKE_CURRENT_BINARY_DIR}/testmod_jni.h"
			WORKING_DIRECTORY ${LIBELEKTRA4J_PATH}
			DEPENDS "${LIBELEKTRA4J_PATH}/pom.xml"
		)
		add_custom_target (jni_header DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/testmod_jni.h")
		add_dependencies (testmod_jni jni_header)
	else ()
		message (WARNING "jna bindings are required for testing, test deactivated")
	endif ()
	endif (ENABLE_BROKEN_TESTS)
endif ()
{'fraction_non_alphanumeric': 0.10018682858477347, 'fraction_numerical': 0.006071929005137786, 'mean_word_length': 5.092460881934566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2465755', 'n_tokens_mistral': 2019, 'n_tokens_neox': 1758, 'n_words': 300}