Skip to content

Commit

Permalink
Merge pull request ydb-platform#3809 from ydb-platform/mergelibs-2404…
Browse files Browse the repository at this point in the history
…17-0847

Library import 240417-0847
  • Loading branch information
alexv-smirnov authored Apr 17, 2024
2 parents 50db96b + fb4b3ef commit 62d05d2
Show file tree
Hide file tree
Showing 67 changed files with 671 additions and 406 deletions.
37 changes: 35 additions & 2 deletions build/conf/ts/ts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,24 @@ NODEJS_BIN=$NODEJS_ROOT/node

TS_TRACE=no
TS_LOCAL_CLI=no
# Use outdir defined in tsconfig
# Use outdir defined in tsconfig (actual not for bundlers, they use own way to define output directory)
TS_CONFIG_USE_OUTDIR=

NOTS_TOOL=${tool:"devtools/frontend_build_platform/nots/builder"}


TS_CONFIG_PATH=tsconfig.json

### @usage: TS_CONFIG(ConfigPath)
###
### Macro sets the path for "TypeScript Config".
###
### - ConfigPath - config path (one at least)
macro TS_CONFIG(FirstConfigPath, ConfigPath...) {
SET(TS_CONFIG_PATH $FirstConfigPath $ConfigPath)
}


# Arguments for the all commands of the `nots/builder`, passed before the command
NOTS_TOOL_BASE_ARGS=\
--arcadia-root $ARCADIA_ROOT \
Expand All @@ -29,13 +42,23 @@ NOTS_TOOL_COMMON_BUILDER_ARGS=\

ERM_PACKAGES_PATH=devtools/frontend_build_platform/erm/erm-packages.json

TS_CONFIG_PATH=tsconfig.json
TS_OUTPUT_FILE=output.tar
TS_OUTPUT_FILE_UUID=output.tar.uuid
TS_EXCLUDE_DIR_GLOB=(.idea|.vscode|node_modules)/**/*
TS_COMMON_OUTDIR_GLOB=(build|dist|bundle|\${join=|:WEBPACK_OUTPUT_DIR}|$TS_NEXT_OUTPUT_DIR|$VITE_OUTPUT_DIR)/**/*

TS_GLOB_EXCLUDE_ADDITIONAL=

### @usage: TS_EXCLUDE_FILES_GLOB(GlobExpression)
###
### Macro sets glob to mark some files to ignore while building.
### These files won't be copied to BINDIR.
###
### - GlobExpression - glob expression
macro TS_EXCLUDE_FILES_GLOB(GlobExpression) {
SET(TS_GLOB_EXCLUDE_ADDITIONAL $GlobExpression)
}

module _TS_BASE_UNIT: _BARE_UNIT {
# Propagates peers to related modules
.PEERDIR_POLICY=as_build_from
Expand Down Expand Up @@ -65,6 +88,16 @@ module _TS_BASE_UNIT: _BARE_UNIT {

# tag:test
ESLINT_CONFIG_PATH=.eslintrc.js

### @usage: TS_ESLINT_CONFIG(ConfigPath)
###
### Macro sets the path for ESLint config file.
###
### - ConfigPath - config path
macro TS_ESLINT_CONFIG(ConfigName) {
SET(TS_GLOB_EXCLUDE_ADDITIONAL $GlobExpression)
}

_TS_LINT_SRCS_VALUE=
### _TS_CONFIG_EPILOGUE() # internal
###
Expand Down
38 changes: 22 additions & 16 deletions build/conf/ts/ts_next.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
TS_NEXT_OUTPUT_DIR=.next
TS_NEXT_CONFIG_PATH=next.config.js

### @usage: TS_NEXT_CONFIG(ConfigPath)
###
### Macro sets the config path for TS_NEXT module.
###
### - ConfigPath - config path
macro TS_NEXT_CONFIG(ConfigPath) {
SET(TS_NEXT_CONFIG_PATH $ConfigPath)
}


TS_NEXT_OUTPUT_DIR=.next

### @usage: TS_NEXT_OUTPUT(DirName)
###
### Macro sets the output directory name for TS_NEXT module.
###
### - DirName - output directory name
macro TS_NEXT_OUTPUT(DirName) {
SET(TS_NEXT_OUTPUT_DIR $DirName)
}

TS_NEXT_CMD=$TOUCH_UNIT \
&& $_TS_FILES_COPY_CMD \
&& $ADD_VCS_INFO_FILE_CMD \
Expand Down Expand Up @@ -38,7 +58,7 @@ multimodule TS_NEXT {
DISABLE(TS_CONFIG_DEDUCE_OUT)
DISABLE(TS_CONFIG_USE_OUTDIR)

_TS_CONFIGURE($TS_CONFIG_PATH)
_TS_CONFIGURE()

SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
Expand All @@ -48,17 +68,3 @@ multimodule TS_NEXT {

}
}

macro TS_NEXT_CONFIG(Path) {
SET(TS_NEXT_CONFIG_PATH $Path)
}


### @usage: TS_NEXT_OUTPUT(DirName)
###
### Macro sets the output directory name for TS_NEXT module.
###
### - DirName - output directory name ("bundle" by default).
macro TS_NEXT_OUTPUT(DirName) {
SET(TS_NEXT_OUTPUT_DIR $DirName)
}
4 changes: 2 additions & 2 deletions build/conf/ts/ts_proto.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module _TS_PROTO_IMPL: _TS_BASE_UNIT {
DISABLE(TS_CONFIG_DEDUCE_OUT)
ENABLE(TS_CONFIG_USE_OUTDIR)

_TS_CONFIGURE($TS_CONFIG_PATH)
_TS_CONFIGURE()

SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
Expand All @@ -42,4 +42,4 @@ module _TS_PROTO_IMPL: _TS_BASE_UNIT {
### @usage: _TS_PROTO_SRCS(path1 path2) # internal
macro _TS_PROTO_SRCS(FILES...) {
_SET_APPEND_WITH_DIRECTIVE(_TS_PROTO_SRCS_FILES input $FILES)
}
}
2 changes: 1 addition & 1 deletion build/conf/ts/ts_tsc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ multimodule TS_TSC {
DISABLE(TS_CONFIG_DEDUCE_OUT)
ENABLE(TS_CONFIG_USE_OUTDIR)

_TS_CONFIGURE($TS_CONFIG_PATH)
_TS_CONFIGURE()

SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
Expand Down
40 changes: 29 additions & 11 deletions build/conf/ts/ts_vite.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
VITE_OUTPUT_DIR=dist
VITE_CONFIG_PATH=vite.config.ts

### @usage: TS_VITE_CONFIG(ConfigPath)
###
### Macro sets the config path for TS_VITE module.
###
### - ConfigPath - config path
macro TS_VITE_CONFIG(ConfigPath) {
SET(VITE_CONFIG_PATH $ConfigPath)
}


VITE_OUTPUT_DIR=dist

### @usage: TS_VITE_OUTPUT(DirName)
###
### Macro sets the output directory name for TS_VITE module.
###
### - DirName - output directory name
macro TS_VITE_OUTPUT(DirName) {
SET(VITE_OUTPUT_DIR $DirName)
}

# tag:deprecated
macro VITE_OUTPUT(DirName) {
MESSAGE(WARNING "VITE_OUTPUT is deprecated, use TS_VITE_OUTPUT instead")
SET(VITE_OUTPUT_DIR $DirName)
}


TS_VITE_CMD=$TOUCH_UNIT \
&& $_TS_FILES_COPY_CMD \
&& $ADD_VCS_INFO_FILE_CMD \
Expand All @@ -12,15 +39,6 @@ TS_VITE_CMD=$TOUCH_UNIT \
${output;hide:"package.json"} \
${kv;hide:"pc magenta"} ${kv;hide:"p TS_VIT"}

### @usage: VITE_OUTPUT(DirName)
###
### Macro sets the output directory name for TS_VITE module.
###
### - DirName - output directory name ("dist" by default).
macro VITE_OUTPUT(DirName) {
SET(VITE_OUTPUT_DIR $DirName)
}

### @usage: TS_VITE([name])
###
### The Vite bundle, bundles JavaScript code.
Expand All @@ -46,7 +64,7 @@ multimodule TS_VITE {
DISABLE(TS_CONFIG_DEDUCE_OUT)
DISABLE(TS_CONFIG_USE_OUTDIR)

_TS_CONFIGURE($TS_CONFIG_PATH)
_TS_CONFIGURE()

SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
Expand Down
38 changes: 27 additions & 11 deletions build/conf/ts/ts_webpack.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
WEBPACK_OUTPUT_DIR=bundle
WEBPACK_CONFIG_PATH=webpack.config.js

### @usage: TS_WEBPACK_CONFIG(ConfigPath)
###
### Macro sets the config path for TS_WEBPACK module.
###
### - ConfigPath - config path
macro TS_WEBPACK_CONFIG(ConfigPath) {
SET(WEBPACK_CONFIG_PATH $ConfigPath)
}

WEBPACK_OUTPUT_DIR=bundle

### @usage: TS_WEBPACK_OUTPUT(FirstDirName DirNames)
###
### Macro sets the output directory names (one at least) for TS_WEBPACK module.
###
### - DirNames - output directory names (one at least)
macro TS_WEBPACK_OUTPUT(FirstDirName, DirNames...) {
SET(WEBPACK_OUTPUT_DIR $FirstDirName $DirNames)
}

# tag:deprecated
macro WEBPACK_OUTPUT(FirstDirName, DirNames...) {
MESSAGE(WARNING "WEBPACK_OUTPUT is deprecated, use TS_WEBPACK_OUTPUT instead")
SET(WEBPACK_OUTPUT_DIR $FirstDirName $DirNames)
}

TS_WEBPACK_CMD=$TOUCH_UNIT \
&& $_TS_FILES_COPY_CMD \
&& $ADD_VCS_INFO_FILE_CMD \
Expand All @@ -12,15 +37,6 @@ TS_WEBPACK_CMD=$TOUCH_UNIT \
${output;hide:"package.json"} \
${kv;hide:"pc magenta"} ${kv;hide:"p TS_WPK"}

### @usage: WEBPACK_OUTPUT(FirstDirName DirNames)
###
### Macro sets the output directory names (one at least) for TS_WEBPACK module.
###
### - DirNames - output directory names (one at least) ("bundle" by default).
macro WEBPACK_OUTPUT(FirstDirName, DirNames...) {
SET(WEBPACK_OUTPUT_DIR $FirstDirName $DirNames)
}

### @usage: TS_WEBPACK([name])
###
### The Webpack bundle, bundles JavaScript code.
Expand All @@ -46,7 +62,7 @@ multimodule TS_WEBPACK {
DISABLE(TS_CONFIG_DEDUCE_OUT)
DISABLE(TS_CONFIG_USE_OUTDIR)

_TS_CONFIGURE($TS_CONFIG_PATH)
_TS_CONFIGURE()

SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
Expand Down
4 changes: 4 additions & 0 deletions build/export_generators/ide-gradle/build.gradle.kts.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,9 @@ tasks.build.dependsOn(
{% if publish -%}
{% include 'publish.gradle.kts' ignore missing -%}
{% endif -%}
{# To disable redundant javadoc (it may fail the build) #}
tasks.withType<Javadoc>().configureEach {
isEnabled = false
}

{%- include "[generator]/debug.jinja" ignore missing -%}
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,13 @@ val prepareProto = tasks.register<Copy>("prepareProto") {
afterEvaluate {
tasks.getByName("extractProto").dependsOn(prepareProto)
}
{# To avoid problems when build project with proto #}
tasks.named("sourcesJar").configure {
dependsOn("generateProto")
}
{# To disable redundant javadoc (it may fail the build) #}
tasks.withType<Javadoc>().configureEach {
isEnabled = false
}

{%- include "[generator]/debug.jinja" ignore missing -%}
17 changes: 17 additions & 0 deletions build/platform/python/ldflags/ya.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
RESOURCES_LIBRARY()

SUBSCRIBER(g:contrib)

IF (USE_SYSTEM_PYTHON)
IF (OS_LINUX)
LDFLAGS("-L$EXTERNAL_PYTHON_RESOURCE_GLOBAL/python/lib/x86_64-linux-gnu -lpython${PY_VERSION}")
ELSEIF (OS_DARWIN)
LDFLAGS("-L$EXTERNAL_PYTHON_RESOURCE_GLOBAL/python/Python.framework/Versions/${PY_FRAMEWORK_VERSION}/lib -lpython${PY_VERSION}")
ELSEIF (OS_WINDOWS)
LDFLAGS("/LIBPATH:$EXTERNAL_PYTHON_RESOURCE_GLOBAL/python/libs")
ENDIF()
ELSEIF (NOT USE_ARCADIA_PYTHON)
LDFLAGS($PYTHON_LDFLAGS $PYTHON_LIBRARIES)
ENDIF()

END()
3 changes: 2 additions & 1 deletion build/plugins/nots.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,13 @@ def on_peerdir_ts_resource(unit, *resources):


@_with_report_configure_error
def on_ts_configure(unit, *tsconfig_paths):
def on_ts_configure(unit):
# type: (Unit, *str) -> None
from lib.nots.package_manager.base import PackageJson
from lib.nots.package_manager.base.utils import build_pj_path
from lib.nots.typescript import TsConfig

tsconfig_paths = unit.get("TS_CONFIG_PATH").split()
# for use in CMD as inputs
__set_append(
unit, "TS_CONFIG_FILES", _build_cmd_input_paths(tsconfig_paths, hide=True, disable_include_processor=True)
Expand Down
2 changes: 1 addition & 1 deletion build/ymake.core.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ module UNITTEST: _BASE_UNITTEST {
###
### YT Unit test module based on library/cpp/testing/unittest with NYT::Initialize hook
module YT_UNITTEST: _BASE_UNITTEST {
PEERDIR(library/cpp/testing/unittest_main mapreduce/yt/tests/yt_initialize_hook)
PEERDIR(library/cpp/testing/unittest_main yt/cpp/mapreduce/tests/yt_initialize_hook)
ADD_YTEST($MODULE_PREFIX$REALPRJNAME unittest.py)
}

Expand Down
Loading

0 comments on commit 62d05d2

Please sign in to comment.