18bf80f4bSopenharmony_ci#!/bin/bash
28bf80f4bSopenharmony_ci# Copyright (C) 2024 Huawei Device Co., Ltd.
38bf80f4bSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
48bf80f4bSopenharmony_ci# you may not use this file except in compliance with the License.
58bf80f4bSopenharmony_ci# You may obtain a copy of the License at
68bf80f4bSopenharmony_ci#
78bf80f4bSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
88bf80f4bSopenharmony_ci#
98bf80f4bSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
108bf80f4bSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
118bf80f4bSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
128bf80f4bSopenharmony_ci# See the License for the specific language governing permissions and
138bf80f4bSopenharmony_ci# limitations under the License.
148bf80f4bSopenharmony_ci
158bf80f4bSopenharmony_ciset -e
168bf80f4bSopenharmony_ci
178bf80f4bSopenharmony_ciCOMPILER_PATH=$1
188bf80f4bSopenharmony_ciTEST_COMPILER_PATH=${COMPILER_PATH}/../LumeBinaryCompile/lumeassetcompiler
198bf80f4bSopenharmony_ciCPU_TYPE=$2
208bf80f4bSopenharmony_ciASSETS_PATH=$3
218bf80f4bSopenharmony_ciROOT_PATH=$4
228bf80f4bSopenharmony_ciBIN_NAME=$5
238bf80f4bSopenharmony_ciSIZE_NAME=$6
248bf80f4bSopenharmony_ciBASE_NAME=$7
258bf80f4bSopenharmony_ciCOPY_PATH=$8
268bf80f4bSopenharmony_ciOUTPUT_OBJ=$9
278bf80f4bSopenharmony_ci
288bf80f4bSopenharmony_cicompile_asset()
298bf80f4bSopenharmony_ci{
308bf80f4bSopenharmony_ci	echo "Lume5 Compile asset $1 $2 $3 $4 $5 $6 $7 $8 $9"
318bf80f4bSopenharmony_ci    $TEST_COMPILER_PATH/LumeAssetCompiler -linux $CPU_TYPE -extensions ".spv;.json;.lsb;.shader;.shadergs;.shadervid;.shaderpl;.rng;.gl;.gles" $ASSETS_PATH $ROOT_PATH $BIN_NAME $SIZE_NAME $BASE_NAME
328bf80f4bSopenharmony_ci    mv $OUTPUT_OBJ $COPY_PATH
338bf80f4bSopenharmony_ci}
348bf80f4bSopenharmony_ci
358bf80f4bSopenharmony_cicompile_asset $COMPILER_PATH $CPU_TYPE $ASSETS_PATH $ROOT_PATH $BIN_NAME $SIZE_NAME $BASE_NAME $COPY_PATH $OUTPUT_OBJ
36