jbuild.ymake.conf 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. PEERDIR(devtools/jtest-annotations/junit5)
  44. # Used as place to add managed dependencies for test execution and take them into account
  45. # during traverses properly.
  46. _RUN_JAVA(TOOL ${TEST_RUNNER} OUT fake.out.java_test_cmd)
  47. PEERDIR(${TEST_RUNNER})
  48. PEERDIR(build/platform/java/jacoco-agent)
  49. JAVA_TEST()
  50. }
  51. ### @usage: JTEST()
  52. ###
  53. ### Java tests module based on JUnit 4 framework.
  54. ###
  55. ### If requested, build system will scan the source code of the module for the presence of junit tests and run them.
  56. ### Output artifacts: a jar, a directory of exhaust tests(if required run the tests) - test logs, system logs testiranja, temporary files, tests, etc.
  57. ###
  58. ### Documentation: https://wiki.yandex-team.ru/yatool/test/#testynajava
  59. module JTEST: _JAVA_PLACEHOLDER {
  60. .ALLOWED=YT_SPEC
  61. .ALIASES=JAVA_TEST_PEERDIR=PEERDIR JAVA_TEST_EXCLUDE=EXCLUDE
  62. SET(MODULE_TYPE JTEST)
  63. SET(TEST_RUNNER devtools/junit-runner)
  64. SET(TEST_CLASSPATH_VALUE ${MODDIR} ${TEST_RUNNER})
  65. # Used as place to add managed dependencies for test execution and take them into account
  66. # during traverses properly.
  67. _RUN_JAVA(TOOL ${TEST_RUNNER} OUT fake.out.java_test_cmd)
  68. PEERDIR(devtools/jtest-annotations/junit4)
  69. # TODO: if <needs_sonar>
  70. DEPENDS(contrib/java/org/sonarsource/scanner/cli/sonar-scanner-cli/2.8)
  71. DEPENDS(${TEST_RUNNER})
  72. _GHOST_PEERDIR(${TEST_RUNNER})
  73. PEERDIR(build/platform/java/jacoco-agent)
  74. JAVA_TEST()
  75. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json)
  76. }
  77. ### @usage: JTEST_FOR(ModuleDir)
  78. ###
  79. ### Convinience java tests module based on JUnit 4 framework for specified library or program.
  80. ###
  81. ### 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.
  82. ### Output artifacts: a jar, a directory of exhaust tests(if requested tests are run).
  83. ###
  84. ### Documentation: https://wiki.yandex-team.ru/yatool/test/#testynajava
  85. module JTEST_FOR: JTEST {
  86. .ALIASES=JAVA_TEST_PEERDIR=PEERDIR JAVA_TEST_EXCLUDE=EXCLUDE
  87. SET(MODULE_TYPE JTEST_FOR)
  88. SET(TEST_CLASSPATH_VALUE ${MODDIR} ${TEST_RUNNER} ${UNITTEST_DIR})
  89. PEERDIR(devtools/jtest-annotations/junit4 $UNITTEST_DIR)
  90. SET(REALPRJNAME jtest)
  91. JAVA_TEST()
  92. }
  93. module JAVA_CONTRIB_PROGRAM: JAVA_CONTRIB {
  94. SET(MODULE_TYPE JAVA_PROGRAM)
  95. ENABLE(DISABLE_SCRIPTGEN)
  96. }
  97. ### @usage: DLL_JAVA()
  98. ###
  99. ### DLL built using swig for Java. Produces dynamic library and a .jar.
  100. ### Dynamic library is treated the same as in the case of PEERDIR from Java to DLL.
  101. ### .jar goes on the classpath.
  102. ###
  103. ### Documentation: https://wiki.yandex-team.ru/yatool/java/#integracijascpp/pythonsborkojj
  104. module DLL_JAVA: DLL {
  105. .EXTS=.o .obj .jsrc .java .mf
  106. .CMD=SWIG_DLL_JAR_CMD
  107. PEERDIR(build/platform/java/jdk)
  108. PEERDIR+=$JDK_RESOURCE_PEERDIR
  109. SWIG_LANG=java
  110. }