Initialize HarmonyOS project templates (Standard ArkTS or Native C++) and perform initial build verification.
; as a statement separator.New-Item -ItemType Directory -Path <path> -Force instead of mkdir -p.(Get-ChildItem -Name) instead of ls /b or dir /b.Test-Path <path> to check for existence before operating on files.ohpm, hvigorw, and codelinter are installed by running ohpm -v; hvigorw -v; codelinter -h.xcopy /E /I /Y "assets/harmonyos-project-template/*" "." (or the native template path) to copy project files.xcopy /E /I /Y "scripts/*" "scripts/" to copy verification scripts.ohpm install.node scripts/check_env.cjs.git init ; git add . ; git commit -m "Initial commit from HarmonyOS template".conductor-dev skill to initialize a conductor/ directory for project orchestration and further implementation.; as the command separator. Prefer xcopy or robocopy for directory copies on Windows to ensure recursive copying and directory creation. Avoid mkdir -p and &&.codelinter on all modified .ets or .ts files immediately after editing.
codelinter <file_path>hvigorw test) or full project builds (assembleHap) during task implementation.Spatially sets up the project structure and installs dependencies.
assets/harmonyos-project-template/ or assets/nativec-template/) to the root.scripts/* into the scripts/ directory.git init upon successful build completion.conductor for advanced project orchestration.; as the command separator and ensure PowerShell compatibility. Use New-Item -ItemType Directory -Force for directory creation.Ensures the application compiles correctly and uses correct SDK versions.
build-profile.json5 to identify the targetSdkVersion and compatibleSdkVersion. Use the "Version to API Level Mapping" table below to cross-reference and verify the versioning.ohpm install; node scripts/check_env.cjs.assets/harmonyos-project-template/assets/nativec-template/scripts/| Version | API Level |
|---|---|
| 4.0 | 10 |
| 4.1 | 11 |
| 5.0.0 | 12 |
| 5.0.1 | 13 |
| 5.0.2 | 14 |
| 5.0.3 | 15 |
| 5.1.0 | 18 |
| 5.1.1 | 19 |
| 6.0 | 20 |
Note: If the version string in build-profile.json5 includes a number in parentheses, such as 6.0.0(20), the number in the parentheses is the API Level.