### Install Third-party Libraries and Setup Environment Source: https://github.com/lynx-family/lynx/blob/develop/explorer/darwin/ios/README.md Navigates to the Lynx directory, syncs third-party libraries, and sets up the development environment using tools/envsetup.sh. ```bash cd lynx tools/hab sync . source tools/envsetup.sh ``` -------------------------------- ### Install Lynx Dependencies Source: https://github.com/lynx-family/lynx/blob/develop/explorer/windows/README.md Navigate to the Lynx repository root and execute setup scripts to install third-party libraries and synchronize the environment. ```shell cd lynx .\tools\envsetup.ps1 .\tools\hab.ps1 sync . --target clay ``` -------------------------------- ### Install Appium and Dependencies Source: https://github.com/lynx-family/lynx/blob/develop/testing/integration_test/ENV_SETUP.md Execute environment preparation scripts, sync dependencies, and install Appium and appium-doctor globally using npm. Finally, run appium-doctor to verify the setup. ```bash source tools/envsetup.sh tools/hab sync -f . npm install -g appium@2.11.2 npm install -g appium-doctor appium-doctor ``` -------------------------------- ### Basic Element API Usage Source: https://github.com/lynx-family/lynx/blob/develop/js_libraries/type-element-api/README.md Example of how to use the Element API after installing the necessary dependencies. This demonstrates creating a view reference. ```typescript let pid = 10; let viewRef = __CreateView(10); ``` -------------------------------- ### Install RapidJSON System-Wide Source: https://github.com/lynx-family/lynx/blob/develop/third_party/rapidjson/readme.md Install the RapidJSON library system-wide after building. ```bash make install ``` -------------------------------- ### Install iOS Project Dependencies Source: https://github.com/lynx-family/lynx/blob/develop/explorer/darwin/ios/README.md Installs the necessary dependencies for the iOS project using a bundle install script. This should be run from the ios/lynx_explorer directory. ```bash cd explorer/darwin/ios/lynx_explorer ./bundle_install.sh ``` -------------------------------- ### Install Lynx XElement WebView Source: https://github.com/lynx-family/lynx/blob/develop/platform/harmony/lynx_xelement/webview/README.md Install the Lynx XElement WebView package using ohpm. ```bash ohpm install @lynx/xelement-webview ``` -------------------------------- ### Install Third-party Libraries Source: https://github.com/lynx-family/lynx/blob/develop/explorer/darwin/macos/README.md Navigate to the repository root and run these commands to install necessary dependencies. Ensure you have sourced the envsetup.sh script first. ```shell cd lynx source tools/envsetup.sh tools/hab sync . --target clay ``` -------------------------------- ### Install LynxBase Source: https://github.com/lynx-family/lynx/blob/develop/base/platform/harmony/README.md Install the LynxBase package using ohpm. ```bash ohpm install @lynx/lynx_base ``` -------------------------------- ### Install Lynx XElement Markdown Source: https://github.com/lynx-family/lynx/blob/develop/platform/harmony/lynx_xelement/markdown/README.md Install the markdown package using ohpm. ```bash ohpm install @lynx/xelement_markdown ``` -------------------------------- ### Install Lynx Package Source: https://github.com/lynx-family/lynx/blob/develop/platform/harmony/lynx_harmony/README.md Install the Lynx package for Harmony OS using ohpm. ```bash ohpm install @lynx/lynx ``` -------------------------------- ### Bash Commands to Install Espresso Driver Source: https://github.com/lynx-family/lynx/blob/develop/platform/specs/lynx_video_element_spec.md Lists installed Appium drivers and installs the Espresso driver. The Espresso driver is necessary for Android-specific testing. ```bash appium driver list --installed appium driver install espresso ``` -------------------------------- ### Configure and Install pkg-config File Source: https://github.com/lynx-family/lynx/blob/develop/third_party/jsoncpp/CMakeLists.txt Generates the jsoncpp.pc file from a template and installs it to the pkg-config directory if pkg-config support is enabled. ```cmake CONFIGURE_FILE( "pkg-config/jsoncpp.pc.in" "pkg-config/jsoncpp.pc" @ONLY) INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/pkg-config/jsoncpp.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ``` -------------------------------- ### Install RapidJSON with vcpkg Source: https://github.com/lynx-family/lynx/blob/develop/third_party/rapidjson/readme.md Use vcpkg to install RapidJSON with CMake integration. ```bash vcpkg install rapidjson ``` -------------------------------- ### Install Lynx Log Service Source: https://github.com/lynx-family/lynx/blob/develop/platform/harmony/lynx_services/lynx_log_service/README.md Install the Lynx Log Service package using ohpm. ```bash ohpm install @lynx/lynx_log_service ``` -------------------------------- ### Install Lynx DevTool Service Source: https://github.com/lynx-family/lynx/blob/develop/platform/harmony/lynx_services/lynx_devtool_service/README.md Install the Lynx DevTool Service package using ohpm. ```bash ohpm install @lynx/lynx_devtool_service ``` -------------------------------- ### Install JsonCpp with Conan Source: https://github.com/lynx-family/lynx/blob/develop/third_party/jsoncpp/README.md Command to install JsonCpp and its dependencies using Conan. ```bash conan install --build missing ``` -------------------------------- ### Install Android Components Source: https://github.com/lynx-family/lynx/blob/develop/explorer/android/README.md Installs Android SDK/NDK and other required components for Lynx. Authorization may be required. ```python python3 tools/android_tools/prepare_android_build.py ``` -------------------------------- ### Basic Decorator Example Source: https://github.com/lynx-family/lynx/blob/develop/third_party/binding/idl-codegen/third_party/doc/build/filtering.rst This example shows a simple decorator that writes 'BAR' before and after the decorated function's output. ```mako <%! def bar(fn): def decorate(context, *args, **kw): context.write("BAR") fn(*args, **kw) context.write("BAR") return '' return decorate %> <%def name="foo()" decorator="bar"> this is foo ${foo()} ``` -------------------------------- ### Install Appium Drivers Source: https://github.com/lynx-family/lynx/blob/develop/testing/integration_test/ENV_SETUP.md Install the required Appium drivers if they are not already present. The essential drivers are xcuitest, uiautomator2, and espresso. ```bash appium driver install xcuitest appium driver install uiautomator2 appium driver install espresso ``` -------------------------------- ### Install Lynx XElement SVG Source: https://github.com/lynx-family/lynx/blob/develop/platform/harmony/lynx_xelement/svg/README.md Install the Lynx XElement SVG package using ohpm. ```bash ohpm install @lynx/xelement-svg ``` -------------------------------- ### Bash Commands to Start Emulator Source: https://github.com/lynx-family/lynx/blob/develop/platform/specs/lynx_video_element_spec.md Lists available Android Virtual Devices (AVDs) and starts a specified emulator with network delay and speed settings. Replace with your AVD's name. ```bash $ANDROID_HOME/emulator/emulator -list-avds $ANDROID_HOME/emulator/emulator -avd -netdelay none -netspeed full ``` -------------------------------- ### Start Appium Server Source: https://github.com/lynx-family/lynx/blob/develop/testing/integration_test/ENV_SETUP.md Start the Appium server on a specified port. The Appium process must remain active throughout the execution of test cases. ```bash appium --port 4723 ``` -------------------------------- ### Install LynxExplorer APK (adb) Source: https://github.com/lynx-family/lynx/blob/develop/explorer/android/README.md Installs the generated LynxExplorer APK on a connected device using the adb command. ```bash adb install lynx_explorer/build/outputs/apk/noasan/debug/LynxExplorer-noasan-debug.apk ``` -------------------------------- ### PLY Calculator Example Source: https://github.com/lynx-family/lynx/blob/develop/third_party/binding/idl-codegen/third_party/ply/README.md A complete example demonstrating how to build a lexer and parser for a simple calculator with variable support using PLY. This includes token definitions, grammar rules, and execution logic. ```python # ----------------------------------------------------------------------------- # calc.py # # A simple calculator with variables. # ----------------------------------------------------------------------------- tokens = ( 'NAME','NUMBER', 'PLUS','MINUS','TIMES','DIVIDE','EQUALS', 'LPAREN','RPAREN', ) # Tokens t_PLUS = r'\+' t_MINUS = r'-' t_TIMES = r'\*' t_DIVIDE = r'/' t_EQUALS = r'=' t_LPAREN = r'\(' t_RPAREN = r'\)' t_NAME = r'[a-zA-Z_][a-zA-Z0-9_]*' def t_NUMBER(t): r'\d+' t.value = int(t.value) return t # Ignored characters t_ignore = " \t" def t_newline(t): r'\n+' t.lexer.lineno += t.value.count("\n") def t_error(t): print("Illegal character '%s'" % t.value[0]) t.lexer.skip(1) # Build the lexer import ply.lex as lex lex.lex() # Precedence rules for the arithmetic operators precedence = ( ('left','PLUS','MINUS'), ('left','TIMES','DIVIDE'), ('right','UMINUS'), ) # dictionary of names (for storing variables) names = { } def p_statement_assign(p): 'statement : NAME EQUALS expression' names[p[1]] = p[3] def p_statement_expr(p): 'statement : expression' print(p[1]) def p_expression_binop(p): '''expression : expression PLUS expression | expression MINUS expression | expression TIMES expression | expression DIVIDE expression''' if p[2] == '+' : p[0] = p[1] + p[3] elif p[2] == '-': p[0] = p[1] - p[3] elif p[2] == '*': p[0] = p[1] * p[3] elif p[2] == '/': p[0] = p[1] / p[3] def p_expression_uminus(p): 'expression : MINUS expression %prec UMINUS' p[0] = -p[2] def p_expression_group(p): 'expression : LPAREN expression RPAREN' p[0] = p[2] def p_expression_number(p): 'expression : NUMBER' p[0] = p[1] def p_expression_name(p): 'expression : NAME' try: p[0] = names[p[1]] except LookupError: print("Undefined name '%s'" % p[1]) p[0] = 0 def p_error(p): print("Syntax error at '%s'" % p.value) import ply.yacc as yacc yacc.yacc() while True: try: s = raw_input('calc > ') # use input() on Python 3 except EOFError: break yacc.parse(s) ``` -------------------------------- ### Install CMake Package Configuration Source: https://github.com/lynx-family/lynx/blob/develop/third_party/jsoncpp/CMakeLists.txt Installs the CMake package configuration file (jsoncppConfig.cmake) if CMake package support is enabled. ```cmake INSTALL(EXPORT jsoncpp DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp FILE jsoncppConfig.cmake) ``` -------------------------------- ### Example Usage of RTF Coverage Check Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/plugins/README.md An example command demonstrating how to run the coverage check for Android, specifying the input file, threshold, and job name. ```commandline rtf coverage-check --type android --inputs coverage.xml --threshold 0.5 --job "android-coverage-check" ``` -------------------------------- ### Install Lynx Image Service Source: https://github.com/lynx-family/lynx/blob/develop/platform/harmony/lynx_services/lynx_image_service/README.md Install the Lynx Image Service package using ohpm. This command is used to add the service as a dependency to your project. ```bash ohpm install @lynx/lynx_image_service ``` -------------------------------- ### Download and Install Python Packages Source: https://github.com/lynx-family/lynx/blob/develop/third_party/py_deps/README.md Use this script to download and install Python packages locally for vendoring. Ensure all downloaded wheels are pure Python. This process includes transitive dependencies. ```bash pkg="package-name==version" dest_dir="lynx/third_party/py_deps" workdir="$(mktemp -d)" python3 -m pip download \ --dest "$workdir/wheels" \ --only-binary=:all: \ --platform any \ --implementation py \ --python-version 3 \ --abi none \ "$pkg" # This includes transitive dependencies. Every downloaded wheel must be pure # Python. The command should print nothing. find "$workdir/wheels" -type f ! -name '*-none-any.whl' -print python3 -m pip install \ --no-index \ --find-links "$workdir/wheels" \ --only-binary=:all: \ --no-compile \ --target "$workdir/site" \ "$pkg" # If updating existing packages, remove their old package directories and # matching *.dist-info directories from "$dest_dir" before copying. rsync -a "$workdir/site/" "$dest_dir/" ``` -------------------------------- ### Install OpenJDK 11 on Windows Source: https://github.com/lynx-family/lynx/blob/develop/explorer/android/README.md Installs the OpenJDK 11 Development Kit on Windows using the winget package manager. This ensures the correct Java version is available for the Android build. ```powershell winget install -e --id ojdkbuild.openjdk.11.jdk ``` -------------------------------- ### Install Lynx Explorer HAP using hdc Source: https://github.com/lynx-family/lynx/blob/develop/explorer/harmony/README.md Install the built Lynx Explorer HAP (Harmony Application Package) onto a harmony virtual device using the 'hdc' command-line tool. This is a post-build step. ```bash hdc install explorer/harmony/lynx_explorer/build/default/outputs/default/lynx_explorer-default-unsigned.hap ``` -------------------------------- ### Show Init Project help Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/plugins/README.md Displays the help message for initializing a project, including options for specifying the workspace path. ```commandline rtf init project -h usage: app.py init project [-h] [-p PATH] optional arguments: -h, --help show this help message and exit -p PATH, --path PATH Specify the workspace path (default: '.') ``` -------------------------------- ### Initialize Environment and Sync Dependencies Source: https://github.com/lynx-family/lynx/blob/develop/testing/README_UT.md Execute these commands to set up the testing environment and synchronize necessary dependencies before running tests. ```bash source tools/envsetup.sh tools/hab sync . ``` -------------------------------- ### Initialize Project Environment Source: https://github.com/lynx-family/lynx/blob/develop/explorer/harmony/README.md After cloning the repository, navigate to the project root and execute environment setup scripts. This command syncs project dependencies. ```bash cd lynx source tools/envsetup.sh tools/hab sync . ``` -------------------------------- ### Implementing a Simple Local Dictionary Cache Source: https://github.com/lynx-family/lynx/blob/develop/third_party/binding/idl-codegen/third_party/doc/caching.html Define a custom cache implementation by subclassing CacheImpl and overriding methods like get_or_create, set, get, and invalidate. This example uses a local dictionary. ```python from mako.cache import CacheImpl, register_plugin class SimpleCacheImpl(CacheImpl): def __init__(self, cache): super(SimpleCacheImpl, self).__init__(cache) self._cache = {} def get_or_create(self, key, creation_function, **kw): if key in self._cache: return self._cache[key] else: self._cache[key] = value = creation_function() return value def set(self, key, value, **kwargs): self._cache[key] = value def get(self, key, **kwargs): return self._cache.get(key) def invalidate(self, key, **kwargs): self._cache.pop(key, None) # optional - register the class locally register_plugin("simple", __name__, "SimpleCacheImpl") ``` -------------------------------- ### Get Text Bounding Rectangles Source: https://github.com/lynx-family/lynx/blob/develop/js_libraries/types/skills/text.md Retrieves the bounding rectangles for a specified character range within a text element. This is useful for positioning UI elements relative to specific text segments. The range is defined by start and end indices. ```tsx function locateTextRange() { lynx .createSelectorQuery() .select('#selectable-text') .invoke({ method: 'getTextBoundingRect', params: { start: 5, end: 10, }, success: (res) => { console.log('range bounding rect', res.boundingRect) // You can position a tooltip or menu near res.boundingRect.left/top. }, }) .exec() } ``` -------------------------------- ### Build and Run on Windows Source: https://github.com/lynx-family/lynx/blob/develop/clay/example/glfw/README.md Instructions for building and running the GLFW example on Windows systems. Involves setting up environment variables via PowerShell, syncing dependencies, generating build files with GN, and building with Ninja. ```powershell tools\envsetup.ps1 tools\hab.ps1 sync . -f --target clay buildtools\gn\gn.exe gen out\Default --args="enable_clay_standalone = true disable_visibility_hidden = true use_ndk_static_cxx = false enable_linker_map = false enable_clay = true is_headless = true skia_enable_flutter_defines = true skia_use_dng_sdk = false skia_use_sfntly = false skia_enable_pdf = false skia_enable_svg = true enable_svg = true skia_enable_skottie = true skia_use_x11 = false skia_use_wuffs = true skia_use_expat = true skia_use_fontconfig = false clay_enable_skshaper = true skia_use_icu = true allow_deprecated_api_calls = true stripped_symbols = true is_official_build = true is_debug = false use_clang_static_analyzer = false enable_lto = false enable_libcpp_abi_namespace_cr = true use_flutter_cxx = true enable_desktop_embeddings = true is_clang = true" buildtools\ninja\ninja.exe -C out\Default\ clay\example\glfw .\out\Default\clay_glfw.exe ``` -------------------------------- ### Show Init Template help Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/plugins/README.md Displays the help message for initializing a test template, detailing required arguments like template type and name. ```commandline rtf init template -h usage: app.py init template [-h] -t TEMPLATE_TYPE -n TEMPLATE_NAME optional arguments: -h, --help show this help message and exit -t TEMPLATE_TYPE, --type TEMPLATE_TYPE Template type to initialize -n TEMPLATE_NAME, --name TEMPLATE_NAME Template name to initialize ``` -------------------------------- ### Install Signed APK Source: https://github.com/lynx-family/lynx/blob/develop/platform/specs/lynx_video_element_spec.md Installs the re-signed APK onto the device. It first uninstalls any existing version of the application to ensure a clean installation. ```bash adb uninstall com.lynx.explorer || true adb install -r /tmp/LynxExplorer-noasan-debug-espresso-testkey.apk ``` -------------------------------- ### Verify JDK Installation on MacOS/Windows Source: https://github.com/lynx-family/lynx/blob/develop/explorer/android/README.md Confirms that the JDK installation was successful by checking the installed Java compiler version. A successful output indicates version 11. ```bash javac --version ``` -------------------------------- ### Show InitPlugin help Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/plugins/README.md Displays the help message for the init plugin, outlining available subcommands like 'project' and 'template'. ```commandline rtf init -h usage: app.py init [-h] {project,template} ... optional arguments: -h, --help show this help message and exit init_type: valid init commands {project,template} project init project template init template ``` -------------------------------- ### Build and Run on MacOSX or Linux Source: https://github.com/lynx-family/lynx/blob/develop/clay/example/glfw/README.md Instructions for building and running the GLFW example on MacOSX or Linux systems. Requires setting up environment variables, syncing dependencies, generating build files with GN, and then building with Ninja. ```shell source tools/envsetup.sh tools/hab sync . -f --target clay buildtools/gn/gn gen out/Default --args='enable_clay_standalone = true disable_visibility_hidden = true use_ndk_static_cxx = false enable_linker_map = false enable_clay = true is_headless = true skia_enable_flutter_defines = true skia_use_dng_sdk = false skia_use_sfntly = false skia_enable_pdf = false skia_enable_svg = true enable_svg = true skia_enable_skottie = true skia_use_x11 = false skia_use_wuffs = true skia_use_expat = true skia_use_fontconfig = false clay_enable_skshaper = true skia_use_icu = true skia_gl_standard = "" allow_deprecated_api_calls = true stripped_symbols = true is_official_build = true is_debug = false use_clang_static_analyzer = false enable_lto = false' --export-compile-commands buildtools/ninja/ninja -C out/Default clay/example/glfw ./out/Default/clay_glfw ``` -------------------------------- ### Example JSON Data Source: https://github.com/lynx-family/lynx/blob/develop/third_party/jsoncpp/doc/jsoncpp.dox A basic example of JSON data structure. ```json { "encoding" : "UTF-8", "plug-ins" : [ "python", "c++", "ruby" ], "indent" : { "length" : 3, "use_space": true } } ``` -------------------------------- ### Fix Ruby Gem Installation Errors Source: https://github.com/lynx-family/lynx/blob/develop/explorer/darwin/ios/README.md Provides commands to resolve Bundler::GemNotFound errors by specifying the SDK root before installing gems and then running the bundle install script. ```bash SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk bundle install ./bundle_install.sh ``` -------------------------------- ### Initialize Project in Current Path Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/plugins/README.md Initializes a new project in the current directory. This is the default behavior when no path is specified. ```commandline rtf init project --path . ``` -------------------------------- ### Bash Environment Setup and Hab Sync (Target Dev) Source: https://github.com/lynx-family/lynx/blob/develop/platform/specs/lynx_video_element_spec.md This command demonstrates an incorrect way to sync, specifically using --target-only, which may lead to missing build tools. Avoid this pattern. ```bash tools/hab sync . -f --target dev --target-only ``` -------------------------------- ### Bash Environment Setup Script Source: https://github.com/lynx-family/lynx/blob/develop/platform/specs/lynx_video_element_spec.md Sources the envsetup.sh script and runs hab sync to prepare the environment for integration tests. This is a prerequisite for many build and test operations. ```bash source tools/envsetup.sh tools/hab sync . -f python3 tools/android_tools/prepare_android_build.py ``` -------------------------------- ### Find and Install JSONCPP Headers Source: https://github.com/lynx-family/lynx/blob/develop/third_party/jsoncpp/include/CMakeLists.txt This snippet demonstrates how to locate and install JSONCPP header files using CMake's GLOB and INSTALL commands. It assumes JSONCPP headers are in a 'json' subdirectory. ```cmake FILE(GLOB INCLUDE_FILES "json/*.h") INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/json) ``` -------------------------------- ### Initialize RTF Project Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/README.md Initialize a repository with the RTF init plugin. This creates a .rtf folder in the initialization directory. Use the --path argument to specify the directory. ```commandline rtf init -h ``` ```commandline rtf init project --path . ``` -------------------------------- ### HarmonyOS LynxView Initialization Source: https://github.com/lynx-family/lynx/blob/develop/tools/api/docs/templates/load-template.mdx Demonstrates how to initialize LynxView on HarmonyOS, passing necessary parameters like URL, buffer, and metadata. Requires the LynxViewClient implementation. ```typescript import { LynxView, MetaData, TemplateData, LynxLoadOption } from '@lynx'; @Entry @Component struct Index { private url: string = 'playground/main.lynx.bundle'; private buffer: ArrayBuffer = getTemplateBuffer(); private metaData = new MetaData( new TemplateData('{"text":"TD"}'), new TemplateData({ "theme": "Light" })); build() { Column() { LynxView({ url: this.url, buffer: this.buffer, metadata: this.metaData, }).width('100%').height('100%'); } .size({ width: '100%', height: '100%' }) } } ``` -------------------------------- ### JsonCpp Core Usage Example Source: https://github.com/lynx-family/lynx/blob/develop/third_party/jsoncpp/doc/jsoncpp.dox Illustrates basic JSON parsing, value retrieval, iteration, and writing using JsonCpp. ```cpp Json::Value root; // 'root' will contain the root value after parsing. std::cin >> root; // You can also read into a particular sub-value. std::cin >> root["subtree"]; // Get the value of the member of root named 'encoding', // and return 'UTF-8' if there is no such member. std::string encoding = root.get("encoding", "UTF-8" ).asString(); // Get the value of the member of root named 'plug-ins'; return a 'null' value if // there is no such member. const Json::Value plugins = root["plug-ins"]; // Iterate over the sequence elements. for ( int index = 0; index < plugins.size(); ++index ) loadPlugIn( plugins[index].asString() ); // Try other datatypes. Some are auto-convertible to others. foo::setIndentLength( root["indent"].get("length", 3).asInt() ); foo::setIndentUseSpace( root["indent"].get("use_space", true).asBool() ); // Since Json::Value has an implicit constructor for all value types, it is not // necessary to explicitly construct the Json::Value object. root["encoding"] = foo::getCurrentEncoding(); root["indent"]["length"] = foo::getCurrentIndentLength(); root["indent"]["use_space"] = foo::getCurrentIndentUseSpace(); // If you like the defaults, you can insert directly into a stream. std::cout << root; // Of course, you can write to `std::ostringstream` if you prefer. // If desired, remember to add a linefeed and flush. std::cout << std::endl; ``` -------------------------------- ### Build Documentation with SCons Source: https://github.com/lynx-family/lynx/blob/develop/third_party/jsoncpp/README.md Build the project documentation by running the doxybuild.py script with the path to doxygen and enabling the open and with-dot options. ```bash python doxybuild.py --doxygen=$(which doxygen) --open --with-dot ``` -------------------------------- ### Optimize Commit Example Source: https://github.com/lynx-family/lynx/blob/develop/CONTRIBUTING.md Example of a commit message for a small-scale performance optimization. ```git commit message [Optimize][Performance] Jank when scrolling in xxxx ``` -------------------------------- ### BugFix Commit Example Source: https://github.com/lynx-family/lynx/blob/develop/CONTRIBUTING.md Example of a commit message for fixing a functional defect. ```git commit message [BugFix] Fix exception when playing audio ``` -------------------------------- ### Show AndroidUTPlugin Run help Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/plugins/README.md Displays the help message for running Android unit tests, including options for names, target, arguments, and running on a real device. ```commandline rtf android-ut run -h usage: app.py android-ut run [-h] --names [NAMES ...] [--target TARGET] [--args ARGS] [--rmd] optional arguments: -h, --help show this help message and exit --names [NAMES ...] Specify the template name --target TARGET Specify the target name --args ARGS User custom params, eg: --args="args_1=true, args_2=1" --rmd run test in real mobile device ``` -------------------------------- ### Testing Commit Example Source: https://github.com/lynx-family/lynx/blob/develop/CONTRIBUTING.md Example of a commit message for modifications to test cases on Android. ```git commit message [Testing][Android] Fix xxx test case for Android ``` -------------------------------- ### Show NativeUTPlugin Run help Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/plugins/README.md Displays the help message for running native unit tests, detailing options for specifying test names, targets, and arguments. ```commandline rtf native-ut run -h usage: app.py native-ut run [-h] --names [NAMES ...] [--target TARGET] [--args ARGS] optional arguments: -h, --help show this help message and exit --names [NAMES ...] Specify the template name --target TARGET Specify the target name --args ARGS User custom params, eg: --args="args_1=true, args_2=1" ``` -------------------------------- ### Infra Commit Example Source: https://github.com/lynx-family/lynx/blob/develop/CONTRIBUTING.md Example of a commit message for changes related to the compilation framework. ```git commit message [Infra][Compile] Use -Oz compile params in xxx ``` -------------------------------- ### Refactor Commit Example Source: https://github.com/lynx-family/lynx/blob/develop/CONTRIBUTING.md Example of a commit message for a significant code refactoring of a module. ```git commit message [Refactor][Memory] Memory management in xxxx ``` -------------------------------- ### Show NativeUTPlugin help Source: https://github.com/lynx-family/lynx/blob/develop/tools/rtf/plugins/README.md Displays the help message for the native-ut plugin, showing available commands like 'run' and 'list'. ```commandline rtf native-ut -h usage: app.py native-ut [-h] {run,list} ... optional arguments: -h, --help show this help message and exit command: run|list {run,list} run run targets list list targets ``` -------------------------------- ### Install Lynx DevTool Source: https://github.com/lynx-family/lynx/blob/develop/platform/harmony/lynx_devtool/README.md Install the Lynx DevTool package using ohpm. This command is used to add the dependency to your project. ```bash ohpm install @lynx/lynx_devtool ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/lynx-family/lynx/blob/develop/explorer/darwin/ios/README.md Installs the PyYAML package using pip within a virtual environment. This is required for auto-generation logic. ```bash # use the virtual environment to manage python environment python3 -m venv venv source venv/bin/activate # install PyYAML package pip3 install pyyaml ``` -------------------------------- ### Inheriting Template Example Source: https://github.com/lynx-family/lynx/blob/develop/third_party/binding/idl-codegen/third_party/doc/inheritance.html An example of an inheriting template ('index.html') that uses the 'inherit' directive and defines custom blocks for 'header'. ```html <%inherit file="base.html"/> <%block name="header"> this is some header content this is the body content. ``` -------------------------------- ### BugFix with DevTool Label Example Source: https://github.com/lynx-family/lynx/blob/develop/CONTRIBUTING.md Example of a commit message for a bug fix specifically in developer tools. ```git commit message [BugFix][DevTool] Fix data error in DevTool ``` -------------------------------- ### Build Explorer for Android Source: https://github.com/lynx-family/lynx/blob/develop/testing/integration_test/README.md Execute this command in the 'explorer/android' directory to build the Android Explorer with integration test support. ```bash ./gradlew :LynxExplorer:assembleNoAsanDebug -PIntegrationTest ``` -------------------------------- ### Feature Commit Example Source: https://github.com/lynx-family/lynx/blob/develop/CONTRIBUTING.md Example of a commit message for a new feature, including the required label and documentation link. ```git commit message [Feature] Add new API for data binding ``` -------------------------------- ### Loading Mako Template from File Source: https://github.com/lynx-family/lynx/blob/develop/third_party/binding/idl-codegen/third_party/doc/build/usage.rst Demonstrates how to create a Mako template by specifying a filename. The template source code is loaded from the specified file path. ```python from mako.template import Template mytemplate = Template(filename='/docs/mytmpl.txt') print(mytemplate.render()) ```