Update xtask release to work for ruma-server-util
This commit is contained in:
		
							parent
							
								
									d2c47b84aa
								
							
						
					
					
						commit
						5b77165e2b
					
				@ -48,10 +48,6 @@ impl Package {
 | 
				
			|||||||
    /// Update the version of this crate in dependant crates' manifests, with the given version
 | 
					    /// Update the version of this crate in dependant crates' manifests, with the given version
 | 
				
			||||||
    /// prefix.
 | 
					    /// prefix.
 | 
				
			||||||
    pub(crate) fn update_dependants(&self, metadata: &Metadata, dry_run: bool) -> Result<()> {
 | 
					    pub(crate) fn update_dependants(&self, metadata: &Metadata, dry_run: bool) -> Result<()> {
 | 
				
			||||||
        let workspace_manifest_path = metadata.workspace_root.join("Cargo.toml");
 | 
					 | 
				
			||||||
        let mut document = read_file(&workspace_manifest_path)?.parse::<Document>()?;
 | 
					 | 
				
			||||||
        let workspace_deps = &mut document["workspace"]["dependencies"];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if self.name == "ruma" {
 | 
					        if self.name == "ruma" {
 | 
				
			||||||
            for package in metadata.packages.iter().filter(|p| {
 | 
					            for package in metadata.packages.iter().filter(|p| {
 | 
				
			||||||
                p.manifest_path.starts_with(&metadata.workspace_root)
 | 
					                p.manifest_path.starts_with(&metadata.workspace_root)
 | 
				
			||||||
@ -82,8 +78,12 @@ impl Package {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
 | 
					            let workspace_manifest_path = metadata.workspace_root.join("Cargo.toml");
 | 
				
			||||||
 | 
					            let mut document = read_file(&workspace_manifest_path)?.parse::<Document>()?;
 | 
				
			||||||
 | 
					            let workspace_deps = &mut document["workspace"]["dependencies"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if workspace_deps.get(&self.name).is_some() {
 | 
				
			||||||
                println!("Updating workspace dependency…");
 | 
					                println!("Updating workspace dependency…");
 | 
				
			||||||
            assert!(workspace_deps.get(&self.name).is_some());
 | 
					 | 
				
			||||||
                if !dry_run {
 | 
					                if !dry_run {
 | 
				
			||||||
                    let version = if self.name == "ruma-macros" || !self.version.pre.is_empty() {
 | 
					                    let version = if self.name == "ruma-macros" || !self.version.pre.is_empty() {
 | 
				
			||||||
                        format!("={}", self.version)
 | 
					                        format!("={}", self.version)
 | 
				
			||||||
@ -96,6 +96,7 @@ impl Package {
 | 
				
			|||||||
                    write_file(&workspace_manifest_path, document.to_string())?;
 | 
					                    write_file(&workspace_manifest_path, document.to_string())?;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Ok(())
 | 
					        Ok(())
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user