- Introduced buildinfo.json5 to enable impeller feature. - Added Chinese localization strings in string.json for module description and entry ability. - Created Ability.test.ets for unit testing of ability functionalities. - Implemented List.test.ets to run the ability tests. - Developed TestAbility.ets to manage test execution and lifecycle events. - Created Index.ets as a testability page with UI components. - Added OpenHarmonyTestRunner.ts for managing test execution in OpenHarmony. - Defined module.json5 for entry_test module configuration. - Established color.json and string.json for base resources. - Included icon.png for the test module. - Created test_pages.json to define testability page sources. - Configured hvigor and oh-package.json5 for project setup. - Updated pubspec.yaml and related files to downgrade Dart SDK to 3.11.0 and adjust dependencies. - Added PowerShell script to enable OpenHarmony Flutter toolchain. - Updated multiple package pubspec.yaml files to align with Dart SDK version 3.11.0 and adjust dependencies accordingly.
47 lines
1.8 KiB
PowerShell
47 lines
1.8 KiB
PowerShell
# Enables the OpenHarmony Flutter toolchain for the current PowerShell session.
|
|
# This script does not change the system or user PATH permanently.
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$flutterBin = 'C:\Users\A200477427\Developments\flutter_flutter\bin'
|
|
$devecoHome = 'C:\Program Files\Huawei\DevEco Studio'
|
|
$devecoSdk = "$devecoHome\sdk"
|
|
$ohpmBin = "$devecoHome\tools\ohpm\bin"
|
|
$hvigorBin = "$devecoHome\tools\hvigor\bin"
|
|
|
|
$requiredDirectories = @($flutterBin, $devecoSdk, $ohpmBin, $hvigorBin)
|
|
$missingDirectories = $requiredDirectories | Where-Object {
|
|
-not (Test-Path -LiteralPath $_ -PathType Container)
|
|
}
|
|
|
|
if ($missingDirectories) {
|
|
throw "OpenHarmony tool directories were not found:`n$($missingDirectories -join "`n")"
|
|
}
|
|
|
|
# Set these only for this terminal. This also makes the script work in a terminal
|
|
# that was opened before the corresponding Windows environment variables existed.
|
|
$env:DEVECO_HOME = $devecoHome
|
|
$env:DEVECO_SDK_HOME = $devecoSdk
|
|
|
|
# Put the OpenHarmony-specific commands first for this terminal only. Remove
|
|
# duplicate entries so repeated execution of this script leaves PATH clean.
|
|
$pathDirectories = @($flutterBin, $ohpmBin, $hvigorBin)
|
|
$pathEntries = $env:Path -split ';' | Where-Object {
|
|
$_ -and $_ -notin $pathDirectories
|
|
}
|
|
$env:Path = ($pathDirectories + $pathEntries) -join ';'
|
|
|
|
$commands = @('flutter', 'ohpm', 'hvigorw')
|
|
$unavailableCommands = foreach ($command in $commands) {
|
|
if (-not (Get-Command $command -ErrorAction SilentlyContinue)) {
|
|
$command
|
|
}
|
|
}
|
|
|
|
if ($unavailableCommands) {
|
|
throw "The following commands could not be resolved from PATH: $($unavailableCommands -join ', ')"
|
|
}
|
|
|
|
Write-Host 'OpenHarmony Flutter environment is enabled for this PowerShell session.' -ForegroundColor Green
|
|
Get-Command $commands | Select-Object Name, Source, CommandType | Format-Table -AutoSize
|