Skip to content

Commit 61b90e7

Browse files
authored
Deprecate cocoa, cocoa-foundation and io-surface and link to objc2 crates instead (#731)
* Deprecate cocoa-foundation * Deprecate cocoa * Deprecate io-surface
1 parent 0e783c6 commit 61b90e7

17 files changed

+23
-26
lines changed

cocoa-foundation/src/base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
9+
#![deprecated = "use the objc2 crate instead"]
910

1011
use objc::runtime;
1112

cocoa-foundation/src/foundation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
9-
9+
#![deprecated = "use the objc2-foundation crate instead"]
1010
#![allow(non_upper_case_globals)]
1111

1212
use crate::base::{id, nil, BOOL, NO, SEL};

cocoa-foundation/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
#![allow(non_snake_case)]
10+
//! This crate has been deprecated in favour of the `objc2-foundation` crate.
11+
#![allow(non_snake_case, deprecated)]
1112

1213
pub mod base;
1314
pub mod foundation;

cocoa-foundation/tests/foundation.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(deprecated)]
2+
13
#[cfg(test)]
24
mod foundation {
35
mod nsstring {

cocoa/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Cocoa-rs
22
--------
33

4+
NOTE: This crate has been deprecated in favour of the `objc2` crates.
5+
46
This crate provides Rust bindings to Cocoa for macOS. It's dual-licensed MIT /
57
Apache 2.0. If you'd like to help improve cocoa-rs, check out [the Servo
6-
contributing guide](https://github.com/servo/servo/blob/main/CONTRIBUTING.md)!
8+
contributing guide](https://github.com/servo/servo/blob/main/CONTRIBUTING.md)!

cocoa/examples/color.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)] // the cocoa crate is deprecated
12
use cocoa::base::{id, nil, selector, NO};
23

34
use cocoa::appkit::{

cocoa/examples/fullscreen.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)] // the cocoa crate is deprecated
12
use cocoa::appkit::{
23
NSApp, NSApplication, NSApplicationActivateIgnoringOtherApps,
34
NSApplicationActivationPolicyRegular, NSApplicationPresentationOptions, NSBackingStoreBuffered,

cocoa/examples/hello_world.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)] // the cocoa crate is deprecated
12
use cocoa::appkit::{
23
NSApp, NSApplication, NSApplicationActivateIgnoringOtherApps,
34
NSApplicationActivationPolicyRegular, NSBackingStoreBuffered, NSMenu, NSMenuItem,

cocoa/examples/nsvisualeffectview_blur.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)] // the cocoa crate is deprecated
12
use cocoa::base::{nil, selector, NO};
23
use objc::*;
34

cocoa/examples/tab_view.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)] // the cocoa crate is deprecated
12
use cocoa::base::{id, nil, selector, NO};
23

34
use cocoa::appkit::{

cocoa/src/appkit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10+
#![deprecated = "use the objc2-app-kit crate instead"]
1011
#![allow(non_upper_case_globals)]
1112

1213
use crate::base::{id, BOOL, SEL};

cocoa/src/base.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

cocoa/src/foundation.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

cocoa/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10+
//! This crate has been deprecated in favour of the `objc2` crates.
1011
#![crate_name = "cocoa"]
1112
#![crate_type = "rlib"]
12-
#![allow(non_snake_case)]
13+
#![allow(non_snake_case, deprecated)]
1314

1415
#[cfg(target_os = "macos")]
1516
pub mod appkit;
16-
pub mod base;
17-
pub mod foundation;
17+
pub use cocoa_foundation::base;
18+
pub use cocoa_foundation::foundation;
1819
#[cfg(target_os = "macos")]
1920
pub mod quartzcore;
2021
#[macro_use]

cocoa/src/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
/// # }
3939
/// ```
4040
#[macro_export]
41+
#[deprecated = "use the objc2::define_class! macro instead"]
4142
macro_rules! delegate {
4243
(
4344
$name:expr, {

cocoa/src/quartzcore.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10+
#![deprecated = "use the objc2-quartz-core crate instead"]
1011
#![allow(non_upper_case_globals)]
1112

1213
use bitflags::bitflags;

io-surface/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10+
//! This crate has been deprecated in favour of the `objc2-io-surface` crate.
11+
#![deprecated = "use the objc2-io-surface crate instead"]
1012
#![crate_name = "io_surface"]
1113
#![crate_type = "rlib"]
1214

0 commit comments

Comments
 (0)