jbuild.ymake.conf 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. YMAKE_JAVA_MODULES=no
  2. JBUILD_JAVA_MODULES=yes
  3. EXTERNAL_JAR_VALUE=
  4. ### @usage: EXTERNAL_JAR(library.jar)
  5. ###
  6. ### Provide an external name for built JAVA_LIBRARY() or JAVA_PROGRAM()
  7. ###
  8. ### Documentation: https://wiki.yandex-team.ru/yatool/java/#ispolzovanievneshnixmavenbibliotek
  9. macro EXTERNAL_JAR(Args...) {
  10. SET_APPEND(EXTERNAL_JAR_VALUE $ARGS_DELIM $Args)
  11. }
  12. ### @usage: JAVA_LIBRARY()
  13. ###
  14. ### The module describing java library build.
  15. ###
  16. ### Documentation: https://wiki.yandex-team.ru/yatool/java/
  17. module JAVA_LIBRARY: _JAVA_PLACEHOLDER {
  18. SET(MODULE_TYPE JAVA_LIBRARY)
  19. }
  20. ### @usage: JAVA_PROGRAM()
  21. ###
  22. ### The module describing java programs build.
  23. ### Output artifacts: .jar and directory with all the jar to the classpath of the formation.
  24. ###
  25. ### Documentation: https://wiki.yandex-team.ru/yatool/java/
  26. module JAVA_PROGRAM: _JAVA_PLACEHOLDER {
  27. .ALIASES=JAVA_RUNTIME_PEERDIR=PEERDIR JAVA_RUNTIME_EXCLUDE=EXCLUDE
  28. SET(MODULE_TYPE JAVA_PROGRAM)
  29. }
  30. ### @usage: JUNIT5()
  31. ###
  32. ### Java tests module based on JUnit 5 framework.
  33. ###
  34. ### If requested, build system will scan the source code of the module for the presence of junit tests and run them.
  35. ### Output artifacts: a jar, a directory of exhaust tests(if required run the tests) - test logs, system logs testiranja, temporary files, tests, etc.
  36. ###
  37. ### Documentation: https://wiki.yandex-team.ru/yatool/test/#testynajava
  38. module JUNIT5: _JAVA_PLACEHOLDER {
  39. .ALIASES=JAVA_TEST_PEERDIR=PEERDIR JAVA_TEST_EXCLUDE=EXCLUDE
  40. SET(MODULE_TYPE JUNIT5)
  41. SET(TEST_RUNNER devtools/junit5-runner)
  42. SET(TEST_CLASSPATH_VALUE ${MODDIR} ${TEST_RUNNER})
  43. # Used as place to add managed dependencies for test execution and take them into account
  44. # during traverses properly.
  45. _RUN_JAVA(TOOL ${TEST_RUNNER} OUT fake.out.java_test_cmd)
  46. PEERDIR(${TEST_RUNNER})
  47. PEERDIR(build/platform/java/jacoco-agent)
  48. JAVA_TEST()
  49. }
  50. ### @usage: JTEST()
  51. ###
  52. ### Java tests module based on JUnit 4 framework.
  53. ###
  54. ### If requested, build system will scan the source code of the module for the presence of junit tests and run them.
  55. ### Output artifacts: a jar, a directory of exhaust tests(if required run the tests) - test logs, system logs testiranja, temporary files, tests, etc.
  56. ###
  57. ### Documentation: https://wiki.yandex-team.ru/yatool/test/#testynajava
  58. module JTEST: _JAVA_PLACEHOLDER {
  59. .ALLOWED=YT_SPEC
  60. .ALIASES=JAVA_TEST_PEERDIR=PEERDIR JAVA_TEST_EXCLUDE=EXCLUDE
  61. SET(MODULE_TYPE JTEST)
  62. SET(TEST_RUNNER devtools/junit-runner)
  63. SET(TEST_CLASSPATH_VALUE ${MODDIR} ${TEST_RUNNER})
  64. # Used as place to add managed dependencies for test execution and take them into account
  65. # during traverses properly.
  66. _RUN_JAVA(TOOL ${TEST_RUNNER} OUT fake.out.java_test_cmd)
  67. # TODO: if <needs_sonar>
  68. DEPENDS(contrib/java/org/sonarsource/scanner/cli/sonar-scanner-cli/2.8)
  69. DEPENDS(${TEST_RUNNER})
  70. _GHOST_PEERDIR(${TEST_RUNNER})
  71. PEERDIR(build/platform/java/jacoco-agent)
  72. JAVA_TEST()
  73. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json)
  74. }
  75. ### @usage: JTEST_FOR(ModuleDir)
  76. ###
  77. ### Convinience java tests module based on JUnit 4 framework for specified library or program.
  78. ###
  79. ### In contrast to the JTEST, the build system will scan for the presence of the test sources of the module in ModuleDir . As ModuleDir should contain JAVA_PROGRAM or JAVA_LIBRARY . JTEST_FOR also can have its own source, in this case they will be compiled and added to the classpath of a test run.
  80. ### Output artifacts: a jar, a directory of exhaust tests(if requested tests are run).
  81. ###
  82. ### Documentation: https://wiki.yandex-team.ru/yatool/test/#testynajava
  83. module JTEST_FOR: JTEST {
  84. .ALIASES=JAVA_TEST_PEERDIR=PEERDIR JAVA_TEST_EXCLUDE=EXCLUDE
  85. SET(MODULE_TYPE JTEST_FOR)
  86. SET(TEST_CLASSPATH_VALUE ${MODDIR} ${TEST_RUNNER} ${UNITTEST_DIR})
  87. PEERDIR($UNITTEST_DIR)
  88. SET(REALPRJNAME jtest)
  89. JAVA_TEST()
  90. }
  91. module JAVA_CONTRIB_PROGRAM: JAVA_CONTRIB {
  92. SET(MODULE_TYPE JAVA_PROGRAM)
  93. ENABLE(DISABLE_SCRIPTGEN)
  94. }
  95. ### @usage: DLL_JAVA()
  96. ###
  97. ### DLL built using swig for Java. Produces dynamic library and a .jar.
  98. ### Dynamic library is treated the same as in the case of PEERDIR from Java to DLL.
  99. ### .jar goes on the classpath.
  100. ###
  101. ### Documentation: https://wiki.yandex-team.ru/yatool/java/#integracijascpp/pythonsborkojj
  102. module DLL_JAVA: DLL {
  103. .EXTS=.o .obj .jsrc .java .mf
  104. .CMD=SWIG_DLL_JAR_CMD
  105. PEERDIR(build/platform/java/jdk)
  106. PEERDIR+=$JDK_RESOURCE_PEERDIR
  107. PROPAGATES_MANAGEABLE_PEERS=yes
  108. SET(SWIG_LANG java)
  109. }