summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/conf/java.conf31
-rw-r--r--build/plugins/java.py2
2 files changed, 27 insertions, 6 deletions
diff --git a/build/conf/java.conf b/build/conf/java.conf
index ccd8fa84e0c..53fa44a2a6f 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})
@@ -280,11 +280,27 @@ macro _JAR_SRCS(SRCDIR=".", PACKAGE_PREFIX="", EXCLUDE[], FILES[], RESOURCES?"ye
_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)
+macro IDEA_JAVA_SRCS(Args...) {
+ _JAVA_SRCS($Args)
+ # Fill JAVA_SRCS_VALUE for ya ide idea
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)
+ # Fill JAVA_SRCS_VALUE for ya ide idea
+ SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM SRCDIR src/main/java **/*.java)
+ _JAVA_SRCS(SRCDIR src/main/resources **/* RESOURCES SKIP_CHECK_SRCDIR)
+ # Fill JAVA_SRCS_VALUE for ya ide idea
+ SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM SRCDIR src/main/resources **/* RESOURCES)
+}
+
macro _HASH_HELPER(Args...) {
.CMD=${hash:Args}
.SEM=${hash:Args}
@@ -801,7 +817,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=JAVA_SRCS=IDEA_JAVA_SRCS ANNOTATION_PROCESSOR=JAR_ANNOTATION_PROCESSOR
.RESTRICTED=EXTERNAL_JAR
.GLOBAL=MAVEN_EXPORT_COORDS EXPORT_GRADLE_PROJECT_COORDS
MODULE_SUFFIX=.jar
@@ -1578,7 +1594,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,6 +1615,9 @@ JAVA_SRCS_VALUE=
###
### Documentation: https://wiki.yandex-team.ru/yatool/java/#javasrcs
macro JAVA_SRCS(Args...) {
+ # TODO Add $Args to semantic jar_source_set
+ # TODO Call _JAVA_SRCS($Args)
+ # Fill JAVA_SRCS_VALUE for ya ide idea
SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM $Args)
}
diff --git a/build/plugins/java.py b/build/plugins/java.py
index 31cc8917254..f8db7fb0381 100644
--- a/build/plugins/java.py
+++ b/build/plugins/java.py
@@ -285,6 +285,8 @@ def onexternal_jar(unit, *args):
def on_check_java_srcdir(unit, *args):
args = list(args)
+ if 'SKIP_CHECK_SRCDIR' in args:
+ return
for arg in args:
if not '$' in arg:
arc_srcdir = os.path.join(unit.get('MODDIR'), arg)