mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-24 08:04:48 +01:00
chore: cargo features (#66)
Some checks are pending
test / test-unit (push) Waiting to run
test / test-beta (beta) (push) Blocked by required conditions
test / test-beta (nightly) (push) Blocked by required conditions
test / test-functional (push) Blocked by required conditions
test / test-build (java, macos-latest) (push) Blocked by required conditions
test / test-build (java, ubuntu-latest) (push) Blocked by required conditions
test / test-build (java, windows-latest) (push) Blocked by required conditions
test / test-build (js, macos-latest) (push) Blocked by required conditions
test / test-build (js, ubuntu-latest) (push) Blocked by required conditions
test / test-build (js, windows-latest) (push) Blocked by required conditions
test / test-build (lua, macos-latest) (push) Blocked by required conditions
test / test-build (lua, ubuntu-latest) (push) Blocked by required conditions
test / test-build (lua, windows-latest) (push) Blocked by required conditions
test / test-build (py, macos-latest) (push) Blocked by required conditions
test / test-build (py, ubuntu-latest) (push) Blocked by required conditions
test / test-build (py, windows-latest) (push) Blocked by required conditions
Some checks are pending
test / test-unit (push) Waiting to run
test / test-beta (beta) (push) Blocked by required conditions
test / test-beta (nightly) (push) Blocked by required conditions
test / test-functional (push) Blocked by required conditions
test / test-build (java, macos-latest) (push) Blocked by required conditions
test / test-build (java, ubuntu-latest) (push) Blocked by required conditions
test / test-build (java, windows-latest) (push) Blocked by required conditions
test / test-build (js, macos-latest) (push) Blocked by required conditions
test / test-build (js, ubuntu-latest) (push) Blocked by required conditions
test / test-build (js, windows-latest) (push) Blocked by required conditions
test / test-build (lua, macos-latest) (push) Blocked by required conditions
test / test-build (lua, ubuntu-latest) (push) Blocked by required conditions
test / test-build (lua, windows-latest) (push) Blocked by required conditions
test / test-build (py, macos-latest) (push) Blocked by required conditions
test / test-build (py, ubuntu-latest) (push) Blocked by required conditions
test / test-build (py, windows-latest) (push) Blocked by required conditions
* chore: changed features layout now using `dep:` and `crate?/feat` syntaxes (introduced in rust 1.60). this may mess with lua rockspec
This commit is contained in:
parent
02a31d7000
commit
4fcab00d34
14 changed files with 29 additions and 29 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -69,7 +69,7 @@ jobs:
|
||||||
- java
|
- java
|
||||||
- js
|
- js
|
||||||
- py
|
- py
|
||||||
- luajit
|
- lua
|
||||||
steps:
|
steps:
|
||||||
- uses: arduino/setup-protoc@v3
|
- uses: arduino/setup-protoc@v3
|
||||||
with:
|
with:
|
||||||
|
|
17
Cargo.toml
17
Cargo.toml
|
@ -64,20 +64,21 @@ napi-build = { version = "2.1", optional = true }
|
||||||
pyo3-build-config = { version = "0.22", optional = true }
|
pyo3-build-config = { version = "0.22", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = ["lua-jit", "py-abi3"]
|
||||||
# extra
|
# extra
|
||||||
async-trait = ["dep:async-trait"]
|
async-trait = ["dep:async-trait"]
|
||||||
serialize = ["dep:serde", "uuid/serde"]
|
serialize = ["dep:serde", "uuid/serde"]
|
||||||
# special tests which require more setup
|
# special tests which require more setup
|
||||||
test-e2e = []
|
test-e2e = []
|
||||||
# ffi
|
# ffi
|
||||||
java = ["lazy_static", "jni", "tracing-subscriber", "jni-toolbox"]
|
java = ["dep:lazy_static", "dep:jni", "dep:tracing-subscriber", "dep:jni-toolbox"]
|
||||||
js = ["napi-build", "tracing-subscriber", "napi", "napi-derive"]
|
js = ["dep:napi-build", "dep:tracing-subscriber", "dep:napi", "dep:napi-derive"]
|
||||||
py-noabi = ["pyo3", "tracing-subscriber", "pyo3-build-config"]
|
py = ["dep:pyo3", "dep:tracing-subscriber", "dep:pyo3-build-config"]
|
||||||
py = ["py-noabi", "pyo3/abi3-py38"]
|
lua = ["serialize", "dep:mlua-codemp-patch", "dep:tracing-subscriber", "dep:lazy_static"]
|
||||||
lua = ["mlua-codemp-patch", "tracing-subscriber", "lazy_static", "serialize"]
|
# ffi variants
|
||||||
lua54 =["lua", "mlua-codemp-patch/lua54"]
|
lua-jit = ["mlua-codemp-patch?/luajit"]
|
||||||
luajit = ["lua", "mlua-codemp-patch/luajit"]
|
lua-54 = ["mlua-codemp-patch?/lua54"]
|
||||||
|
py-abi3 = ["pyo3?/abi3-py38"]
|
||||||
|
|
||||||
|
|
||||||
[package.metadata.docs.rs] # enabled features when building on docs.rs
|
[package.metadata.docs.rs] # enabled features when building on docs.rs
|
||||||
|
|
4
build.rs
4
build.rs
|
@ -1,7 +1,7 @@
|
||||||
#[cfg(feature = "js")]
|
#[cfg(feature = "js")]
|
||||||
extern crate napi_build;
|
extern crate napi_build;
|
||||||
|
|
||||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
#[cfg(feature = "py")]
|
||||||
extern crate pyo3_build_config;
|
extern crate pyo3_build_config;
|
||||||
|
|
||||||
/// The main method of the buildscript, required by some glue modules.
|
/// The main method of the buildscript, required by some glue modules.
|
||||||
|
@ -11,7 +11,7 @@ fn main() {
|
||||||
napi_build::setup();
|
napi_build::setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
#[cfg(feature = "py")]
|
||||||
{
|
{
|
||||||
pyo3_build_config::add_extension_module_link_args();
|
pyo3_build_config::add_extension_module_link_args();
|
||||||
}
|
}
|
||||||
|
|
2
dist/lua/codemp-0.8.2-1.rockspec
vendored
2
dist/lua/codemp-0.8.2-1.rockspec
vendored
|
@ -29,6 +29,8 @@ description = {
|
||||||
build = {
|
build = {
|
||||||
type = "rust-mlua",
|
type = "rust-mlua",
|
||||||
modules = { "codemp" },
|
modules = { "codemp" },
|
||||||
|
default_features = false,
|
||||||
|
features = { "lua" },
|
||||||
target_path = "../..",
|
target_path = "../..",
|
||||||
include = {
|
include = {
|
||||||
["dist/lua/annotations.lua"] = "codemp-annotations.lua",
|
["dist/lua/annotations.lua"] = "codemp-annotations.lua",
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
/// be provided every time.
|
/// be provided every time.
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pyclass(get_all))]
|
#[cfg_attr(feature = "py", pyo3::pyclass(get_all))]
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct BufferUpdate {
|
pub struct BufferUpdate {
|
||||||
/// Optional content hash after applying this change.
|
/// Optional content hash after applying this change.
|
||||||
|
@ -51,7 +51,7 @@ pub struct BufferUpdate {
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pyclass(get_all))]
|
#[cfg_attr(feature = "py", pyo3::pyclass(get_all))]
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct TextChange {
|
pub struct TextChange {
|
||||||
/// Range start of text change, as char indexes in buffer previous state.
|
/// Range start of text change, as char indexes in buffer previous state.
|
||||||
|
@ -69,7 +69,7 @@ impl TextChange {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pymethods)]
|
#[cfg_attr(feature = "py", pyo3::pymethods)]
|
||||||
impl TextChange {
|
impl TextChange {
|
||||||
/// Returns true if this [`TextChange`] deletes existing text.
|
/// Returns true if this [`TextChange`] deletes existing text.
|
||||||
///
|
///
|
||||||
|
|
|
@ -10,10 +10,7 @@
|
||||||
/// http{tls?'s':''}://{host}:{port}
|
/// http{tls?'s':''}://{host}:{port}
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "py", pyo3::pyclass(get_all, set_all))]
|
||||||
any(feature = "py", feature = "py-noabi"),
|
|
||||||
pyo3::pyclass(get_all, set_all)
|
|
||||||
)]
|
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
/// User identifier used to register, possibly your email.
|
/// User identifier used to register, possibly your email.
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
//! ### Cursor
|
//! ### Cursor
|
||||||
//! Represents the position of a remote user's cursor.
|
//! Represents the position of a remote user's cursor.
|
||||||
|
|
||||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
#[cfg(feature = "py")]
|
||||||
use pyo3::prelude::*;
|
use pyo3::prelude::*;
|
||||||
|
|
||||||
/// An event that occurred about a user's cursor.
|
/// An event that occurred about a user's cursor.
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyclass)]
|
#[cfg_attr(feature = "py", pyclass)]
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
// #[cfg_attr(feature = "py", pyo3(crate = "reexported::pyo3"))]
|
// #[cfg_attr(feature = "py", pyo3(crate = "reexported::pyo3"))]
|
||||||
pub struct Cursor {
|
pub struct Cursor {
|
||||||
|
@ -20,7 +20,7 @@ pub struct Cursor {
|
||||||
/// A cursor selection span.
|
/// A cursor selection span.
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyclass)]
|
#[cfg_attr(feature = "py", pyclass)]
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
// #[cfg_attr(feature = "py", pyo3(crate = "reexported::pyo3"))]
|
// #[cfg_attr(feature = "py", pyo3(crate = "reexported::pyo3"))]
|
||||||
pub struct Selection {
|
pub struct Selection {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use codemp_proto::workspace::workspace_event::Event as WorkspaceEventInner;
|
||||||
|
|
||||||
/// Event in a [crate::Workspace].
|
/// Event in a [crate::Workspace].
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pyclass)]
|
#[cfg_attr(feature = "py", pyo3::pyclass)]
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
#[cfg_attr(feature = "serialize", serde(tag = "type"))]
|
#[cfg_attr(feature = "serialize", serde(tag = "type"))]
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use uuid::Uuid;
|
||||||
|
|
||||||
/// Represents a service user
|
/// Represents a service user
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pyclass)]
|
#[cfg_attr(feature = "py", pyo3::pyclass)]
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
/// User unique identifier, should never change.
|
/// User unique identifier, should never change.
|
||||||
|
|
|
@ -17,7 +17,7 @@ use crate::ext::IgnorableError;
|
||||||
/// Each buffer controller internally tracks the last acknowledged state, remaining always in sync
|
/// Each buffer controller internally tracks the last acknowledged state, remaining always in sync
|
||||||
/// with the server while allowing to procedurally receive changes while still sending new ones.
|
/// with the server while allowing to procedurally receive changes while still sending new ones.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pyclass)]
|
#[cfg_attr(feature = "py", pyo3::pyclass)]
|
||||||
#[cfg_attr(feature = "js", napi_derive::napi)]
|
#[cfg_attr(feature = "js", napi_derive::napi)]
|
||||||
pub struct BufferController(pub(crate) Arc<BufferControllerInner>);
|
pub struct BufferController(pub(crate) Arc<BufferControllerInner>);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ use codemp_proto::{
|
||||||
session::{session_client::SessionClient, InviteRequest, WorkspaceRequest},
|
session::{session_client::SessionClient, InviteRequest, WorkspaceRequest},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
#[cfg(feature = "py")]
|
||||||
use pyo3::prelude::*;
|
use pyo3::prelude::*;
|
||||||
|
|
||||||
/// A `codemp` client handle.
|
/// A `codemp` client handle.
|
||||||
|
@ -32,7 +32,7 @@ use pyo3::prelude::*;
|
||||||
/// A new [`Client`] can be obtained with [`Client::connect`].
|
/// A new [`Client`] can be obtained with [`Client::connect`].
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(feature = "js", napi_derive::napi)]
|
#[cfg_attr(feature = "js", napi_derive::napi)]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyclass)]
|
#[cfg_attr(feature = "py", pyclass)]
|
||||||
pub struct Client(Arc<ClientInner>);
|
pub struct Client(Arc<ClientInner>);
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -21,7 +21,7 @@ use codemp_proto::{
|
||||||
///
|
///
|
||||||
/// An unique [CursorController] exists for each active [crate::Workspace].
|
/// An unique [CursorController] exists for each active [crate::Workspace].
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pyclass)]
|
#[cfg_attr(feature = "py", pyo3::pyclass)]
|
||||||
#[cfg_attr(feature = "js", napi_derive::napi)]
|
#[cfg_attr(feature = "js", napi_derive::napi)]
|
||||||
pub struct CursorController(pub(crate) Arc<CursorControllerInner>);
|
pub struct CursorController(pub(crate) Arc<CursorControllerInner>);
|
||||||
|
|
||||||
|
|
|
@ -210,5 +210,5 @@ pub mod lua;
|
||||||
pub mod js;
|
pub mod js;
|
||||||
|
|
||||||
/// python bindings, built with [pyo3]
|
/// python bindings, built with [pyo3]
|
||||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
#[cfg(feature = "py")]
|
||||||
pub mod python;
|
pub mod python;
|
||||||
|
|
|
@ -41,7 +41,7 @@ use napi_derive::napi;
|
||||||
/// Using a workspace handle, it's possible to receive events (user join/leave, filetree updates)
|
/// Using a workspace handle, it's possible to receive events (user join/leave, filetree updates)
|
||||||
/// and create/delete/attach to new buffers.
|
/// and create/delete/attach to new buffers.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pyclass)]
|
#[cfg_attr(feature = "py", pyo3::pyclass)]
|
||||||
#[cfg_attr(feature = "js", napi)]
|
#[cfg_attr(feature = "js", napi)]
|
||||||
pub struct Workspace(Arc<WorkspaceInner>);
|
pub struct Workspace(Arc<WorkspaceInner>);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue