File tree Expand file tree Collapse file tree 2 files changed +290
-57
lines changed Expand file tree Collapse file tree 2 files changed +290
-57
lines changed Original file line number Diff line number Diff line change @@ -105,22 +105,21 @@ pub(super) fn to_targets(
105
105
if metabuild. is_some ( ) {
106
106
anyhow:: bail!( "cannot specify both `metabuild` and `build`" ) ;
107
107
}
108
- if custom_build. len ( ) > 1 {
109
- anyhow:: bail!( "multiple build scripts feature is not implemented yet! " )
108
+ for script in custom_build {
109
+ let script_path = Path :: new ( script) ;
110
+ let name = format ! (
111
+ "build-script-{}" ,
112
+ script_path
113
+ . file_stem( )
114
+ . and_then( |s| s. to_str( ) )
115
+ . unwrap_or( "" )
116
+ ) ;
117
+ targets. push ( Target :: custom_build_target (
118
+ & name,
119
+ package_root. join ( script_path) ,
120
+ edition,
121
+ ) ) ;
110
122
}
111
- let custom_build = Path :: new ( & custom_build[ 0 ] ) ;
112
- let name = format ! (
113
- "build-script-{}" ,
114
- custom_build
115
- . file_stem( )
116
- . and_then( |s| s. to_str( ) )
117
- . unwrap_or( "" )
118
- ) ;
119
- targets. push ( Target :: custom_build_target (
120
- & name,
121
- package_root. join ( custom_build) ,
122
- edition,
123
- ) ) ;
124
123
}
125
124
if let Some ( metabuild) = metabuild {
126
125
// Verify names match available build deps.
@@ -1107,9 +1106,7 @@ pub fn normalize_build(
1107
1106
Some ( TomlPackageBuild :: Auto ( true ) ) => {
1108
1107
Ok ( Some ( TomlPackageBuild :: SingleScript ( BUILD_RS . to_owned ( ) ) ) )
1109
1108
}
1110
- Some ( TomlPackageBuild :: MultipleScript ( _scripts) ) => {
1111
- anyhow:: bail!( "multiple build scripts feature is not implemented yet!" ) ;
1112
- }
1109
+ Some ( TomlPackageBuild :: MultipleScript ( _scripts) ) => Ok ( build. cloned ( ) ) ,
1113
1110
}
1114
1111
}
1115
1112
You can’t perform that action at this time.
0 commit comments