summaryrefslogtreecommitdiffstats
path: root/build/export_generators/ide-gradle/codegen_copy_file.jinja
blob: 7689c4db1c4ee2895bd67fbf98ff5a3bc609a981 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{%- if copy_files|length -%}
{%-     for copy in copy_files -%}
{%-         set src = copy.args[0] -%}
{%-         set dst = copy.args[1] -%}
{%-         set src_split = rsplit(src, "/", 2) -%}
{%-         set src_path = src_split[0] -%}
{%-         set src_name = src_split[1] -%}
{%-         set dst_split = rsplit(dst, "/", 2) -%}
{%-         set dst_path = dst_split[0] -%}
{%-         set dst_name = dst_split[1] %}

val {{ varprefix }}{{ copy['_object_index'] }} = tasks.register<Copy>("{{ varprefix }}{{ copy['_object_index'] }}") {
    from({{ PatchRoots(src_path, copy['flags']|select("eq", "src_is_depend")|length) }}) {
        include("{{ src_name }}")
    }
    into({{ PatchRoots(dst_path, false, true) }})
{%-         if src_name != dst_name %}
    rename("{{ src_name }}", "{{ dst_name }}")
{%-         endif %}
}
{%      endfor -%}
{%- endif -%}