-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #369 from moonbitlang/fix-pre-build
re-scan module after prebuild
- Loading branch information
Showing
12 changed files
with
134 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
// | ||
// For inquiries, you can contact us via e-mail at [email protected]. | ||
|
||
use super::pre_build::run_pre_build; | ||
use super::BuildFlags; | ||
use anyhow::{bail, Context}; | ||
use colored::Colorize; | ||
|
@@ -168,6 +169,13 @@ pub fn generate_test_driver( | |
&moonc_opt, | ||
&moonbuild_opt, | ||
)?; | ||
let module = run_pre_build( | ||
&moonc_opt, | ||
&moonbuild_opt, | ||
module, | ||
&resolved_env, | ||
&dir_sync_result, | ||
)?; | ||
if cli.dry_run { | ||
bail!("dry-run is not implemented for generate-test-driver"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// moon: The build system and package manager for MoonBit. | ||
// Copyright (C) 2024 International Digital Economy Academy | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
// | ||
// For inquiries, you can contact us via e-mail at [email protected]. | ||
|
||
use moonbuild::entry::{run_moon_generate, MoonGenerateState}; | ||
use moonutil::{ | ||
common::{MoonbuildOpt, MooncOpt}, | ||
module::ModuleDB, | ||
mooncakes::{result::ResolvedEnv, DirSyncResult}, | ||
}; | ||
|
||
pub fn run_pre_build( | ||
moonc_opt: &MooncOpt, | ||
moonbuild_opt: &MoonbuildOpt, | ||
module: ModuleDB, | ||
resolved_env: &ResolvedEnv, | ||
dir_sync_result: &DirSyncResult, | ||
) -> anyhow::Result<ModuleDB> { | ||
let gen_result = run_moon_generate(moonbuild_opt, &module)?; | ||
let module = if let MoonGenerateState::WorkDone = gen_result { | ||
moonutil::scan::scan( | ||
false, | ||
resolved_env, | ||
dir_sync_result, | ||
moonc_opt, | ||
moonbuild_opt, | ||
)? | ||
} else { | ||
module | ||
}; | ||
Ok(module) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters