blob: 78ce874c7c0e4152c2ad08e3b789bfec2b88e03c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
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 {
.SEM=BUILD_JAR_SEM
}
PROGRAM_AND_TESTS_CP_COLLECTING_NODES_SEM=IGNORED
### @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
.SEM=PROGRAM_AND_TESTS_CP_COLLECTING_NODES_SEM
# 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
.SEM=BUILD_JAR_SEM
.FINAL_TARGET=no
SET(MODULE_TYPE JAVA_PROGRAM)
}
}
BUILD_JUNIT5_JAR_SEM=$BUILD_JAR_SEM && junit5_test
multimodule JUNIT5 {
# ATTENTION ya ide idea relies on this submodule name to find scope of `ya make` build before project generation
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
.SEM=PROGRAM_AND_TESTS_CP_COLLECTING_NODES_SEM
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
.SEM=BUILD_JUNIT5_JAR_SEM
PEERDIR+=devtools/junit5-runner
PEERDIR+=build/platform/java/jacoco-agent
when ($OPENSOURCE != "yes") {
PEERDIR+=devtools/jtest-annotations/junit5
}
SET(MODULE_TYPE JUNIT5)
}
}
BUILD_JUNIT4_JAR_SEM=$BUILD_JAR_SEM && junit4_test
multimodule JTEST {
# ATTENTION ya ide idea relies on this submodule name to find scope of `ya make` build before project generation
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
.SEM=PROGRAM_AND_TESTS_CP_COLLECTING_NODES_SEM
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
.SEM=BUILD_JUNIT4_JAR_SEM
SET(MODULE_TYPE JTEST)
DEPENDS(contrib/java/org/sonarsource/scanner/cli/sonar-scanner-cli/2.8)
PEERDIR+=build/platform/java/jacoco-agent
when ($OPENSOURCE != "yes") {
PEERDIR+=devtools/jtest-annotations/junit4
}
}
}
multimodule JTEST_FOR {
# ATTENTION ya ide idea relies on this submodule name to find scope of `ya make` build before project generation
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
.SEM=PROGRAM_AND_TESTS_CP_COLLECTING_NODES_SEM
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
.SEM=BUILD_JUNIT4_JAR_SEM
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
.SEM=BUILD_JAR_SEM
}
}
_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_SEM} && \
target_include_directories PUBLIC $_C__INCLUDE_GLOBAL && \
target_include_directories PRIVATE $_C__INCLUDE_OWNED && \
target_compile_options PRIVATE $USER_CFLAGS $USER_CXXFLAGS $_SEM_EXTRA_CXX_FLAGS && target_compile_options PUBLIC $USER_CFLAGS_GLOBAL_RAW $USER_CXXFLAGS_GLOBAL_RAW && \
target_link_options PRIVATE $LDFLAGS_GLOBAL_RAW $LDFLAGS $OBJADDE_LIB $OBJADDE && \
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}
}
}
|