mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 04:27:58 +00:00
make resolc crate publishable (#334)
- Fetching the commit SHA must not panic if not executed in a git repository. - Remove the license printer. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -6,6 +6,16 @@ This is a development pre-release.
|
||||
|
||||
Supported `polkadot-sdk` rev: `2503.0.1`
|
||||
|
||||
## v0.2.0
|
||||
|
||||
This is a development pre-release.
|
||||
|
||||
Supported `polkadot-sdk` rev: `2503.0.1`
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed the license printer from the `resolc` binary.
|
||||
|
||||
## v0.1.0
|
||||
|
||||
This is a development pre-release.
|
||||
|
||||
Generated
+1
-1
@@ -8533,7 +8533,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "resolc"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ repository = "https://github.com/paritytech/revive"
|
||||
rust-version = "1.85.0"
|
||||
|
||||
[workspace.dependencies]
|
||||
resolc = { version = "0.1.0", path = "crates/resolc" }
|
||||
resolc = { path = "crates/resolc" }
|
||||
revive-benchmarks = { version = "0.1.0", path = "crates/benchmarks" }
|
||||
revive-builtins = { version = "0.1.0", path = "crates/builtins" }
|
||||
revive-common = { version = "0.1.0", path = "crates/common" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "resolc"
|
||||
version.workspace = true
|
||||
version = "0.2.0"
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
fn main() {
|
||||
let repo = git2::Repository::open("../..").expect("should be a repository");
|
||||
let head = repo.head().expect("should have head");
|
||||
let commit = head.peel_to_commit().expect("should have commit");
|
||||
let id = &commit.id().to_string()[..7];
|
||||
println!("cargo:rustc-env=GIT_COMMIT_HASH={id}");
|
||||
match git2::Repository::open("../..") {
|
||||
Ok(repo) => {
|
||||
let head = repo.head().expect("should have head");
|
||||
let commit = head.peel_to_commit().expect("should have commit");
|
||||
let id = &commit.id().to_string()[..7];
|
||||
println!("cargo:rustc-env=GIT_COMMIT_HASH={id}");
|
||||
}
|
||||
Err(_) => println!("cargo:rustc-env=GIT_COMMIT_HASH=unknown"),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,10 +23,6 @@ pub struct Arguments {
|
||||
#[arg(long = "supported-solc-versions")]
|
||||
pub supported_solc_versions: bool,
|
||||
|
||||
/// Print the licence and exit.
|
||||
#[arg(long = "license")]
|
||||
pub license: bool,
|
||||
|
||||
/// Specify the input paths and remappings.
|
||||
/// If an argument contains a '=', it is considered a remapping.
|
||||
/// Multiple Solidity files can be passed in the default Solidity mode.
|
||||
|
||||
@@ -51,14 +51,6 @@ fn main_inner() -> anyhow::Result<()> {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if arguments.license {
|
||||
let license_mit = include_str!("../../../../LICENSE-MIT");
|
||||
let license_apache = include_str!("../../../../LICENSE-APACHE");
|
||||
|
||||
writeln!(std::io::stdout(), "{}\n{}\n", license_mit, license_apache)?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
#[cfg(feature = "parallel")]
|
||||
rayon::ThreadPoolBuilder::new()
|
||||
.stack_size(RAYON_WORKER_STACK_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user