Skip to content

Commit

Permalink
Bump MSRV to 1.71, and use Cargo's [workspace.package]
Browse files Browse the repository at this point in the history
Also fix the `license` fields that I can.
  • Loading branch information
madsmtm committed Sep 12, 2024
1 parent df74063 commit deb95fc
Show file tree
Hide file tree
Showing 107 changed files with 534 additions and 912 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ jobs:

- name: Use MSRV toolchain
run: |
rustup toolchain install 1.60 --profile=minimal --no-self-update
rustup override set 1.60
rustup toolchain install 1.71 --profile=minimal --no-self-update
rustup override set 1.71
- name: Install target
run: rustup target add x86_64-apple-darwin
Expand Down
19 changes: 19 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ members = [
]
resolver = "2"

[workspace.package]
authors = ["Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.71"
repository = "https://github.com/madsmtm/objc2"

# Framework crate defaults

# Remember to update in header-translator, and manually authored lib.rs.
version = "0.2.2"
# Some crates in this repo may have a different license, see each crate for the specifics.
license = "Zlib OR Apache-2.0 OR MIT"
categories = [
"api-bindings",
"development-tools::ffi",
"external-ffi-bindings",
"os::macos-apis",
]

[workspace.lints.rust]
elided_lifetimes_in_paths = "warn"
missing_copy_implementations = "warn"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ functionality as safe (which we [need your help with][header-data]).

## Minimum Supported Rust Version (MSRV)

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

Help us define a policy over in [#203].
Expand Down
16 changes: 6 additions & 10 deletions crates/block2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
[package]
name = "block2"
# Remember to update html_root_url in lib.rs
version = "0.5.1"
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.60"

version = "0.5.1" # Remember to update html_root_url in lib.rs
description = "Apple's C language extension of blocks"
keywords = ["objective-c", "macos", "ios", "blocks"]
categories = [
Expand All @@ -14,10 +9,11 @@ categories = [
"os::macos-apis",
"external-ffi-bindings",
]
readme = "README.md"
repository = "https://github.com/madsmtm/objc2"
documentation = "https://docs.rs/block2/"
license = "MIT"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license = "MIT" # https://github.com/madsmtm/objc2/issues/23

[features]
default = ["std"]
Expand Down
5 changes: 2 additions & 3 deletions crates/header-translator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[package]
name = "header-translator"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

repository = "https://github.com/madsmtm/objc2"
repository.workspace = true
license = "Zlib OR Apache-2.0 OR MIT"

[dependencies]
Expand Down
17 changes: 6 additions & 11 deletions crates/header-translator/src/default_cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@

[package]
name = "UNSET"
version = "UNSET" # Remember to update html_root_url in lib.rs
version.workspace = true
description = "UNSET"
edition = "2021"
rust-version = "1.60"
edition.workspace = true
rust-version.workspace = true
keywords = ["cocoa", "apple", "framework"]
categories = [
"api-bindings",
"development-tools::ffi",
"external-ffi-bindings",
"os::macos-apis",
]
repository = "https://github.com/madsmtm/objc2"
license = "MIT"
categories.workspace = true
repository.workspace = true
license.workspace = true

[lints]
workspace = true
Expand Down
16 changes: 5 additions & 11 deletions crates/header-translator/src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::io::Write;
use std::path::Path;

use toml_edit::InlineTable;
use toml_edit::{value, Array, DocumentMut, Formatted, Item, Table, Value};
use toml_edit::{value, Array, DocumentMut, Item, Table, Value};

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

cargo_toml["package"]["name"] = value(&self.data.krate);
match cargo_toml["package"]["version"].as_value_mut().unwrap() {
// Preserve comment behind `version`
Value::String(s) => {
let decor = s.decor().clone();
*s = Formatted::new(VERSION.to_string());
*s.decor_mut() = decor;
}
_ => unreachable!(),
}
cargo_toml["package"]["description"] =
value(format!("Bindings to the {} framework", self.link_name));
let keywords = cargo_toml["package"]["keywords"].as_array_mut().unwrap();
Expand Down Expand Up @@ -502,7 +493,10 @@ fn merge_toml_table(original: &mut Table, addition: Table) {
(Item::ArrayOfTables(original), Item::ArrayOfTables(addition)) => {
*original = addition;
}
(original, addition) => panic!("cannot merge items {original:?} and {addition:?}"),
(original, addition) => {
// Overwrite
*original = addition;
}
},
toml_edit::Entry::Vacant(original) => {
match &mut addition {
Expand Down
16 changes: 6 additions & 10 deletions crates/objc2-encode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
[package]
name = "objc2-encode"
# Remember to update html_root_url in lib.rs
version = "4.0.3"
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.60"

version = "4.0.3" # Remember to update html_root_url in lib.rs
description = "Objective-C type-encoding representation and parsing"
keywords = ["objective-c", "macos", "ios", "encode"]
categories = [
Expand All @@ -14,10 +9,11 @@ categories = [
"no-std",
"os::macos-apis",
]
readme = "README.md"
repository = "https://github.com/madsmtm/objc2"
documentation = "https://docs.rs/objc2-encode/"
license = "MIT"
license = "MIT" # https://github.com/madsmtm/objc2/issues/23
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true

[lints]
workspace = true
Expand Down
11 changes: 5 additions & 6 deletions crates/objc2-exception-helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ name = "objc2-exception-helper"
# Also, beware of using pre-release versions here, since because of the
# `links` key, two pre-releases requested with `=...` are incompatible.
version = "0.1.0"
authors = ["Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.60"

description = "External helper function for catching Objective-C exceptions"
keywords = ["objective-c", "macos", "ios", "exception"]
categories = ["no-std", "no-std::no-alloc", "os::macos-apis"]
repository = "https://github.com/madsmtm/objc2"
license = "MIT"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license = "Zlib OR Apache-2.0 OR MIT"

# Use the `links` key to ensure that only one of these symbols are compiled
#
Expand Down
11 changes: 4 additions & 7 deletions crates/objc2-proc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ name = "objc2-proc-macros"
# Remember to update html_root_url in lib.rs
version = "0.1.3"
authors = ["Mads Marquart <mads@marquart.dk>", "Calvin Watford"]
edition = "2021"
rust-version = "1.60"

description = "Procedural macros for the objc2 project"
keywords = ["objective-c", "macos", "ios", "proc-macro"]
categories = [
"development-tools",
"os::macos-apis",
]
readme = "README.md"
repository = "https://github.com/madsmtm/objc2"
documentation = "https://docs.rs/objc2-proc-macros/"
license = "MIT"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license = "Zlib OR Apache-2.0 OR MIT"

[lib]
proc-macro = true
Expand Down
13 changes: 5 additions & 8 deletions crates/objc2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[package]
name = "objc2"
version = "0.5.2" # Remember to update html_root_url in lib.rs
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
edition = "2021"
rust-version = "1.60"

description = "Objective-C interface and runtime bindings"
keywords = ["objective-c", "macos", "ios", "objc_msgSend", "objc"]
categories = [
Expand All @@ -14,10 +10,11 @@ categories = [
"os::macos-apis",
# "no-std", # TODO
]
readme = "README.md"
repository = "https://github.com/madsmtm/objc2"
documentation = "https://docs.rs/objc2/"
license = "MIT"
license = "MIT" # https://github.com/madsmtm/objc2/issues/23
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true

[lints]
workspace = true
Expand Down
7 changes: 3 additions & 4 deletions crates/test-assembly/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "test-assembly"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

repository = "https://github.com/madsmtm/objc2"
license = "MIT"
repository.workspace = true
license = "Zlib OR Apache-2.0 OR MIT"

build = "build.rs"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_autorelease_return"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/crates/test_block/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_block"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/crates/test_declare_class/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_declare_class"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/crates/test_dynamic_class/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_dynamic_class"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/crates/test_dynamic_sel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_dynamic_sel"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_extern_protocol"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_fast_enumeration"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/crates/test_msg_send_error/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_msg_send_error"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/crates/test_msg_send_id/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_msg_send_id"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_msg_send_static_sel"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_msg_send_zero_cost"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/crates/test_ns_string/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_ns_string"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/crates/test_out_parameters/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_out_parameters"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "test_retain_autoreleased"
version = "0.1.0"
edition = "2021"
edition.workspace = true
publish = false

[lib]
Expand Down
Loading

0 comments on commit deb95fc

Please sign in to comment.