local ext = get_current_extension_info()

-- ----------------------------------------------------------------------
-- Initialize a helper variable containing standard configuration information for projects containing OGN files
local ogn = get_ogn_project_information(ext, "omni/my/extension")

-- This group is just for keeping things organized in the generated build files.
ext.group = "simulation"
project_ext( ext )


-- ----------------------------------------------------------------------
-- The main project is for building your plugin, mainly C++ nodes and the plugin support code.
project_ext_plugin( ext, ogn.plugin_project )
    -- ----------------------------------------------------------------------
    -- OGN files can be grouped together. By default "ogn.nodes_path" is just "nodes", as per the directory structure
    add_files("ogn/", ogn.nodes_path)
    add_files("impl", ogn.plugin_path)
    add_files("config", "config")
    add_files("docs", ogn.docs_path)

    -- ----------------------------------------------------------------------
    -- This sets up the OGN project dependencies, including the include path, library path, and extension dependencies
    add_ogn_dependencies(ogn)

    links {"carb", "vt", "gf", "sdf", "arch", "usd", "tf", "usdUtils", "usdGeom", "usdSkel"}


-- ----------------------------------------------------------------------
-- This creates a separate project tasked with processing the .ogn files to create the generated code.
-- By making it a separate project the build is guaranteed to always process the files before trying to compile.
-- The dependency on this project is auto-generated by the add_ogn_dependencies() function above.
project_ext_ogn( ext, ogn )


-- ----------------------------------------------------------------------
-- Note how the ogn object is used to populate the Python binding and script information
project_ext_bindings {
    ext = ext,
    project_name = ogn.python_project,
    module = ogn.bindings_module,
    src = ogn.bindings_path,
    target_subdir = ogn.bindings_target_path
}

    add_files("bindings", "bindings")
    add_files("python", "python/*.py")
    add_files("python/_impl", "python/_impl")
    add_files("python/tests", "python/tests")

    -- ----------------------------------------------------------------------
    -- If you do not have Python node implementations this line may be safely omitted.
    -- The second parameter is a list of directories containing Python node files, which enables OmniGraph to
    -- hot-load the Python node files when they change, so that you can modify their behaviour live.
    add_ogn_dependencies(ogn, {"python/_impl/nodes"})

    -- ----------------------------------------------------------------------
    -- Copy the init script directly into the build tree to avoid reload conflicts.
    repo_build.prebuild_copy {
        { "python/__init__.py", ogn.python_target_path },
    }
    -- Linking directories allows them to hot reload when files are modified in the source tree
    repo_build.prebuild_link {
        { "python/_impl", ogn.python_target_path.."/_impl" },
        { "python/tests", ogn.python_tests_target_path },
    }
