import("$tizen_core/build/workspace.gni")

tizen_workspace("{{.PackageID}}") {
    package_file = "$root_out_dir/${package_id}.$out_dir"

    projects = []
    manifests = []
    configFiles = []
    executables = []
    {{- if .Native}}

    projects += [
        {{- range .Native}}
        "//{{.Path}}",
        {{- end}}
    ]

    if (!test_build) {
        manifests = [
            {{- range .Native}}
            {{- if eq .Type "native_app" }}
            "//{{.Path}}/tizen-manifest.xml",
            {{- end}}
            {{- end}}
        ]
        executables = [
            {{- range .Native}}
            {{- if eq .Type "native_app" }}
            "{{.OutputName}}",
            {{- end}}
            {{- end}}
        ]
    }

    {{- end}}

    {{- if .Web}}
    projects += [
        {{- range .Web}}
        "//{{.Path}}",
        {{- end}}
    ]


    if (!test_build) {
        configFiles = [
            {{- range .Web}}
            {{- if eq .Type "web_app" }}
            "//{{.Path}}/config.xml",
            {{- end}}
            {{- end}}
        ]
    }
    {{- end}}

    if (test_build) {

        {{- if .NativeTests}}
        projects += [
            {{- range .NativeTests}}
            "//{{.Path}}",
            {{- end}}
        ]
        manifests = [
            {{- range .NativeTests}}
            "//{{.Path}}/tizen-manifest.xml",
            {{- end}}
        ]
        executables = [
            {{- range .NativeTests}}
            "{{.OutputName}}",
            {{- end}}
        ]

        {{- end}}
    }

    {{- if .Native}}
    manifests += [
        "//tizen-manifest.xml",
    ]
    {{- end}}
   
}
