Move winit itself to crate

That way we use top-level Cargo.toml only for the workspace management
purposes.
This commit is contained in:
Kirill Chibisov 2025-06-07 13:07:12 +09:00 committed by GitHub
parent 478427b0bd
commit 3a84da6951
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 140 additions and 134 deletions

View file

@ -66,7 +66,7 @@ jobs:
- { name: 'Linux 64bit', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, } - { name: 'Linux 64bit', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, }
- { name: 'X11', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: '--no-default-features --features=x11' } - { name: 'X11', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: '--no-default-features --features=x11' }
- { name: 'Wayland', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: '--no-default-features --features=wayland,wayland-dlopen' } - { name: 'Wayland', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: '--no-default-features --features=wayland,wayland-dlopen' }
- { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity', cmd: 'apk --' } - { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package winit --features=android-native-activity', cmd: 'apk -- ' }
- { name: 'Redox OS', target: x86_64-unknown-redox, os: ubuntu-latest, } - { name: 'Redox OS', target: x86_64-unknown-redox, os: ubuntu-latest, }
- { name: 'macOS x86_64', target: x86_64-apple-darwin, os: macos-latest, } - { name: 'macOS x86_64', target: x86_64-apple-darwin, os: macos-latest, }
- { name: 'macOS Aarch64', target: aarch64-apple-darwin, os: macos-latest, } - { name: 'macOS Aarch64', target: aarch64-apple-darwin, os: macos-latest, }
@ -89,7 +89,7 @@ jobs:
platform: { name: 'Redox OS' } platform: { name: 'Redox OS' }
include: include:
- toolchain: '1.80' - toolchain: '1.80'
platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity', cmd: 'apk --' } platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package winit --features=android-native-activity', cmd: 'apk -- ' }
- toolchain: 'nightly' - toolchain: 'nightly'
platform: { name: 'Web', target: wasm32-unknown-unknown, os: ubuntu-latest, test-options: -Zdoctest-xcompile } platform: { name: 'Web', target: wasm32-unknown-unknown, os: ubuntu-latest, test-options: -Zdoctest-xcompile }
- toolchain: 'nightly' - toolchain: 'nightly'
@ -313,6 +313,7 @@ jobs:
with: with:
command: check command: check
log-level: error log-level: error
manifest-path: winit/Cargo.toml
arguments: --all-features --target ${{ matrix.platform.target }} arguments: --all-features --target ${{ matrix.platform.target }}
eslint: eslint:

View file

@ -3,6 +3,6 @@ Changelog entries should be put in the [`changelog::unreleased`].
The changelog can also be viewed [on docs.rs][docs_rs] or [on the current The changelog can also be viewed [on docs.rs][docs_rs] or [on the current
master docs][master_docs]. master docs][master_docs].
[`changelog::unreleased`]: src/changelog/unreleased.md [`changelog::unreleased`]: winit/src/changelog/unreleased.md
[docs_rs]: https://docs.rs/winit/latest/winit/changelog/index.html [docs_rs]: https://docs.rs/winit/latest/winit/changelog/index.html
[master_docs]: https://rust-windowing.github.io/winit/winit/changelog/index.html [master_docs]: https://rust-windowing.github.io/winit/winit/changelog/index.html

View file

@ -1,5 +1,6 @@
[workspace] [workspace]
members = ["dpi", "winit-*"] default-members = ["winit"]
members = ["dpi", "winit*"]
resolver = "2" resolver = "2"
[workspace.package] [workspace.package]
@ -11,7 +12,7 @@ rust-version = "1.80"
[workspace.dependencies] [workspace.dependencies]
# Workspace dependencies. # Workspace dependencies.
# `winit` has no version here to allow using it in dev deps for docs. # `winit` has no version here to allow using it in dev deps for docs.
winit = { path = "." } winit = { path = "winit" }
winit-android = { version = "0.0.0", path = "winit-android" } winit-android = { version = "0.0.0", path = "winit-android" }
winit-appkit = { version = "0.0.0", path = "winit-appkit" } winit-appkit = { version = "0.0.0", path = "winit-appkit" }
winit-common = { version = "0.0.0", path = "winit-common" } winit-common = { version = "0.0.0", path = "winit-common" }
@ -99,132 +100,3 @@ wasm-bindgen-futures = "0.4.43"
wasm-bindgen-test = "0.3" wasm-bindgen-test = "0.3"
web-time = "1" web-time = "1"
web_sys = { package = "web-sys", version = "0.3.70" } web_sys = { package = "web-sys", version = "0.3.70" }
##
## Top-level Winit crate.
##
[package]
authors = ["The winit contributors", "Pierre Krieger <pierre.krieger1708@gmail.com>"]
categories = ["gui"]
description = "Cross-platform window creation library."
documentation = "https://docs.rs/winit"
edition.workspace = true
include = ["/build.rs", "/docs", "/examples", "/FEATURES.md", "/LICENSE", "/src", "/tests"]
keywords = ["windowing"]
license.workspace = true
name = "winit"
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
version = "0.30.11"
[package.metadata.docs.rs]
features = [
"serde",
"mint",
# Enabled to get docs to compile
"android-native-activity",
]
# These are all tested in CI
rustdoc-args = ["--cfg", "docsrs"]
targets = [
# Windows
"i686-pc-windows-msvc",
"x86_64-pc-windows-msvc",
# macOS
"aarch64-apple-darwin",
"x86_64-apple-darwin",
# Unix (X11 & Wayland)
"i686-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
# iOS
"aarch64-apple-ios",
# Android
"aarch64-linux-android",
# Web
"wasm32-unknown-unknown",
]
# Features are documented in either `lib.rs` or under `winit::platform`.
[features]
default = ["x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"]
android-game-activity = ["winit-android/game-activity"]
android-native-activity = ["winit-android/native-activity"]
mint = ["dpi/mint"]
serde = [
"dep:serde",
"cursor-icon/serde",
"smol_str/serde",
"dpi/serde",
"bitflags/serde",
"winit-core/serde",
"winit-uikit/serde",
]
wayland = ["winit-wayland"]
wayland-csd-adwaita = ["winit-wayland/csd-adwaita"]
wayland-csd-adwaita-crossfont = ["winit-wayland/csd-adwaita-crossfont"]
wayland-csd-adwaita-notitle = ["winit-wayland/csd-adwaita-notitle"]
wayland-dlopen = ["winit-wayland/dlopen"]
x11 = ["dep:winit-x11"]
[build-dependencies]
cfg_aliases.workspace = true
[dependencies]
bitflags.workspace = true
cursor-icon.workspace = true
dpi.workspace = true
rwh_06.workspace = true
serde = { workspace = true, optional = true }
smol_str.workspace = true
tracing.workspace = true
winit-core.workspace = true
[dev-dependencies]
image = { workspace = true, features = ["png"] }
tracing = { workspace = true, features = ["log"] }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
[target.'cfg(not(target_os = "android"))'.dev-dependencies]
softbuffer.workspace = true
[target.'cfg(target_os = "android")'.dependencies]
winit-android.workspace = true
[target.'cfg(target_os = "macos")'.dependencies]
winit-appkit.workspace = true
[target.'cfg(all(target_vendor = "apple", not(target_os = "macos")))'.dependencies]
winit-uikit.workspace = true
[target.'cfg(target_os = "windows")'.dependencies]
winit-win32.workspace = true
# Linux
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_vendor = "apple"))))'.dependencies]
libc.workspace = true
rustix = { workspace = true, features = ["std", "thread"] }
winit-common = { workspace = true, features = ["xkb"] }
winit-wayland = { workspace = true, optional = true, default-features = false }
winit-x11 = { workspace = true, optional = true }
[target.'cfg(target_os = "redox")'.dependencies]
winit-orbital.workspace = true
[target.'cfg(target_family = "wasm")'.dependencies]
winit-web.workspace = true
[target.'cfg(target_family = "wasm")'.dev-dependencies]
console_error_panic_hook.workspace = true
tracing-web.workspace = true
wasm-bindgen-futures.workspace = true
wasm-bindgen-test.workspace = true
web-time.workspace = true
[[example]]
doc-scrape-examples = true
name = "window"
[[example]]
name = "child_window"

1
winit-android/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit-appkit/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit-common/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit-orbital/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit-uikit/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit-wayland/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit-web/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit-win32/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit-x11/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

119
winit/Cargo.toml Normal file
View file

@ -0,0 +1,119 @@
[package]
categories = ["gui"]
description = "Cross-platform window creation library."
documentation = "https://docs.rs/winit"
edition.workspace = true
keywords = ["windowing"]
license.workspace = true
name = "winit"
repository.workspace = true
rust-version.workspace = true
version = "0.30.11"
[package.metadata.docs.rs]
features = [
"serde",
"mint",
# Enabled to get docs to compile
"android-native-activity",
]
# These are all tested in CI
rustdoc-args = ["--cfg", "docsrs"]
targets = [
# Windows
"i686-pc-windows-msvc",
"x86_64-pc-windows-msvc",
# macOS
"aarch64-apple-darwin",
"x86_64-apple-darwin",
# Unix (X11 & Wayland)
"i686-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
# iOS
"aarch64-apple-ios",
# Android
"aarch64-linux-android",
# Web
"wasm32-unknown-unknown",
]
# Features are documented in either `lib.rs` or under `winit::platform`.
[features]
default = ["x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"]
android-game-activity = ["winit-android/game-activity"]
android-native-activity = ["winit-android/native-activity"]
mint = ["dpi/mint"]
serde = [
"dep:serde",
"cursor-icon/serde",
"smol_str/serde",
"dpi/serde",
"bitflags/serde",
"winit-core/serde",
"winit-uikit/serde",
]
wayland = ["winit-wayland"]
wayland-csd-adwaita = ["winit-wayland/csd-adwaita"]
wayland-csd-adwaita-crossfont = ["winit-wayland/csd-adwaita-crossfont"]
wayland-csd-adwaita-notitle = ["winit-wayland/csd-adwaita-notitle"]
wayland-dlopen = ["winit-wayland/dlopen"]
x11 = ["dep:winit-x11"]
[build-dependencies]
cfg_aliases.workspace = true
[dependencies]
bitflags.workspace = true
cursor-icon.workspace = true
dpi.workspace = true
rwh_06.workspace = true
serde = { workspace = true, optional = true }
smol_str.workspace = true
tracing.workspace = true
winit-core.workspace = true
[dev-dependencies]
image = { workspace = true, features = ["png"] }
tracing = { workspace = true, features = ["log"] }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
[target.'cfg(not(target_os = "android"))'.dev-dependencies]
softbuffer.workspace = true
[target.'cfg(target_os = "android")'.dependencies]
winit-android.workspace = true
[target.'cfg(target_os = "macos")'.dependencies]
winit-appkit.workspace = true
[target.'cfg(all(target_vendor = "apple", not(target_os = "macos")))'.dependencies]
winit-uikit.workspace = true
[target.'cfg(target_os = "windows")'.dependencies]
winit-win32.workspace = true
# Linux
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_vendor = "apple"))))'.dependencies]
libc.workspace = true
rustix = { workspace = true, features = ["std", "thread"] }
winit-common = { workspace = true, features = ["xkb"] }
winit-wayland = { workspace = true, optional = true, default-features = false }
winit-x11 = { workspace = true, optional = true }
[target.'cfg(target_os = "redox")'.dependencies]
winit-orbital.workspace = true
[target.'cfg(target_family = "wasm")'.dependencies]
winit-web.workspace = true
[target.'cfg(target_family = "wasm")'.dev-dependencies]
console_error_panic_hook.workspace = true
tracing-web.workspace = true
wasm-bindgen-futures.workspace = true
wasm-bindgen-test.workspace = true
web-time.workspace = true
[[example]]
doc-scrape-examples = true
name = "window"

1
winit/FEATURES.md Symbolic link
View file

@ -0,0 +1 @@
../FEATURES.md

1
winit/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

1
winit/README.md Symbolic link
View file

@ -0,0 +1 @@
../README.md

1
winit/docs Symbolic link
View file

@ -0,0 +1 @@
../docs

1
winit/examples Symbolic link
View file

@ -0,0 +1 @@
../examples