aboutsummaryrefslogtreecommitdiffstats
path: root/build/conf
diff options
context:
space:
mode:
authordimdim11 <dimdim11@yandex-team.com>2023-11-15 05:58:47 +0300
committerdimdim11 <dimdim11@yandex-team.com>2023-11-15 06:32:24 +0300
commitffd9cf091c04dec2930091cd731d6c47b0286cd9 (patch)
treef0427e7ebb25f04a93663d65d5e21df6520897b7 /build/conf
parent9c491f76b3f0f697b0ca527dabd623106f3c8373 (diff)
downloadydb-ffd9cf091c04dec2930091cd731d6c47b0286cd9.tar.gz
Default JAVA_SRCS
Diffstat (limited to 'build/conf')
-rw-r--r--build/conf/java.conf25
1 files changed, 17 insertions, 8 deletions
diff --git a/build/conf/java.conf b/build/conf/java.conf
index ccd8fa84e0..dd2fec9512 100644
--- a/build/conf/java.conf
+++ b/build/conf/java.conf
@@ -266,8 +266,8 @@ LINK_JAR_RESOURCES=
LINK_JAR_JSOURCES=
JAR_GEN_SRCS=
JAR_GEN_JSRCS=
-macro _JAR_SRCS(SRCDIR=".", PACKAGE_PREFIX="", EXCLUDE[], FILES[], RESOURCES?"yes":"no", Globs...) {
- _CHECK_JAVA_SRCDIR($SRCDIR)
+macro _JAVA_SRCS(SRCDIR=".", PACKAGE_PREFIX="", EXCLUDE[], FILES[], RESOURCES?"yes":"no", SKIP_CHECK_SRCDIR?"SKIP_CHECK_SRCDIR":"", Globs...) {
+ _CHECK_JAVA_SRCDIR($SKIP_CHECK_SRCDIR $SRCDIR)
SET_APPEND(ALL_SRCDIRS $SRCDIR)
SET(VAR_SALT $SRCDIR $Globs $EXCLUDE $PACKAGE_PREFIX $RESOURCES $FILES)
SET(JAR_SRCS_GLOB uniq_${hash:VAR_SALT})
@@ -278,13 +278,21 @@ macro _JAR_SRCS(SRCDIR=".", PACKAGE_PREFIX="", EXCLUDE[], FILES[], RESOURCES?"ye
_FILL_JAR_COPY_RESOURCES_CMD(LINK_JAR_JSOURCES ${quo:SRCDIR} ${BINDIR}/src ${PACKAGE_PREFIX} ${BINDIR}/misc/${tolower:JAR_SRCS_GLOB}.src.txt)
_FILL_JAR_GEN_SRCS(JAR_GEN_SRCS JAR $SRCDIR ${BINDIR}/cls ${BINDIR}/all-java.srclst $KT_SRCLIST ${BINDIR}/misc/all-gr-sources.txt ${BINDIR}/misc/${tolower:JAR_SRCS_GLOB}.res.txt $Globs EXCLUDE $EXCLUDE)
_FILL_JAR_GEN_SRCS(JAR_GEN_JSRCS SRC_JAR $SRCDIR ${BINDIR}/cls ${BINDIR}/all-java.srclst $KT_SRCLIST ${BINDIR}/misc/all-gr-sources.txt ${BINDIR}/misc/${tolower:JAR_SRCS_GLOB}.src.txt $Globs EXCLUDE $EXCLUDE)
-}
-macro IDEA_JAR_SRCS(Args...) {
- _JAR_SRCS($Args)
SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM $Args)
}
+# tag:java-specific
+### @usage: DEFAULT_JAVA_SRCS_LAYOUT()
+###
+### DEFAULT_JAVA_SRCS_LAYOUT() declare all source files can be find at maven/gradle standard path src/main/java **/*.java
+### and all resources an be find at maven/gradle standard path src/main/resources **/*
+macro DEFAULT_JAVA_SRCS_LAYOUT() {
+ # Maven default source paths, supported by gradle too
+ _JAVA_SRCS(SRCDIR src/main/java **/*.java SKIP_CHECK_SRCDIR)
+ _JAVA_SRCS(SRCDIR src/main/resources **/* RESOURCES SKIP_CHECK_SRCDIR)
+}
+
macro _HASH_HELPER(Args...) {
.CMD=${hash:Args}
.SEM=${hash:Args}
@@ -801,7 +809,7 @@ module JAR_LIBRARY: _COMPILABLE_JAR_BASE {
.CMD=LINK_JAR
.SEM=BUILD_JAR_SEM
.FINAL_TARGET=yes
- .ALIASES=JAVA_SRCS=IDEA_JAR_SRCS ANNOTATION_PROCESSOR=JAR_ANNOTATION_PROCESSOR
+ .ALIASES=ANNOTATION_PROCESSOR=JAR_ANNOTATION_PROCESSOR
.RESTRICTED=EXTERNAL_JAR
.GLOBAL=MAVEN_EXPORT_COORDS EXPORT_GRADLE_PROJECT_COORDS
MODULE_SUFFIX=.jar
@@ -1578,7 +1586,7 @@ JAVA_SRCS_VALUE=
###
### Specify java source files and resources. A macro can be contained in any of four java modules.
### Keywords:
-### 1. X SRCDIR - specify the directory x is performed relatively to search the source code for these patterns. If there is no SRCDIR, the source will be searched relative to the module directory.
+### 1. SRCDIR x - specify the directory x is performed relatively to search the source code for these patterns. If there is no SRCDIR, the source will be searched relative to the module directory.
### 2. PACKAGE_PREFIX x - use if source paths relative to the SRCDIR does not coincide with the full class names. For example, if all sources of module are in the same package, you can create a directory package/name , and just put the source code in the SRCDIR and specify PACKAGE_PREFIX package.name.
###
### @example:
@@ -1599,7 +1607,8 @@ JAVA_SRCS_VALUE=
###
### Documentation: https://wiki.yandex-team.ru/yatool/java/#javasrcs
macro JAVA_SRCS(Args...) {
- SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM $Args)
+ # TODO Add $Args to semantic jar_source_set
+ _JAVA_SRCS($Args)
}
# tag:java-specific