Skip to content

Commit

Permalink
Merge Dev into to build release. (#32)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md

* Maya + Unreal Build scripts (Win/Linux) (#15)

* added AyonUsdLinux build script (script uses system installed python

* added option to define boost lib name appending

* added windows ayon usd build script

* added documentation for the build plugins (python part) added windows / linux to tested platforms

* added TestAyonUsd.bat

* added /changed AyonUsd build.bat and cmake

* made scrtips more readable based on BigRoy feedback

* added an ´ to an your

* added linux py310 maya 2024.2 build plugin. works for building resolver with 3 env variables. loads under Alma Linux9

* moved complie plugin include in order to allow for setting compiler in BuildPlugin

* t

* unreal is broken again

* conflickts

* build this new branch because its broken

* new version for ayon-cpp-api

* changed build scripts so that all off them can run without anny changes only the AyonUsd Cmake script needs to define the project first because off a variable deadlock. this version will probably not work under windowns because i did not update the windwos build scripts

* added windows build scripts for maya and unreal

* Unreal and Maya work for windows now

* changed maya naming to be py11

* this is the version off the code that produced the Resolvers for windows and linux from May15th2024

* updated AyonUsdWin AyonUsd23_5_py39 plugin because we neet to define project at the start off this plugin so that we dont get an infinit loop

* Update BuildPlugins/AyonUsdWin/AyonUsd23_5_py39.cmake

Co-authored-by: Ondřej Samohel <[email protected]>

* Update BuildPlugins/MayaLinux/LinuxPy310Maya2024_2.cmake

Co-authored-by: Ondřej Samohel <[email protected]>

* Update BuildPlugins/MayaLinux/LinuxPy311Maya2025.cmake

Co-authored-by: Ondřej Samohel <[email protected]>

* Update BuildPlugins/MayaWin/WinPy310Maya2024_2.cmake

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* removed one TODO tag because it was resoved

* updated ayon-cpp-api to develop branch because PythonBuildSetup branch was merged into it

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

* Update README.md

Co-authored-by: Ondřej Samohel <[email protected]>

---------

Co-authored-by: Lyon_Rosenblatt <[email protected]>
Co-authored-by: Ondřej Samohel <[email protected]>

* added templates

* added templates

* Update proposal_technical.yml

Added Glossary of Terms and Conceptual framework as it became important for describing pinning support

* Update proposal_technical.yml

* renamed plugins and added naming template to README.md (#17)

Co-authored-by: Lyon_Rosenblatt <[email protected]>
Co-authored-by: Ondřej Samohel <[email protected]>

* was not albe to upload data because off broken sub moduele link on my side

* added back src files from commit 851967d because the changes from b64838a should be on a different branch

* Feature/ay 1212 cache entetry struct replacment for cache pair (#22)

* started to move assetIdent to its own file to become a class

* added macro to remove SDF_FOMRAT_ARGS, also added the build plugins from the build plugin rename branch

* removed old build plugins

* updated CMakeLists.txt because some files where not compiled into python target and so TF-Prepare module did not create the correct module

* replaced with assetIdent class

* doxygen file was changed but should not have been

* clean up s

* Update src/AyonUsdResolver/resolverContextCache.h

Co-authored-by: Ondřej Samohel <[email protected]>

* Update src/AyonUsdResolver/resolverContextCache.h

Co-authored-by: Ondřej Samohel <[email protected]>

* Update src/AyonUsdResolver/assetIdentDef.h

Co-authored-by: Ondřej Samohel <[email protected]>

* Update src/AyonUsdResolver/assetIdentDef.h

Co-authored-by: Ondřej Samohel <[email protected]>

* Update src/AyonUsdResolver/assetIdentDef.h

Co-authored-by: Ondřej Samohel <[email protected]>

* Update src/AyonUsdResolver/assetIdentDef.h

Co-authored-by: Ondřej Samohel <[email protected]>

* Update src/AyonUsdResolver/assetIdentDef.h

Co-authored-by: Ondřej Samohel <[email protected]>

* Update src/AyonUsdResolver/assetIdentDef.h

Co-authored-by: Ondřej Samohel <[email protected]>

* changed around the way remove sdf formats marco works so that its inplace now

* implemented Macro for inplace SDF Fromat Args removal

* added a status message to inform about the Macro selection at compile time

---------

Co-authored-by: Lyon_Rosenblatt <[email protected]>
Co-authored-by: Ondřej Samohel <[email protected]>

* changed cpp api to develop branch

* update ayon cpp api pointer to the actuall v0.1.0-aloha version of the cpp api (#28)

Co-authored-by: ynput <[email protected]>

* update git module file to solve merge conflicts (#29)

Co-authored-by: ynput <[email protected]>

* Feature/gh pages auto (#25)

* removed adding pages setup so i can have a seperate pr

* add documentation generation via pages

* add documentation generation via pages

* added info about github Pages data

* Update .github/workflows/static.yml

Co-authored-by: Roy Nieterau <[email protected]>

* fixed non clickable docs link

* upaded docs

* updates to readme

* updates to readme

* upade doxyfile because to ayon usd resolver project name

* moved docs from pinning suport branch

* updated readme and dev docs with the right link

---------

Co-authored-by: Lyon_Rosenblatt <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: ynput <[email protected]>

* Feature/gh pages auto (#30)

* removed adding pages setup so i can have a seperate pr

* add documentation generation via pages

* add documentation generation via pages

* added info about github Pages data

* Update .github/workflows/static.yml

Co-authored-by: Roy Nieterau <[email protected]>

* fixed non clickable docs link

* upaded docs

* updates to readme

* updates to readme

* upade doxyfile because to ayon usd resolver project name

* moved docs from pinning suport branch

* updated readme and dev docs with the right link

* updated page workflow to use generate.py

---------

Co-authored-by: Lyon_Rosenblatt <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: ynput <[email protected]>

* Feature/23 feature request pin file loading (#24)

* save

* save

* removed submodule to add again

* add ayon-cpp-dev-tools

* implemented pinning file loading for the resolver

* cleand up build.sh

* implemented build.py to replace build.bat and build.sh

* upaded build.py

* moved old build scripts and changed CMakeLists.txt to include CppDevTools

* updated all documentation and added new documentation for devs and Admins, implemented drop_cache added some more python wrappers

* re organised and refactored small part of _Resolve() func to only use one for loop to get active context

* add documentation generation via pages

* removed adding pages setup so i can have a seperate pr

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Robin De Lillo <[email protected]>

* Update scripts/build.py

Co-authored-by: Robin De Lillo <[email protected]>

* changed names and text for PR

* added extra info to the Dev docs on how to use pinning suport with excample code, also expanded on the general excamples

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* fixed a typo in a class

* updated the information about TF_DEBUG inside admin docs

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* pinning file loading now allows for key and value root replace

* upade for compile

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Admin_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* Update Docs/Ayon_Docs/Dev_Docs.md

Co-authored-by: Roy Nieterau <[email protected]>

* removed docs to handle them in seperate pr

* added back the docs generation as it was in develop branch

* fixes for git modules file

---------

Co-authored-by: Lyon_Rosenblatt <[email protected]>
Co-authored-by: Robin De Lillo <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: ynput <[email protected]>

---------

Co-authored-by: Ondřej Samohel <[email protected]>
Co-authored-by: Ondřej Samohel <[email protected]>
Co-authored-by: Lyon-Rosenblatt-Ynput <[email protected]>
Co-authored-by: Lyon_Rosenblatt <[email protected]>
Co-authored-by: ynput <[email protected]>
Co-authored-by: Roy Nieterau <[email protected]>
Co-authored-by: Robin De Lillo <[email protected]>
  • Loading branch information
8 people authored Sep 13, 2024
1 parent fffc9b4 commit d90600d
Show file tree
Hide file tree
Showing 32 changed files with 1,000 additions and 83 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "ext/ayon-cpp-api"]
path = ext/ayon-cpp-api
url = https://github.com/ynput/ayon-cpp-api.git

[submodule "ext/ayon-cpp-dev-tools"]
path = ext/ayon-cpp-dev-tools
url = https://github.com/ynput/ayon-cpp-dev-tools.git
2 changes: 2 additions & 0 deletions BuildPlugins/AyonUsdLinux/AyonUsd23_5_Py39_Linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ execute_process(
OUTPUT_VARIABLE Python_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if (NOT ${Python_VERSION} STREQUAL 3.9) # Check if System Installed Python version is 3.9
message(FATAL_ERROR "Python version: ${Python_VERSION}")
endif()
Expand All @@ -42,6 +43,7 @@ set(AR_PYTHON_LIB_NUMBER python39)
set(AR_PYTHON_LIB_DIR ${Python_Base_Dir})
set(AR_PYTHON_INCLUDE_DIR ${Python_Base_Dir}/python3.9)


# setting up boost
add_compile_definitions(BOOST_ALL_NO_LIB)
set(AR_BOOST_NAMESPACE boost)
Expand Down
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ set(AR_AYONUSDRESOLVER_TARGET_LIB ayonUsdResolver)
set(AR_AYONUSDRESOLVER_TARGET_PYTHON _${AR_AYONUSDRESOLVER_TARGET_LIB})
set(AR_AYONUSDRESOLVER_INSTALL_PREFIX ${AR_PROJECT_NAME}/${AR_AYONUSDRESOLVER_USD_PLUGIN_NAME})

set(MACRO_REMOVE_SDF_FORMAT_ARGS 1)


# shared library setup commands
if (WIN32)
Expand Down Expand Up @@ -104,12 +106,26 @@ if(NOT DEFINED BOOST_LIB_DIR)
message(FATAL_ERROR "BOOST_LIB_DIR is not defined. Please set it before continuing.")
endif()

message(STATUS "AR_PXR_INCLUDE_DIR path: ${AR_PXR_INCLUDE_DIR}")
message(STATUS "AR_PXR_LIB_DIR path: ${AR_PXR_LIB_DIR}")
message(STATUS "AR_PXR_LIB_PREFIX path: ${AR_PXR_LIB_PREFIX}")
message(STATUS "AR_PYTHON_LIB_NUMBER path: ${AR_PYTHON_LIB_NUMBER}")
message(STATUS "AR_PYTHON_LIB_DIR path: ${AR_PYTHON_LIB_DIR}")
message(STATUS "AR_PYTHON_INCLUDE_DIR path: ${AR_PYTHON_INCLUDE_DIR}")
message(STATUS "AR_BOOST_INCLUDE_DIR path: ${AR_BOOST_INCLUDE_DIR}")
message(STATUS "BOOST_LIB_DIR path: ${BOOST_LIB_DIR}")

message(STATUS "SDF_FORMAT_ARGS = ${MACRO_REMOVE_SDF_FORMAT_ARGS}")
add_compile_definitions(MACRO_REMOVE_SDF_FORMAT_ARGS=${MACRO_REMOVE_SDF_FORMAT_ARGS})

# Include AyonDevTools
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-dev-tools")

message(STATUS "Enable SDF_FORMAT_ARGS Remove Macro = ${MACRO_REMOVE_SDF_FORMAT_ARGS}")
# Include AyonCppApi
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api")


# setting CXX11ABI infos
if(DEFINED GLIBCXX_USE_CXX11_ABI)
message(STATUS "Setting Up CXX11_ABI linking")
Expand Down
8 changes: 6 additions & 2 deletions Docs/src/md/Getting_Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ from usdAssetResolver import AyonUsdResolver
Ar.SetPreferredResolver("AyonUsdResolver")
```


> **note**
> When you get a resolver via `Usd.Ar` API you will need to get an explicit context to
> edit the global context as `Ar.GetResolver` will return a higher order class and
Expand Down Expand Up @@ -219,6 +220,7 @@ duplicates in the keys but the Cache stores the data as an Unordered_Map so it
will end up deduplicating the Keys. But you can't have spaces in the list as
they are not removed and will be interpreted as part of the Key or Value.


**example**\n
setup the resolver for pinning support. we empty all the AYON c++ api keys just
for example you can simply not set them.
Expand Down Expand Up @@ -247,6 +249,7 @@ print(stage.ExportToString())

PS: its interesting to know that when you generate a pinning file via the
AYON-USD addon the json file will have a key named

`ayon_pinning_data_entry_scene`.\n
This should always be the path used to open the stage Otherwise the pinning file
might not have the correct AssetIdentifier stored.\n
Expand All @@ -258,12 +261,14 @@ local path the resolver wont be able to resolve.
`context = AyonUsdResolver.ResolverContext()` there are multiple ways to control
the cache of a resolver. but if your resolver uses the global cache you can
simply create a new ResolverContext and access the cache control functions to

affect the global cache.\n
This does not work if you disconnected the Global cache from your resolver.

`context.deleteFromCache(AssetIdentifier)` delete an individual cached entry.
`context.clearCache()` clear the connected cache.


> **note**
> It is important to understand that by default a Resolver will be connected to the global cache
> and this call will delete all entries in the global cache not just the ones that
Expand All @@ -276,6 +281,7 @@ global cache and have a Resolver local cache instead.
`explicit_resolver = AyonUsdResolver.Resolver()` if you need to create an
explicit resolver because you want to e.g pass a specific instance into a stage
or you want to disconnect from the Global Cache you should access the Context

connected to this specific resolver.\n
`explicit_resolver_context = explicit_resolver.GetConnectedContext()` all the
other functions stay the same.
Expand Down Expand Up @@ -307,5 +313,3 @@ explicit_resolver_context.dropCache()

# Delete from cache and clearCache will also work with an explicit_resolver_context
```


27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Introduction


The [AYON](https://ynput.io/ayon/) USD Resolver is
[an asset resolver plugin](https://openusd.org/release/api/ar_page_front.html#ar_uri_resolvers)
for [Pixar's USD](https://openusd.org). It's designed to turn URIs with the
Expand All @@ -12,20 +13,31 @@ AYON compatible entity URIs through the
[AyonCppApi](<(https://github.com/ynput/ayon-cpp-api/)>).

> [!IMPORTANT]\
> This repository uses Git Submodules. Make
> sure to use the correct `git clone` commands accordingly.
> This repository uses Git Submodules. Make sure to use the correct `git clone`
> commands accordingly.\
> `git clone --recurse-submodules https://github.com/ynput/ayon-usd-resolver.git`\
> `git submodule update --init --recursive`
> [!IMPORTANT]\
> The [AYON](https://ynput.io/ayon/) USD Resolver is a
> The [AYON](https://ynput.io/ayon/) USD Resolver is an
> [AR2.0](https://openusd.org/release/wp_ar2.html) resolver and will not support
> packages that only support AR1.0
> AR1.0 resolution. Make sure that your software package is compatible with the
> AR2.0 standard or use the **defaults** we provide in the
> [AYON Usd Addon](https://github.com/ynput/ayon-usd)
> **NOTE**\
> **Admin** and **Dev** docs can be found under `/Docs/Ayon_Docs/`
# Repository Docs


### Requirements:

- C++ Compiler
- Cmake
- GitHub public key setup (this is because the sub-modules are linked via git@)
- Target DCC / SDK installed
- python3 development files (Optional when building Against AYON Usd)


### Tested Platforms:

Expand All @@ -34,10 +46,9 @@ AYON compatible entity URIs through the
- Hou 19.5.900
- Hou 20.0.590
- Hou 20.0.630
- Maya 2024.2(UsdAddon_0.25.0)
- Unreal5.4
- AyonUsd23_5_py39 (System Python install)
- Maya2024_2
- Maya2025_2
- Unreal5_4

- Windows 10
- Hou 19.5.805
Expand Down
169 changes: 169 additions & 0 deletions scripts/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
import subprocess
import argparse
import os
import shutil
import multiprocessing
import time
import platform

compile_plugin = os.environ.get("COMPILEPLUGIN")
script_dir = os.path.dirname(__file__)
prj_root_dir = os.path.dirname(script_dir)
build_dir = os.path.join(prj_root_dir, "build")
resolvers_dir = os.path.join(prj_root_dir, "Resolvers")
current_resolver_dir = os.path.join(resolvers_dir, str(compile_plugin))
max_cores = multiprocessing.cpu_count()

bin_package_path = os.path.join(resolvers_dir, "AyonUsdResolverBin")
temp_dir_for_zip = os.path.join(resolvers_dir, "temp")

zip_sub_path = f"{str(compile_plugin)}_{platform.system()}_{platform.machine()}"
zip_path = os.path.join(bin_package_path, zip_sub_path)


def generate_named_zip(resolver_source_path: str):
zip_inner_foulder_name = os.path.basename(zip_path)
zip_inner_foulder_path = os.path.join(temp_dir_for_zip, zip_inner_foulder_name)

if os.path.exists(temp_dir_for_zip):
shutil.rmtree(temp_dir_for_zip)
os.makedirs(zip_inner_foulder_path)

shutil.copytree(resolver_source_path, zip_inner_foulder_path, dirs_exist_ok=True)
os.makedirs(bin_package_path, exist_ok=True)
shutil.make_archive(zip_path, "zip", temp_dir_for_zip)

shutil.rmtree(temp_dir_for_zip)


def cmake_get_vars():
vars_dict = {}
process = subprocess.run(
["cmake", "-LAH", ".", "-B", "build"],
stdout=subprocess.PIPE,
text=True,
universal_newlines=True,
# check=True,
)
for i in process.stdout.split("//"):
for x in i.split("\n"):
if ":" in x:
key_val = x.split(":")
vars_dict[key_val[0]] = key_val[1]
return vars_dict


def cmake(*args):
command = ["cmake"]
command.extend(*args)
subprocess.run(
command,
check=True,
)


class _StoreDictKeyPair(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
extra_env_var_dict = {}
for kv in values.split(","):
k, v = kv.split("=")
extra_env_var_dict[k] = v
setattr(namespace, self.dest, extra_env_var_dict)


def main():
cmd_args = argparse.ArgumentParser(
description="Ayon Usd Resolver main Build Script"
)
cmd_args.add_argument(
"--DEV", help="Enable/Disable development build", type=int, default=0
)
cmd_args.add_argument(
"--JTRACE", help="Enable/Disable json tracing", type=int, default=0
)
cmd_args.add_argument(
"--Clean",
action="store_true",
help="delet build foulder for non cached build also adds --clean-first to cmake args",
)
cmd_args.add_argument(
"--CompilePlugin",
type=str,
default=0,
help="select a compile plugin, this can be scipped if you set COMPILEPLUGIN env variable ",
)
cmd_args.add_argument(
"--extra_env_vars",
dest="extra_env_var_dict",
action=_StoreDictKeyPair,
metavar="KEY1=VAL1,KEY2=VAL2...",
)
cmd_args = cmd_args.parse_args()

if cmd_args.extra_env_var_dict:
for key in cmd_args.extra_env_var_dict:
val = cmd_args.extra_env_var_dict[key]
os.environ[key] = val

if cmd_args.CompilePlugin:
os.environ["COMPILEPLUGIN"] = cmd_args.CompilePlugin
global compile_plugin
global current_resolver_dir
compile_plugin = os.environ.get("COMPILEPLUGIN")
current_resolver_dir = os.path.join(resolvers_dir, compile_plugin)

if not compile_plugin:
raise RuntimeError("No Compile plugin selected")

prior_compile_vars = cmake_get_vars()
last_compile_plugin = str(prior_compile_vars.get("SelectedCompilePlugin")).split(
"="
)[-1]
if not compile_plugin == last_compile_plugin:

print(
"Last Selected Compile plgin is not the same as the current",
compile_plugin,
last_compile_plugin,
)
cmd_args.Clean = True

if cmd_args.Clean:
print("Running Clean Build")
if os.path.exists(build_dir):
shutil.rmtree(build_dir)
os.makedirs(build_dir, exist_ok=True)
if os.path.exists(current_resolver_dir):
shutil.rmtree(current_resolver_dir)

construct_command = [
".",
"-B",
"build",
f"-DDEV={cmd_args.DEV}",
f"-DJTRACE={cmd_args.JTRACE}",
]
cmake(construct_command)

build_comand = ["--build", "build"]
if cmd_args.DEV:
build_comand.extend(["--config", "Debug"])
else:
build_comand.extend(["--config", "Release"])
if cmd_args.Clean:
build_comand.extend(["--clean-first"])
build_comand.extend(["--parallel", str(max_cores)])
cmake(build_comand)

install_command = ["--install", "build"]
cmake(install_command)


if __name__ == "__main__":
os.chdir(prj_root_dir)
start_time = time.time()
main()
generate_named_zip(current_resolver_dir)
end_time = time.time()
build_time = end_time - start_time
print("build took", build_time, "seconds")
7 changes: 7 additions & 0 deletions scripts/old/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cd ../

rmdir /s /q build

cmake -S . -B build -DDEV=0 -DJTRACE=0 -DCMAKE_BUILD_TYPE=Release
cmake --build build --clean-first --config Release
cmake --install build
42 changes: 42 additions & 0 deletions scripts/old/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
set -e # Exit on error
cd ../ #move to root dir
#----------- Build Script Paths ------------
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

echo $SCRIPT_DIR
if [ -z "$HOUDINI_INSTALL_DIR" ]; then
HOUDINI_INSTALL_DIR="/opt/hfs" # if you didn't set the Install dir variable we assume your Houdini is installed in the default directory
fi
export HFS="${HOUDINI_INSTALL_DIR}${HOU_VER}"

CLEAN_BUILD=0
DEV=0
JTRACE=0

if [[ " $@ " =~ " Debug " ]]; then
echo "Build running in debug mode"
DEV=1

source devOpVars.sh
echo " dev var is set to $DEV"
fi

if [[ " $@ " =~ " Clean " ]]; then
echo "Running Clean Build"
CLEAN_BUILD=1

rm -rf build
rm -rf Resolvers/${COMPILEPLUGIN}
mkdir build
fi



cmake . -B build -DDEV=$DEV -DJTRACE=$JTRACE
if [ "$CLEAN_BUILD" -eq 1 ]; then
cmake --build build --clean-first
else
cmake --build build
fi
cmake --install build
File renamed without changes.
Loading

0 comments on commit d90600d

Please sign in to comment.