Skip to content

Commit

Permalink
Install all components by default
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Schwender <[email protected]>
  • Loading branch information
jschwe committed Oct 6, 2024
1 parent a94c54b commit 85fc8c7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ jobs:
SDK_PATH: "${{ steps.sdk-with-components.outputs.sdk-path }}"
run: |
${OHOS_SDK_NATIVE}/llvm/bin/clang --version
${SDK_PATH}/*/toolchains/hdc --version
if [[ test -d "${SDK_PATH}"/*/previewer ]]; then
echo "Unselected component should not be present"
exit 1
fi
- name: Remove previous SDK installation
env:
SDK_PATH: "${{ steps.sdk-with-components.outputs.sdk-path }}"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# v0.2 (unreleased)

- Now supports OH 5.0
- The `components` input now defaults to `all`, since `hvigor` 5 will throw an error if not all
components are installed.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
components:
description: "Semicolon separated list of SDK components that should be made available"
required: false
default: 'native'
default: 'all'
fixup-path:
description: "Whether to fixup the output paths so that the components appear under api level directory"
required: false
Expand Down
22 changes: 20 additions & 2 deletions install_ohos_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,30 @@ fi

OHOS_BASE_SDK_HOME="$PWD"

IFS=";" read -ra COMPONENTS <<< "${INPUT_COMPONENTS}"
if [[ "${INPUT_COMPONENTS}" == "all" ]]; then
COMPONENTS=(*.zip)
else
IFS=";" read -ra COMPONENTS <<< "${INPUT_COMPONENTS}"
resolved_components=()
for COMPONENT in "${COMPONENTS[@]}"
do
resolved_components+=("${COMPONENT}"-*.zip)
done
COMPONENTS=(${resolved_components[@]})
fi

for COMPONENT in "${COMPONENTS[@]}"
do
echo "Extracting component ${COMPONENT}"
echo "::group::Unzipping archive"
unzip "${COMPONENT}"-*.zip
#shellcheck disable=SC2144
if [[ -f "${COMPONENT}" ]]; then
unzip "${COMPONENT}"
else
echo "Failed to find component ${COMPONENT}"
ls -la
exit 1
fi
echo "::endgroup::"
API_VERSION=$(cat "${COMPONENT}/oh-uni-package.json" | jq -r '.apiVersion')
if [ "$INPUT_FIXUP_PATH" = "true" ]; then
Expand Down

0 comments on commit 85fc8c7

Please sign in to comment.