Skip to content

Commit 5ceb125

Browse files
authored
Expose default tag as feature (#1492)
1 parent 93f4c32 commit 5ceb125

File tree

562 files changed

+1800
-1517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

562 files changed

+1800
-1517
lines changed

services/autorust/codegen/src/cargo_toml.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{config_parser::Tag, jinja::CargoToml};
33
use camino::Utf8Path;
44

55
pub fn create(package_name: &str, tags: &[&Tag], default_tag: &Tag, has_xml: bool, path: &Utf8Path) -> Result<()> {
6-
let default_feature = &default_tag.rust_feature_name();
6+
let default_tag = &default_tag.rust_feature_name();
77

88
// https://docs.rs/about/metadata
99
// let docs_rs_features = docs_rs_features(tags, &default_feature);
@@ -12,7 +12,7 @@ pub fn create(package_name: &str, tags: &[&Tag], default_tag: &Tag, has_xml: boo
1212
let azure_core_features = if has_xml { vec!["xml"] } else { Vec::new() };
1313
let cargo_toml = CargoToml {
1414
package_name,
15-
default_feature,
15+
default_tag,
1616
features,
1717
azure_core_features,
1818
};

services/autorust/codegen/src/jinja.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'a> CheckAllServicesYml<'a> {
5050
#[template(path = "Cargo.toml.jinja")]
5151
pub struct CargoToml<'a> {
5252
pub package_name: &'a str,
53-
pub default_feature: &'a str,
53+
pub default_tag: &'a str,
5454
pub features: Vec<String>,
5555
pub azure_core_features: Vec<&'a str>,
5656
}

services/autorust/codegen/src/lib_rs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl ToTokens for BodyCode {
3838
cfgs.extend(quote! {
3939
#[cfg(feature = #feature_name)]
4040
pub mod #mod_name;
41-
#[cfg(all(feature = #feature_name, not(feature = "no-default-tag")))]
41+
#[cfg(all(feature = #feature_name, not(feature = "without_tag_import")))]
4242
pub use #mod_name::*;
4343
});
4444
}

services/autorust/codegen/templates/Cargo.toml.jinja

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ anyhow = "1.0"
3535
all-features = true
3636

3737
[features]
38-
default = ["{{default_feature}}", "enable_reqwest"]
38+
default = ["default_tag", "enable_reqwest"]
3939
enable_reqwest = ["azure_core/enable_reqwest"]
4040
enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"]
41-
no-default-tag = []
41+
without_tag_import = []
42+
default_tag = ["{{default_tag}}"]
4243
{%- for feature in features %}
4344
"{{feature}}" = []
4445
{%- endfor %}

services/mgmt/activedirectory/Cargo.toml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/mgmt/activedirectory/src/lib.rs

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/mgmt/addons/Cargo.toml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/mgmt/addons/src/lib.rs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/mgmt/adhybridhealthservice/Cargo.toml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/mgmt/adhybridhealthservice/src/lib.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)