aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authormiroslav2 <miroslav2@yandex-team.com>2024-06-14 08:46:38 +0300
committermiroslav2 <miroslav2@yandex-team.com>2024-06-14 08:58:39 +0300
commit6ec46165a7daf1f0881c460fa2d83166b8e363b6 (patch)
tree3866be2677820b33bfcc8b3ab74f3da9c2b2eb92 /build
parentf89ac54b9ed5e1902b662ef1373da3d521a9f126 (diff)
downloadydb-6ec46165a7daf1f0881c460fa2d83166b8e363b6.tar.gz
Fix uberjar shading, support LDC processing with new option 'shade-include'
ea8c2557a731ea114340ae4c559ccef2f45706f3
Diffstat (limited to 'build')
-rw-r--r--build/conf/java.conf32
1 files changed, 24 insertions, 8 deletions
diff --git a/build/conf/java.conf b/build/conf/java.conf
index 6cf0f9f96e..02af52c6b5 100644
--- a/build/conf/java.conf
+++ b/build/conf/java.conf
@@ -676,7 +676,7 @@ _MAKE_JSTYLE_FILE_LIST=
# tag:java-specific
_LINK_UBERJAR=
_UBERJAR_SELF=
-_DO_LINK_UBERJAR= && $JDK_RESOURCE/bin/java -cp $UBERJAR_RESOURCE/devtools-java_shader.jar ru.yandex.devtools.emigrante.Main --out-jar $TARGET $_UBERJAR_SELF ${ext=.jar;pre=--jar :MANAGED_PEERS_CLOSURE} ${UBERJAR_PREFIX_FLAG} ${UBERJAR_HIDE_EXCLUDE_FLAGS} $UBERJAR_PATH_EXCLUDES ${UBERJAR_MANIFEST_TRANSFORMER_MAIN_FLAG} ${UBERJAR_MANIFEST_TRANSFORMER_ATTRIBUTE_FLAGS} ${UBERJAR_APPENDING_TRANSFORMER_FLAGS} ${UBERJAR_SERVICES_RESOURCE_TRANSFORMER_FLAG} \
+_DO_LINK_UBERJAR= && $JDK_RESOURCE/bin/java -cp $UBERJAR_RESOURCE/devtools-java_shader.jar ru.yandex.devtools.emigrante.Main --out-jar $TARGET $_UBERJAR_SELF ${ext=.jar;pre=--jar :MANAGED_PEERS_CLOSURE} ${UBERJAR_PREFIX_FLAG} ${UBERJAR_HIDE_EXCLUDE_FLAGS} ${UBERJAR_HIDE_INCLUDE_FLAGS} $UBERJAR_PATH_EXCLUDES ${UBERJAR_MANIFEST_TRANSFORMER_MAIN_FLAG} ${UBERJAR_MANIFEST_TRANSFORMER_ATTRIBUTE_FLAGS} ${UBERJAR_APPENDING_TRANSFORMER_FLAGS} ${UBERJAR_SERVICES_RESOURCE_TRANSFORMER_FLAG} \
&& $YMAKE_PYTHON ${input:"build/scripts/mkdir.py"} $BINDIR/_empty/META-INF \
&& $YMAKE_PYTHON ${input:"build/scripts/touch.py"} $BINDIR/_empty/META-INF/MANIFEST.MF \
&& $UPDATE_VCS_JAVA_INFO_NODEP($TARGET) \
@@ -1442,16 +1442,17 @@ MAKE_UBERJAR_VALUE=
###
### You can use the following macros to configure the archive:
### 1. UBERJAR_HIDING_PREFIX prefix for classes to shade (classes remain in their packages by default)
-### 2. UBERJAR_HIDE_EXCLUDE_PATTERN exclude classes matching this patterns from shading (if enabled).
-### 3. UBERJAR_PATH_EXCLUDE_PREFIX the prefix for classes that should not get into the jar archive (all classes are placed into the archive by default)
-### 4. UBERJAR_MANIFEST_TRANSFORMER_MAIN add ManifestResourceTransformer class to uberjar processing and specify main-class
-### 5. UBERJAR_MANIFEST_TRANSFORMER_ATTRIBUTE add ManifestResourceTransformer class to uberjar processing and specify some attribute
-### 6. UBERJAR_APPENDING_TRANSFORMER add AppendingTransformer class to uberjar processing
-### 7. UBERJAR_SERVICES_RESOURCE_TRANSFORMER add ServicesResourceTransformer class to uberjar processing
+### 2. UBERJAR_HIDE_INCLUDE_PATTERN include classes matching this patterns to shading, include LDC mapping
+### 3. UBERJAR_HIDE_EXCLUDE_PATTERN exclude classes matching this patterns from shading (if enabled).
+### 4. UBERJAR_PATH_EXCLUDE_PREFIX the prefix for classes that should not get into the jar archive (all classes are placed into the archive by default)
+### 5. UBERJAR_MANIFEST_TRANSFORMER_MAIN add ManifestResourceTransformer class to uberjar processing and specify main-class
+### 6. UBERJAR_MANIFEST_TRANSFORMER_ATTRIBUTE add ManifestResourceTransformer class to uberjar processing and specify some attribute
+### 7. UBERJAR_APPENDING_TRANSFORMER add AppendingTransformer class to uberjar processing
+### 8. UBERJAR_SERVICES_RESOURCE_TRANSFORMER add ServicesResourceTransformer class to uberjar processing
###
### Documentation: https://wiki.yandex-team.ru/yatool/java/
###
-### @see: [JAVA_PROGRAM](#module_JAVA_PROGRAM), [UBERJAR_HIDING_PREFIX](#macro_UBERJAR_HIDING_PREFIX), [UBERJAR_HIDE_EXCLUDE_PATTERN](#macro_UBERJAR_HIDE_EXCLUDE_PATTERN), [UBERJAR_PATH_EXCLUDE_PREFIX](#macro_UBERJAR_PATH_EXCLUDE_PREFIX)
+### @see: [JAVA_PROGRAM](#module_JAVA_PROGRAM), [UBERJAR_HIDING_PREFIX](#macro_UBERJAR_HIDING_PREFIX), [UBERJAR_HIDE_INCLUDE_PATTERN](#macro_UBERJAR_HIDE_INCLUDE_PATTERN) [UBERJAR_HIDE_EXCLUDE_PATTERN](#macro_UBERJAR_HIDE_EXCLUDE_PATTERN), [UBERJAR_PATH_EXCLUDE_PREFIX](#macro_UBERJAR_PATH_EXCLUDE_PREFIX)
macro UBERJAR() {
SET(MAKE_UBERJAR_VALUE yes)
DISABLE(PASS_PEERS)
@@ -1486,6 +1487,21 @@ macro UBERJAR_HIDE_EXCLUDE_PATTERN(Args...) {
SET_APPEND(UBERJAR_HIDE_EXCLUDE_FLAGS ${pre=--shade-exclude :Args})
}
+
+UBERJAR_HIDE_INCLUDE_VALUE=
+UBERJAR_HIDE_INCLUDE_FLAGS=
+### @usage: UBERJAR_HIDE_INCLUDE_PATTERN(Args...)
+###
+### Include classes matching this patterns to shading, enabled LDC processing.
+### Pattern may contain '*' and '**' globs.
+### Shading is enabled for UBERJAR program using UBERJAR_HIDING_PREFIX macro. If this macro is not specified all classes are shaded.
+###
+### @see: [UBERJAR](#macro_UBERJAR), [UBERJAR_HIDING_PREFIX](#macro_UBERJAR_HIDING_PREFIX)
+macro UBERJAR_HIDE_INCLUDE_PATTERN(Args...) {
+ SET_APPEND(UBERJAR_HIDE_INCLUDE_VALUE $ARGS_DELIM $Args)
+ SET_APPEND(UBERJAR_HIDE_INCLUDE_FLAGS ${pre=--shade-include :Args})
+}
+
# tag:java-specific
UBERJAR_PATH_EXCLUDES=
UBERJAR_PATH_EXCLUDE_VALUE=