Skip to content

Commit fcf98cb

Browse files
committed
Merge branch 'rightlib' into merge-libs-250418-0050
2 parents 1f62eb9 + 8e53255 commit fcf98cb

File tree

91 files changed

+1571
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1571
-233
lines changed

build/conf/ts/node_modules.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ _PREPARE_DEPS_CMD=$TOUCH_UNIT \
4343

4444
# In case of no deps we need to create empty outputs for graph connectivity
4545
_PREPARE_NO_DEPS_CMD=$TOUCH_UNIT \
46-
&& $YMAKE_PYTHON ${input:"build/scripts/touch.py"} \
46+
&& $YMAKE_PYTHON3 ${input:"build/scripts/touch.py"} \
4747
$_PREPARE_DEPS_INOUTS \
4848
${hide;kv:"pc magenta"} ${hide;kv:"p TS_NODEP"}
4949

build/conf/ts/ts.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ _TS_PROJECT_SETUP_CMD=$EXTRACT_GENTAR
1717

1818
TS_CONFIG_PATH=tsconfig.json
1919

20-
EXTRACT_GENTAR=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/autotar_gendirs.py"} --unpack --ext .gentar ${ext=.gentar:AUTO_INPUT}
20+
EXTRACT_GENTAR=${cwd:BINDIR} $YMAKE_PYTHON3 ${input:"build/scripts/autotar_gendirs.py"} --unpack --ext .gentar ${ext=.gentar:AUTO_INPUT}
2121

2222
### @usage: TS_CONFIG(ConfigPath)
2323
###

build/export_generators/ide-gradle/build.gradle.kts.any.jinja

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
{#- That is why all common macroses here -#}
44

55
{%- macro PatchRoots(arg, depend = false, output = false) -%}
6-
{#- Always replace (arcadia_root) === (SOURCE_ROOT in ymake) to $project_root in Gradle -#}
6+
{#- Always replace (arcadia_root) === (SOURCE_ROOT in ymake) to $arcadia_root in Gradle -#}
77
{%- if depend -%}
8-
{#- Replace (export_root) === (BUILD_ROOT in ymake) to $project_root in Gradle, because prebuilt tools in arcadia, not in build_root -#}
9-
"{{ arg|replace(export_root, "$project_root")|replace(arcadia_root, "$project_root") }}"
8+
{#- Replace (export_root) === (BUILD_ROOT in ymake) to $arcadia_root in Gradle, because prebuilt tools in arcadia, not in build_root -#}
9+
"{{ arg|replace(export_root, "$arcadia_root")|replace(arcadia_root, "$arcadia_root") }}"
1010
{%- elif output and arg[0] != '/' -%}
1111
{#- Relative outputs in buildDir -#}
1212
"$buildDir/{{ arg }}"
1313
{%- else -%}
1414
{#- Replace (export_root) === (BUILD_ROOT in ymake) to baseBuildDir in Gradle - root of all build folders for modules -#}
15-
"{{ arg|replace(export_root, "$baseBuildDir")|replace(arcadia_root, "$project_root") }}"
15+
"{{ arg|replace(export_root, "$baseBuildDir")|replace(arcadia_root, "$arcadia_root") }}"
1616
{%- endif -%}
1717
{%- endmacro -%}
1818

@@ -26,13 +26,14 @@
2626
{%- endmacro -%}
2727
{%- endif -%}
2828

29+
{%- include "[generator]/common_dir.jinja" -%}
30+
2931
{%- if proto_template -%}
3032
{%- include "[generator]/proto_vars.jinja" -%}
3133
{%- include "[generator]/proto_import.jinja" -%}
3234
{%- include "[generator]/proto_builddir.jinja" -%}
3335
{%- include "[generator]/proto_plugins.jinja" -%}
3436
{%- include "[generator]/proto_configuration.jinja" -%}
35-
{%- include "[generator]/proto_source_sets.jinja" -%}
3637
{%- include "[generator]/protobuf.jinja" -%}
3738
{%- include "[generator]/proto_prepare.jinja" -%}
3839
{%- include "[generator]/build.gradle.kts.common.jinja" -%}
@@ -45,7 +46,6 @@
4546
{%- include "[generator]/kotlin_plugins.jinja" -%}
4647
{%- include "[generator]/preview.jinja" -%}
4748
{%- include "[generator]/configuration.jinja" -%}
48-
{%- include "[generator]/source_sets.jinja" -%}
4949
{%- include "[generator]/test.jinja" -%}
5050
{%- include "[generator]/build.gradle.kts.common.jinja" -%}
5151
{%- include "[generator]/dependencies.jinja" -%}

build/export_generators/ide-gradle/build.gradle.kts.common.jinja

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
{%- include "[generator]/javac_flags.jinja" -%}
66
{%- include "[generator]/kotlinc_flags.jinja" -%}
77

8+
{%- include "[generator]/source_sets.jinja" -%}
89
{%- include "[generator]/codegen.jinja" -%}
910

10-
{%- include "[generator]/javadoc.jinja" -%}
11+
{#- To disable redundant javadoc (it may fail the build) #}
12+
13+
tasks.withType<Javadoc>().configureEach {
14+
isEnabled = false
15+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{#- empty string #}
22
val baseBuildDir = "{{ export_root }}/gradle.build"
3-
buildDir = file(baseBuildDir + "/" + project.path.replace(":", "/"))
3+
buildDir = file(baseBuildDir + "{%- if common_dir %}/{{ common_dir }}{% endif -%}/" + project.path.replace(":", "/"))
44
subprojects {
5-
buildDir = file(baseBuildDir + "/" + project.path.replace(":", "/"))
5+
buildDir = file(baseBuildDir + "{%- if common_dir %}/{{ common_dir }}{% endif -%}/" + project.path.replace(":", "/"))
66
}

build/export_generators/ide-gradle/codegen.jinja

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,28 @@
22
{%- if proto_template %}
33

44
tasks.getByName("prepareMainProtos").dependsOn({{ taskvar }})
5-
{%- endif %}
5+
{%- endif -%}
66

7+
{#- Check main target codegen -#}
8+
{%- if varprefix == "codegen" %}
79
tasks.compileJava.configure {
810
dependsOn({{ taskvar }})
911
}
12+
{%- endif %}
1013
tasks.compileTestJava.configure {
1114
dependsOn({{ taskvar }})
1215
}
13-
{%- if with_kotlin %}
16+
{%- if with_kotlin -%}
17+
{#- Check main target codegen -#}
18+
{%- if varprefix == "codegen" %}
1419
tasks.compileKotlin.configure {
1520
dependsOn({{ taskvar }})
1621
}
22+
{%- endif %}
1723
tasks.compileTestKotlin.configure {
1824
dependsOn({{ taskvar }})
1925
}
20-
{% endif -%}
26+
{% endif -%}
2127
{%- endmacro -%}
2228

2329
{%- macro ObjDepends(obj) -%}
@@ -33,11 +39,13 @@ tasks.getByName("{{ parent_taskvar }}").dependsOn({{ taskvar }})
3339

3440
{%- if target is defined -%}
3541
{%- set current_target = target -%}
42+
{#- Main target codegen -#}
3643
{%- set varprefix = "codegen" -%}
3744
{%- include "[generator]/codegen_current_target.jinja" -%}
3845
{%- endif -%}
3946
{%- if extra_targets|length -%}
4047
{%- for current_target in extra_targets -%}
48+
{#- TestN target codegen -#}
4149
{%- set varprefix = "test" + loop.index0|tojson + "Codegen" -%}
4250
{%- include "[generator]/codegen_current_target.jinja" -%}
4351
{%- endfor -%}

build/export_generators/ide-gradle/codegen_run_java_program.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ val {{ varprefix }}{{ run['_object_index'] }} = task<JavaExec>("{{ varprefix }}{
1717
{% for classpath in classpaths -%}
1818
{%- set rel_file_classpath = classpath|replace('@', '')|replace(export_root, '')|replace(arcadia_root, '') %}
1919

20-
val classpaths = "$project_root/" + File("$project_root{{ rel_file_classpath }}").readText().trim().replace(":", ":$project_root/")
20+
val classpaths = "$arcadia_root/" + File("$arcadia_root{{ rel_file_classpath }}").readText().trim().replace(":", ":$arcadia_root/")
2121
classpath = files(classpaths.split(":"))
2222
{%- endfor -%}
2323
{%- endif %}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{%- if common_dir -%}
2+
{%- set common_dir_classpath = '":' + common_dir|replace("/", ":") -%}
3+
{%- else -%}
4+
{%- set common_dir_classpath = false -%}
5+
{%- endif -%}

build/export_generators/ide-gradle/configuration.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{#- empty string #}
2-
val project_root = "{{ arcadia_root }}"
2+
val arcadia_root = "{{ arcadia_root }}"
3+
val project_root = "{{ project_root }}"
34

45
{% if mainClass -%}
56
application {

build/export_generators/ide-gradle/dependencies.jinja

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
{%- if annotation_processors|length -%}
33
{%- set lomboks = annotation_processors|select('startsWith', 'contrib/java/org/projectlombok/lombok') -%}
44
{%- for lombok in lomboks %}
5-
{{ funcName }}(files("$project_root/{{ lombok }}"))
5+
{{ funcName }}(files("$arcadia_root/{{ lombok }}"))
66
{%- endfor -%}
77
{%- set annotation_processors = annotation_processors|reject('in', lomboks) -%}
88
{%- for annotation_processor in annotation_processors %}
9-
{{ funcName }}(files("$project_root/{{ annotation_processor }}"))
9+
{{ funcName }}(files("$arcadia_root/{{ annotation_processor }}"))
1010
{%- endfor -%}
1111
{%- endif -%}
1212
{%- endmacro -%}
@@ -22,15 +22,18 @@ dependencies {
2222
{%- endif -%}
2323

2424
{%- if library.prebuilt and library.jar and (library.type != "contrib" or build_contribs) %}
25-
implementation(files("$project_root/{{ library.jar }}"))
25+
implementation(files("$arcadia_root/{{ library.jar }}"))
2626
{%- else -%}
2727
{%- set classpath = library.classpath -%}
2828
{%- if classpath|replace('"','') == classpath -%}
2929
{%- set classpath = '"' + classpath + '"' -%}
3030
{%- endif -%}
31+
{%- include "[generator]/patch_classpath.jinja" -%}
3132
{%- if library.type != "contrib" %}
32-
{%- if library.testdep %}
33-
implementation(project(path = ":{{ library.testdep | replace("/", ":") }}", configuration = "testArtifacts"))
33+
{%- if library.testdep -%}
34+
{%- set classpath = '":' + library.testdep | replace("/", ":") + '"' -%}
35+
{%- include "[generator]/patch_classpath.jinja" %}
36+
implementation(project(path = {{ classpath }}, configuration = "testArtifacts"))
3437
{%- else %}
3538
implementation({{ classpath }})
3639
{%- endif -%}
@@ -53,14 +56,17 @@ dependencies {
5356
{%- for extra_target in extra_targets -%}
5457
{%- for library in extra_target.consumer if library.classpath -%}
5558
{%- if library.prebuilt and library.jar and (library.type != "contrib" or build_contribs) %}
56-
testImplementation(files("$project_root/{{ library.jar }}"))
59+
testImplementation(files("$arcadia_root/{{ library.jar }}"))
5760
{%- else -%}
5861
{%- set classpath = library.classpath -%}
5962
{%- if classpath|replace('"','') == classpath -%}
6063
{%- set classpath = '"' + classpath + '"' -%}
6164
{%- endif %}
62-
{%- if library.type != "contrib" and library.testdep %}
63-
testImplementation(project(path = ":{{ library.testdep | replace("/", ":") }}", configuration = "testArtifacts"))
65+
{%- include "[generator]/patch_classpath.jinja" -%}
66+
{%- if library.type != "contrib" and library.testdep -%}
67+
{%- set classpath = '":' + library.testdep | replace("/", ":") + '"' -%}
68+
{%- include "[generator]/patch_classpath.jinja" %}
69+
testImplementation(project(path = {{ classpath }}, configuration = "testArtifacts"))
6470
{%- else %}
6571
testImplementation({{ classpath }})
6672
{%- endif -%}

0 commit comments

Comments
 (0)