1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
{%- if current_target.runs|length -%}
{%- for run in current_target.runs %}
val {{ varprefix }}{{ run['_object_index'] }} = task<JavaExec>("{{ varprefix }}{{ run['_object_index'] }}") {
group = "build"
description = "Code generation by run java program"
{#- Ignore default CWD to export_root -#}
{%- if run.cwd and run.cwd != export_root %}
workingDir = file({{ PatchRoots(run.cwd) }})
{%- else %}
workingDir = file("$buildDir")
{%- endif -%}
{%- set classpaths = run.classpath|reject('eq', '@.cplst') -%}
{%- if classpaths|length -%}
{% for classpath in classpaths -%}
{%- set rel_file_classpath = classpath|replace('@', '')|replace(export_root, '')|replace(arcadia_root, '') %}
val classpaths = "$arcadia_root/" + File("$arcadia_root{{ rel_file_classpath }}").readText().trim().replace(":", ":$arcadia_root/")
classpath = files(classpaths.split(":"))
{%- endfor -%}
{%- endif %}
mainClass.set("{{ run.args[0] }}")
{%- if run.args|length > 1 %}
args = listOf(
{%- for arg in run.args -%}
{%- if not loop.first %}
{%- if run.out_dir|select("eq", arg)|length or run.out|select("eq", arg)|length -%}
{%- if proto_template %}
{{ PatchGeneratedProto(arg) }},
{%- else %}
{{ PatchRoots(arg, false, true) }},
{%- endif %}
{%- elif run.tool|select("in", arg)|length %}
{{ PatchRoots(arg, true) }},
{%- else %}
{{ PatchRoots(arg) }},
{%- endif -%}
{%- endif -%}
{%- endfor %}
)
{% endif -%}
{%- if run.in_dir|length -%}
{%- for in_dir in run.in_dir|unique %}
inputs.files(fileTree({{ PatchRoots(in_dir) }}))
{% endfor -%}
{%- endif -%}
{%- if run.in|length -%}
{%- for in_file in run.in|unique %}
inputs.files({{ PatchRoots(in_file) }})
{% endfor -%}
{%- endif -%}
{%- if run.in_noparse|length -%}
{%- for in_file in run.in_noparse|unique %}
inputs.files({{ PatchRoots(in_file) }})
{% endfor -%}
{%- endif -%}
{%- if run.out_dir|length -%}
{%- for out_dir in run.out_dir|unique %}
{%- if proto_template %}
outputs.files({{ PatchGeneratedProto(out_dir) }})
{%- else %}
outputs.dir({{ PatchRoots(out_dir, false, true) }})
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if run.out|length -%}
{%- for out in run.out|unique %}
{%- if proto_template %}
outputs.files({{ PatchGeneratedProto(out) }})
{%- else %}
outputs.files({{ PatchRoots(out, false, true) }})
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{#-
Не использованы атрибуты
run-in_dirs_inputs="list"
run-tool="list"
#}
}
{%- endfor -%}
{%- endif -%}
|