123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- YMAKE_JAVA_MODULES=yes
- JBUILD_JAVA_MODULES=no
- macro _INPUT_WITH_FLAG(Flag, IN[]) {
- .CMD=$_INPUT_WITH_FLAG_IMPL(${pre=$Flag :IN} IN $IN)
- }
- macro _INPUT_WITH_FLAG_IMPL(IN{input}[], Args...) {
- .CMD=$Args ${input;hide:IN}
- }
- macro ACCELEO(XSD{input}[], MTL{input}[], MTL_ROOT="${MODDIR}", LANG{input}[], OUT{output}[], OUT_NOAUTO{output}[], OUTPUT_INCLUDES[], DEBUG?"stdout2stderr":"stderr2stdout") {
- .PEERDIR=build/platform/java/jdk $JDK_RESOURCE_PEERDIR
- .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input;pre=build/scripts/:DEBUG.py} $JDK_RESOURCE/bin/java -Dfile.encoding=utf8 -classpath ${RUN_JAR_PROG_CP_PRE}${tool:"tools/acceleo"}${RUN_JAR_PROG_CP_SUF} ru.yandex.se.logsng.tool.Cli $_INPUT_WITH_FLAG(--xsd IN $XSD) $_INPUT_WITH_FLAG(--mtl IN $MTL) $_INPUT_WITH_FLAG(--lang IN $LANG) --output-dir $BINDIR --build-root ${ARCADIA_BUILD_ROOT} --source-root ${ARCADIA_ROOT} --mtl-root $MTL_ROOT ${output_include;hide:OUTPUT_INCLUDES} ${output;hide:OUT} ${output;noauto;hide:OUT_NOAUTO} ${kv;hide:"p JV"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"}
- }
- ### @usage: JAVA_LIBRARY()
- ###
- ### The module describing java library build.
- ###
- ### Documentation: https://wiki.yandex-team.ru/yatool/java/
- module JAVA_LIBRARY: JAR_LIBRARY {
- }
- ### @usage: JAVA_PROGRAM()
- ###
- ### The module describing java programs build.
- ### Output artifacts: .jar and directory with all the jar to the classpath of the formation.
- ###
- ### Documentation: https://wiki.yandex-team.ru/yatool/java/
- multimodule JAVA_PROGRAM {
- module JAR_RUNNABLE: _JAR_RUNNABLE {
- .ALLOWED=JAVA_RUNTIME_PEERDIR JAVA_RUNTIME_EXCLUDE
- # TODO(svidyuk) JAVA_DEPENDENCIES_CONFIGURATION must not be ignored here but there are diagnostics issues in case of ECLUDE in the middle:
- # * A -> B -> C -> lib-v1.4
- # | |-> DM(lib-v1.1)
- # | |-> EXCLUDE(lib-v1.4)
- # | |-> FORBID_CONFLICT_DM_RECENT = OK
- # |-> DM(lib-v1.1)
- # |-> FORBID_CONFLICT_DM_RECENT = FAIL (because downgrade from v1.4 to v1.1 is detected before understanding that v1.4 was excuded on the examined path)
- .IGNORED=RUN_JAVA_PROGRAM JAVA_DEPENDENCIES_CONFIGURATION PROVIDES
- .ALIASES=JAVA_RUNTIME_PEERDIR=PEERDIR JAVA_RUNTIME_EXCLUDE=EXCLUDE
- .PEERDIRSELF=JAR_COMPILATION
- SET(MODULE_TYPE JAVA_PROGRAM)
- }
- module JAR_COMPILATION: JAR_LIBRARY {
- .IGNORED=JAVA_RUNTIME_PEERDIR JAVA_RUNTIME_EXCLUDE
- .ALIASES=JAVA_RUNTIME_PEERDIR=_NOOP_MACRO JAVA_RUNTIME_EXCLUDE=_NOOP_MACRO
- .FINAL_TARGET=no
- SET(MODULE_TYPE JAVA_PROGRAM)
- }
- }
- multimodule JUNIT5 {
- module JAR_TESTABLE: _JAR_TEST {
- .ALLOWED=YT_SPEC
- # TODO(svidyuk) JAVA_DEPENDENCIES_CONFIGURATION must not be ignored here but there are diagnostics issues in case of ECLUDE in the middle:
- # * A -> B -> C -> lib-v1.4
- # | |-> DM(lib-v1.1)
- # | |-> EXCLUDE(lib-v1.4)
- # | |-> FORBID_CONFLICT_DM_RECENT = OK
- # |-> DM(lib-v1.1)
- # |-> FORBID_CONFLICT_DM_RECENT = FAIL (because downgrade from v1.4 to v1.1 is detected before understanding that v1.4 was excuded on the examined path)
- .IGNORED=JAVA_SRCS RUN_JAVA_PROGRAM JAVA_DEPENDENCIES_CONFIGURATION
- .ALIASES=JAVA_TEST_PEERDIR=PEERDIR JAVA_TEST_EXCLUDE=EXCLUDE
- .PEERDIRSELF=JAR_COMPILATION
- PEERDIR(devtools/jtest-annotations/junit5)
- SET(MODULE_TYPE JUNIT5)
- }
- module JAR_COMPILATION: JAR_LIBRARY {
- .ALLOWED=YT_SPEC
- .ALIASES=JAVA_TEST_PEERDIR=_NOOP_MACRO JAVA_TEST_EXCLUDE=_NOOP_MACRO
- .FINAL_TARGET=no
- .DEFAULT_NAME_GENERATOR=FullPath
- PEERDIR(devtools/junit5-runner devtools/jtest-annotations/junit5 build/platform/java/jacoco-agent)
- SET(MODULE_TYPE JUNIT5)
- }
- }
- multimodule JTEST {
- module JAR_TESTABLE: _JAR_TEST {
- .ALLOWED=YT_SPEC
- # TODO(svidyuk) JAVA_DEPENDENCIES_CONFIGURATION must not be ignored here but there are diagnostics issues in case of ECLUDE in the middle:
- # * A -> B -> C -> lib-v1.4
- # | |-> DM(lib-v1.1)
- # | |-> EXCLUDE(lib-v1.4)
- # | |-> FORBID_CONFLICT_DM_RECENT = OK
- # |-> DM(lib-v1.1)
- # |-> FORBID_CONFLICT_DM_RECENT = FAIL (because downgrade from v1.4 to v1.1 is detected before understanding that v1.4 was excuded on the examined path)
- .IGNORED=JAVA_SRCS RUN_JAVA_PROGRAM JAVA_DEPENDENCIES_CONFIGURATION
- .ALIASES=JAVA_TEST_PEERDIR=PEERDIR JAVA_TEST_EXCLUDE=EXCLUDE
- .PEERDIRSELF=JAR_COMPILATION
- SET(MODULE_TYPE JTEST)
- PEERDIR(devtools/junit-runner devtools/jtest-annotations/junit4)
- DEPENDENCY_MANAGEMENT(contrib/java/com/google/code/gson/gson/2.8.6 contrib/java/com/beust/jcommander/1.72 contrib/java/junit/junit/4.12)
- }
- module JAR_COMPILATION: JAR_LIBRARY {
- .ALLOWED=YT_SPEC
- .ALIASES=JAVA_TEST_PEERDIR=_NOOP_MACRO JAVA_TEST_EXCLUDE=_NOOP_MACRO
- .FINAL_TARGET=no
- .DEFAULT_NAME_GENERATOR=FullPath
- SET(MODULE_TYPE JTEST)
- DEPENDS(contrib/java/org/sonarsource/scanner/cli/sonar-scanner-cli/2.8)
- PEERDIR(build/platform/java/jacoco-agent devtools/jtest-annotations/junit4)
- }
- }
- multimodule JTEST_FOR {
- module JAR_TESTABLE: _JAR_TEST {
- .ALLOWED=YT_SPEC
- # TODO(svidyuk) JAVA_DEPENDENCIES_CONFIGURATION must not be ignored here but there are diagnostics issues in case of ECLUDE in the middle:
- # * A -> B -> C -> lib-v1.4
- # | |-> DM(lib-v1.1)
- # | |-> EXCLUDE(lib-v1.4)
- # | |-> FORBID_CONFLICT_DM_RECENT = OK
- # |-> DM(lib-v1.1)
- # |-> FORBID_CONFLICT_DM_RECENT = FAIL (because downgrade from v1.4 to v1.1 is detected before understanding that v1.4 was excuded on the examined path)
- .IGNORED=JAVA_SRCS RUN_JAVA_PROGRAM JAVA_DEPENDENCIES_CONFIGURATION
- .ALIASES=JAVA_TEST_PEERDIR=PEERDIR JAVA_TEST_EXCLUDE=EXCLUDE
- .PEERDIRSELF=JAR_COMPILATION
- SET(MODULE_TYPE JTEST_FOR)
- PEERDIR(${UNITTEST_DIR} devtools/junit-runner)
- DEPENDENCY_MANAGEMENT(contrib/java/com/google/code/gson/gson/2.8.6 contrib/java/com/beust/jcommander/1.72 contrib/java/junit/junit/4.12)
- }
- module JAR_COMPILATION: JAR_LIBRARY {
- .ALLOWED=YT_SPEC
- .ALIASES=JAVA_TEST_PEERDIR=_NOOP_MACRO JAVA_TEST_EXCLUDE=_NOOP_MACRO
- .FINAL_TARGET=no
- .DEFAULT_NAME_GENERATOR=FullPath
- SET(MODULE_TYPE JTEST_FOR)
- DEPENDS(contrib/java/org/sonarsource/scanner/cli/sonar-scanner-cli/2.8)
- PEERDIR(devtools/junit-runner build/platform/java/jacoco-agent ${UNITTEST_DIR})
- }
- }
- multimodule JAVA_CONTRIB_PROGRAM {
- module JAR_RUNNABLE: _JAR_RUNNABLE {
- .IGNORED=JAVA_SRCS RUN_JAR_PROGRAM RUN_JAVA_PROGRAM JAR_RESOURCE SRC_RESOURCE LOCAL_JAR
- .PEERDIRSELF=JAR_COMPILATION
- SET(MODULE_TYPE JAVA_PROGRAM)
- ENABLE(DISABLE_SCRIPTGEN)
- }
- module JAR_COMPILATION: JAVA_CONTRIB {
- .ALIASES=JAVA_RUNTIME_PEERDIR=_NOOP_MACRO JAVA_RUNTIME_EXCLUDE=_NOOP_MACRO
- .FINAL_TARGET=no
- }
- }
- _EXPLICIT_SWIG_JAVA_SOURCES=
- _EXPLICIT_SWIG_IFACE_SOURCES=
- macro _EXPORT_JAVA_BINDINGS(JavaSrcs...) {
- SET_APPEND(_EXPLICIT_SWIG_JAVA_SOURCES ${input:JavaSrcs})
- .SEM=find_package SWIG COMPONENTS java && find_package Java && find_package JNI && include UseSWIG && include UseJava ${input;hide:JavaSrcs} ${output;hide;pre=$_HASH_HELPER($Args):".o"}
- }
- macro _EXPORT_SWIG_SOURCES(SwigSrcs...) {
- SET_APPEND(_EXPLICIT_SWIG_IFACE_SOURCES ${input:SwigSrcs})
- }
- macro _JNI_CPP_SWIG_SRCS(Srcs...) {
- SRCS(${ext=.cpp:Srcs} ${ext=.swg:Srcs})
- _EXPORT_JAVA_BINDINGS(${ext=.java:Srcs})
- _EXPORT_SWIG_SOURCES(${ext=.swg:Srcs})
- }
- macro _JNI_JAVA_SWIG_SRCS(Srcs...) {
- SRCS(${ext=.java:Srcs} ${ext=.swg:Srcs})
- }
- SWIG_JNI_BINDINGS_SEM= \
- add_swig_jni_library ${MODDIR} ${REALPRJNAME}-cpp GEN_JAVA_FILES_LIST ${"$"}{CMAKE_CURRENT_BINARY_DIR}/swig_gen_java.lst SOURCES ${_EXPLICIT_SWIG_IFACE_SOURCES} && \
- set_target_property OUTPUT_NAME $REALPRJNAME && \
- vcs_info && \
- add_jar ${REALPRJNAME} SOURCES $_EXPLICIT_SWIG_JAVA_SOURCES @${"$"}{CMAKE_CURRENT_BINARY_DIR}/swig_gen_java.lst ${hide:TARGET}
- ### @usage: DLL_JAVA()
- ###
- ### DLL built using swig for Java. Produces dynamic library and a .jar.
- ### Dynamic library is treated the same as in the case of PEERDIR from Java to DLL.
- ### .jar goes on the classpath.
- ###
- ### Documentation: https://wiki.yandex-team.ru/yatool/java/#integracijascpp/pythonsborkojj
- multimodule DLL_JAVA {
- module JNI_DLL: DLL {
- .ALIASES=SRCS=_JNI_CPP_SWIG_SRCS
- .FINAL_TARGET=no
- .SEM=SWIG_JNI_BINDINGS_SEM
- SWIG_LANG=jni_cpp
- }
- module JAR_COMPILATION: EXTERNAL_JAVA_LIBRARY {
- .ARGS_PARSER=DLL
- .ALIASES=SRCS=_JNI_JAVA_SWIG_SRCS PEERDIR=_NOOP_MACRO
- .PEERDIRSELF=JNI_DLL
- PEERDIR+=build/platform/java/jdk
- PEERDIR+=$JDK_RESOURCE_PEERDIR
- SET(DONT_RESOLVE_INCLUDES yes)
- .FINAL_TARGET=yes
- SWIG_LANG=jni_java
- _SWIG_CMD=$_SWIG_JNI_JAVA_CMD
- _SWIG_ADDINCLS=$_SWIG_JNI_ADDINCLS
- _SWIG_PEERDIR=$_SWIG_JNI_PEERDIR
- _SWIG_SEM_TO_MODULE_LINK=${output;hide;suf=.jsrc:SRC}
- }
- }
|