1 Star 0 Fork 88

zhangchen168 / third_party_typescript

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ohosBuild.py 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
zhangchen168 提交于 2023-03-09 12:15 . demo
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
import subprocess
def run_cmd(cmd, executionPath = None):
print(cmd)
res = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=executionPath,
shell=True)
sout, serr = res.communicate()
res.wait()
return res.pid, res.returncode, sout, serr
def copyToOutDir(sourcePath, destinationPath):
if os.path.exists(destinationPath) == False:
os.mkdir(destinationPath)
cmd = " ".join(["cp", "-r", sourcePath, destinationPath])
run_cmd(cmd)
def runGulp(executionPath):
cmd = " ".join(["npm", "run", "gulp", "LKG"])
run_cmd(cmd, executionPath)
def runPack(executionPath):
cmd = " ".join(["npm", "pack"])
run_cmd(cmd, executionPath)
def main(args):
copyToOutDir(args[0],args[1])
executionPath = args[1]
runGulp(executionPath)
runPack(executionPath)
if __name__ == '__main__':
main(sys.argv[1:])
1
https://gitee.com/zhangchen168/third_party_typescript.git
git@gitee.com:zhangchen168/third_party_typescript.git
zhangchen168
third_party_typescript
third_party_typescript
master

搜索帮助