diff options
Diffstat (limited to 'release/src/main.rs')
| -rw-r--r-- | release/src/main.rs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/release/src/main.rs b/release/src/main.rs index 25f31486a..7850bbb8d 100644 --- a/release/src/main.rs +++ b/release/src/main.rs | |||
| @@ -141,6 +141,14 @@ fn list_crates(root: &PathBuf) -> Result<BTreeMap<CrateId, Crate>> { | |||
| 141 | } | 141 | } |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | let mut configs = metadata.build.clone(); | ||
| 145 | if configs.is_empty() { | ||
| 146 | configs.push(BuildConfig { | ||
| 147 | features: vec![], | ||
| 148 | target: None, | ||
| 149 | }) | ||
| 150 | } | ||
| 151 | |||
| 144 | crates.insert( | 152 | crates.insert( |
| 145 | id.clone(), | 153 | id.clone(), |
| 146 | Crate { | 154 | Crate { |
| @@ -148,10 +156,7 @@ fn list_crates(root: &PathBuf) -> Result<BTreeMap<CrateId, Crate>> { | |||
| 148 | version: parsed.package.version, | 156 | version: parsed.package.version, |
| 149 | path, | 157 | path, |
| 150 | dependencies, | 158 | dependencies, |
| 151 | config: metadata.build.first().cloned().unwrap_or_else(|| BuildConfig { | 159 | configs, |
| 152 | features: vec![], | ||
| 153 | target: None, | ||
| 154 | }), | ||
| 155 | }, | 160 | }, |
| 156 | ); | 161 | ); |
| 157 | } | 162 | } |
| @@ -332,10 +337,11 @@ fn main() -> Result<()> { | |||
| 332 | c.path.join("Cargo.toml").display().to_string(), | 337 | c.path.join("Cargo.toml").display().to_string(), |
| 333 | ]; | 338 | ]; |
| 334 | 339 | ||
| 340 | let config = c.configs.first().unwrap(); // TODO | ||
| 335 | args.push("--features".into()); | 341 | args.push("--features".into()); |
| 336 | args.push(c.config.features.join(",")); | 342 | args.push(config.features.join(",")); |
| 337 | 343 | ||
| 338 | if let Some(target) = &c.config.target { | 344 | if let Some(target) = &config.target { |
| 339 | args.push("--target".into()); | 345 | args.push("--target".into()); |
| 340 | args.push(target.clone()); | 346 | args.push(target.clone()); |
| 341 | } | 347 | } |
| @@ -387,6 +393,8 @@ fn update_changelog(repo: &Path, c: &Crate) -> Result<()> { | |||
| 387 | } | 393 | } |
| 388 | 394 | ||
| 389 | fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { | 395 | fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { |
| 396 | let config = c.configs.first().unwrap(); // TODO | ||
| 397 | |||
| 390 | let mut args: Vec<String> = vec![ | 398 | let mut args: Vec<String> = vec![ |
| 391 | "publish".to_string(), | 399 | "publish".to_string(), |
| 392 | "--manifest-path".to_string(), | 400 | "--manifest-path".to_string(), |
| @@ -394,9 +402,9 @@ fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { | |||
| 394 | ]; | 402 | ]; |
| 395 | 403 | ||
| 396 | args.push("--features".into()); | 404 | args.push("--features".into()); |
| 397 | args.push(c.config.features.join(",")); | 405 | args.push(config.features.join(",")); |
| 398 | 406 | ||
| 399 | if let Some(target) = &c.config.target { | 407 | if let Some(target) = &config.target { |
| 400 | args.push("--target".into()); | 408 | args.push("--target".into()); |
| 401 | args.push(target.clone()); | 409 | args.push(target.clone()); |
| 402 | } | 410 | } |
