From e46bc0bac7d24b0077a06fc433986c362a9b33a7 Mon Sep 17 00:00:00 2001 From: chengxuya Date: Mon, 4 Nov 2024 16:08:42 +0800 Subject: [PATCH 1/2] build_config to out path --- core/util/parse_cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/util/parse_cmd.py b/core/util/parse_cmd.py index 452f291..efbcc0a 100644 --- a/core/util/parse_cmd.py +++ b/core/util/parse_cmd.py @@ -77,7 +77,7 @@ class Parser: self.parser.add_argument('-compiler', dest='compiler', default=self.compiler, type=str) def write(self): - with open('build_config.json', 'w') as file: + with open(f'{self.out_path_}/build_config.json', 'w') as file: json.dump(vars(self.parser.parse_args()), file, indent = 2) def get_gn_args_list(self): -- Gitee From cd40f7cc12b269b88a256c190bc345d2d3c6fb9a Mon Sep 17 00:00:00 2001 From: chengxuya Date: Mon, 4 Nov 2024 17:05:45 +0800 Subject: [PATCH 2/2] fix a parse bug --- core/gn.py | 12 ++++++++++++ core/main.py | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/core/gn.py b/core/gn.py index b4dffc8..0b70bc5 100644 --- a/core/gn.py +++ b/core/gn.py @@ -1,3 +1,15 @@ +# Copyright (c) 2023-2024 DoubleByte. +# This is licensed under Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# +# http://license.coscl.org.cn/MulanPSL2 +# +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# See the Mulan PSL v2 for more details. + import subprocess from util.env import getEnv diff --git a/core/main.py b/core/main.py index f9654c8..7617652 100644 --- a/core/main.py +++ b/core/main.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023 DoubleByte. +# Copyright (c) 2023-2024 DoubleByte. # This is licensed under Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: @@ -20,10 +20,6 @@ from ninja import Ninja from util.path import OUT_PATH, ETC_PATH, TMP_PATH, SHARE_PATH, VAR_PATH, LOG_PATH def main(): - parser = Parser() - parser.set_compiler() - parser.write() - if not os.path.exists(OUT_PATH): os.makedirs(OUT_PATH) if not os.path.exists(ETC_PATH): @@ -37,6 +33,10 @@ def main(): if not os.path.exists(LOG_PATH): os.makedirs(LOG_PATH) + parser = Parser() + parser.set_compiler() + parser.write() + try: gn = Gn(parser) gn.run() -- Gitee