Skip to content

Commit deb95fc

Browse files
committed
Bump MSRV to 1.71, and use Cargo's [workspace.package]
Also fix the `license` fields that I can.
1 parent df74063 commit deb95fc

File tree

107 files changed

+534
-912
lines changed

Some content is hidden

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

107 files changed

+534
-912
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ jobs:
171171

172172
- name: Use MSRV toolchain
173173
run: |
174-
rustup toolchain install 1.60 --profile=minimal --no-self-update
175-
rustup override set 1.60
174+
rustup toolchain install 1.71 --profile=minimal --no-self-update
175+
rustup override set 1.71
176176
177177
- name: Install target
178178
run: rustup target add x86_64-apple-darwin

Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ members = [
66
]
77
resolver = "2"
88

9+
[workspace.package]
10+
authors = ["Mads Marquart <[email protected]>"]
11+
edition = "2021"
12+
rust-version = "1.71"
13+
repository = "https://github.com/madsmtm/objc2"
14+
15+
# Framework crate defaults
16+
17+
# Remember to update in header-translator, and manually authored lib.rs.
18+
version = "0.2.2"
19+
# Some crates in this repo may have a different license, see each crate for the specifics.
20+
license = "Zlib OR Apache-2.0 OR MIT"
21+
categories = [
22+
"api-bindings",
23+
"development-tools::ffi",
24+
"external-ffi-bindings",
25+
"os::macos-apis",
26+
]
27+
928
[workspace.lints.rust]
1029
elided_lifetimes_in_paths = "warn"
1130
missing_copy_implementations = "warn"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ functionality as safe (which we [need your help with][header-data]).
8989

9090
## Minimum Supported Rust Version (MSRV)
9191

92-
The _currently_ minimum supported Rust version is `1.60`; this is _not_
92+
The _currently_ minimum supported Rust version is `1.71`; this is _not_
9393
defined by policy, though, so it may change in at any time in a patch release.
9494

9595
Help us define a policy over in [#203].

crates/block2/Cargo.toml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
[package]
22
name = "block2"
3-
# Remember to update html_root_url in lib.rs
4-
version = "0.5.1"
5-
authors = ["Steven Sheldon", "Mads Marquart <[email protected]>"]
6-
edition = "2021"
7-
rust-version = "1.60"
8-
3+
version = "0.5.1" # Remember to update html_root_url in lib.rs
94
description = "Apple's C language extension of blocks"
105
keywords = ["objective-c", "macos", "ios", "blocks"]
116
categories = [
@@ -14,10 +9,11 @@ categories = [
149
"os::macos-apis",
1510
"external-ffi-bindings",
1611
]
17-
readme = "README.md"
18-
repository = "https://github.com/madsmtm/objc2"
19-
documentation = "https://docs.rs/block2/"
20-
license = "MIT"
12+
authors.workspace = true
13+
edition.workspace = true
14+
rust-version.workspace = true
15+
repository.workspace = true
16+
license = "MIT" # https://github.com/madsmtm/objc2/issues/23
2117

2218
[features]
2319
default = ["std"]

crates/header-translator/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[package]
22
name = "header-translator"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition.workspace = true
55
publish = false
6-
7-
repository = "https://github.com/madsmtm/objc2"
6+
repository.workspace = true
87
license = "Zlib OR Apache-2.0 OR MIT"
98

109
[dependencies]

crates/header-translator/src/default_cargo.toml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@
33

44
[package]
55
name = "UNSET"
6-
version = "UNSET" # Remember to update html_root_url in lib.rs
6+
version.workspace = true
77
description = "UNSET"
8-
edition = "2021"
9-
rust-version = "1.60"
8+
edition.workspace = true
9+
rust-version.workspace = true
1010
keywords = ["cocoa", "apple", "framework"]
11-
categories = [
12-
"api-bindings",
13-
"development-tools::ffi",
14-
"external-ffi-bindings",
15-
"os::macos-apis",
16-
]
17-
repository = "https://github.com/madsmtm/objc2"
18-
license = "MIT"
11+
categories.workspace = true
12+
repository.workspace = true
13+
license.workspace = true
1914

2015
[lints]
2116
workspace = true

crates/header-translator/src/library.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::io::Write;
88
use std::path::Path;
99

1010
use toml_edit::InlineTable;
11-
use toml_edit::{value, Array, DocumentMut, Formatted, Item, Table, Value};
11+
use toml_edit::{value, Array, DocumentMut, Item, Table, Value};
1212

1313
use crate::cfgs::PlatformCfg;
1414
use crate::config::LibraryConfig;
@@ -189,15 +189,6 @@ see that for related crates.", self.data.krate, self.link_name)?;
189189
.expect("invalid default toml");
190190

191191
cargo_toml["package"]["name"] = value(&self.data.krate);
192-
match cargo_toml["package"]["version"].as_value_mut().unwrap() {
193-
// Preserve comment behind `version`
194-
Value::String(s) => {
195-
let decor = s.decor().clone();
196-
*s = Formatted::new(VERSION.to_string());
197-
*s.decor_mut() = decor;
198-
}
199-
_ => unreachable!(),
200-
}
201192
cargo_toml["package"]["description"] =
202193
value(format!("Bindings to the {} framework", self.link_name));
203194
let keywords = cargo_toml["package"]["keywords"].as_array_mut().unwrap();
@@ -502,7 +493,10 @@ fn merge_toml_table(original: &mut Table, addition: Table) {
502493
(Item::ArrayOfTables(original), Item::ArrayOfTables(addition)) => {
503494
*original = addition;
504495
}
505-
(original, addition) => panic!("cannot merge items {original:?} and {addition:?}"),
496+
(original, addition) => {
497+
// Overwrite
498+
*original = addition;
499+
}
506500
},
507501
toml_edit::Entry::Vacant(original) => {
508502
match &mut addition {

crates/objc2-encode/Cargo.toml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
[package]
22
name = "objc2-encode"
3-
# Remember to update html_root_url in lib.rs
4-
version = "4.0.3"
5-
authors = ["Steven Sheldon", "Mads Marquart <[email protected]>"]
6-
edition = "2021"
7-
rust-version = "1.60"
8-
3+
version = "4.0.3" # Remember to update html_root_url in lib.rs
94
description = "Objective-C type-encoding representation and parsing"
105
keywords = ["objective-c", "macos", "ios", "encode"]
116
categories = [
@@ -14,10 +9,11 @@ categories = [
149
"no-std",
1510
"os::macos-apis",
1611
]
17-
readme = "README.md"
18-
repository = "https://github.com/madsmtm/objc2"
19-
documentation = "https://docs.rs/objc2-encode/"
20-
license = "MIT"
12+
license = "MIT" # https://github.com/madsmtm/objc2/issues/23
13+
authors.workspace = true
14+
edition.workspace = true
15+
rust-version.workspace = true
16+
repository.workspace = true
2117

2218
[lints]
2319
workspace = true

crates/objc2-exception-helper/Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ name = "objc2-exception-helper"
66
# Also, beware of using pre-release versions here, since because of the
77
# `links` key, two pre-releases requested with `=...` are incompatible.
88
version = "0.1.0"
9-
authors = ["Mads Marquart <[email protected]>"]
10-
edition = "2021"
11-
rust-version = "1.60"
12-
139
description = "External helper function for catching Objective-C exceptions"
1410
keywords = ["objective-c", "macos", "ios", "exception"]
1511
categories = ["no-std", "no-std::no-alloc", "os::macos-apis"]
16-
repository = "https://github.com/madsmtm/objc2"
17-
license = "MIT"
12+
authors.workspace = true
13+
edition.workspace = true
14+
rust-version.workspace = true
15+
repository.workspace = true
16+
license = "Zlib OR Apache-2.0 OR MIT"
1817

1918
# Use the `links` key to ensure that only one of these symbols are compiled
2019
#

crates/objc2-proc-macros/Cargo.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ name = "objc2-proc-macros"
33
# Remember to update html_root_url in lib.rs
44
version = "0.1.3"
55
authors = ["Mads Marquart <[email protected]>", "Calvin Watford"]
6-
edition = "2021"
7-
rust-version = "1.60"
8-
96
description = "Procedural macros for the objc2 project"
107
keywords = ["objective-c", "macos", "ios", "proc-macro"]
118
categories = [
129
"development-tools",
1310
"os::macos-apis",
1411
]
15-
readme = "README.md"
16-
repository = "https://github.com/madsmtm/objc2"
17-
documentation = "https://docs.rs/objc2-proc-macros/"
18-
license = "MIT"
12+
edition.workspace = true
13+
rust-version.workspace = true
14+
repository.workspace = true
15+
license = "Zlib OR Apache-2.0 OR MIT"
1916

2017
[lib]
2118
proc-macro = true

0 commit comments

Comments
 (0)