From 011ee2b38f911c5b7629f08c5b86acf364c673dc Mon Sep 17 00:00:00 2001 From: Noah Saso <6721426+NoahSaso@users.noreply.github.com> Date: Tue, 25 Feb 2025 12:13:02 -0500 Subject: [PATCH] support automatic optimizer builds of different feature flags --- Cargo.lock | 2 +- .../cw-tokenfactory-issuer/Cargo.toml | 21 ++++++++++++------- contracts/external/cw-vesting/Cargo.toml | 12 +++++++++++ .../proposal/dao-proposal-multiple/Cargo.toml | 7 ------- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f101d9b4..7ee48547e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" diff --git a/contracts/external/cw-tokenfactory-issuer/Cargo.toml b/contracts/external/cw-tokenfactory-issuer/Cargo.toml index 2abbb4180..0807aaed2 100644 --- a/contracts/external/cw-tokenfactory-issuer/Cargo.toml +++ b/contracts/external/cw-tokenfactory-issuer/Cargo.toml @@ -14,15 +14,22 @@ repository = { workspace = true } # the default DAO DAO license license = "Apache-2.0" - -exclude = [ - # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. - "contract.wasm", - "hash.txt", +# configure different optimizer builds for each tokenfactory standard used by +# different chains +[package.metadata.optimizer] +standard-build = false +builds = [ + { name = "osmosis", features = [ + "osmosis_tokenfactory", + ], default-features = false }, + { name = "cosmwasm", features = [ + "cosmwasm_tokenfactory", + ], default-features = false }, + { name = "kujira", features = [ + "kujira_tokenfactory", + ], default-features = false }, ] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] diff --git a/contracts/external/cw-vesting/Cargo.toml b/contracts/external/cw-vesting/Cargo.toml index 1d9829424..630ed054f 100644 --- a/contracts/external/cw-vesting/Cargo.toml +++ b/contracts/external/cw-vesting/Cargo.toml @@ -7,6 +7,18 @@ license = { workspace = true } repository = { workspace = true } version = { workspace = true } +# configure different optimizer builds for whether or not staking is enabled by +# the chain +[package.metadata.optimizer] +standard-build = false +builds = [ + { name = "staking", features = [ + "staking", + ], default-features = false }, + { name = "no_staking", features = [ + ], default-features = false }, +] + [lib] crate-type = ["cdylib", "rlib"] diff --git a/contracts/proposal/dao-proposal-multiple/Cargo.toml b/contracts/proposal/dao-proposal-multiple/Cargo.toml index b37648976..80a3e0d20 100644 --- a/contracts/proposal/dao-proposal-multiple/Cargo.toml +++ b/contracts/proposal/dao-proposal-multiple/Cargo.toml @@ -7,13 +7,6 @@ license = { workspace = true } repository = { workspace = true } version = { workspace = true } -exclude = [ - # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. - "contract.wasm", - "hash.txt", -] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] crate-type = ["cdylib", "rlib"]