mirror of
https://github.com/hexedtech/codemp.git
synced 2024-12-22 12:54:54 +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
|
||||
- js
|
||||
- py
|
||||
- luajit
|
||||
- lua
|
||||
steps:
|
||||
- uses: arduino/setup-protoc@v3
|
||||
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 }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
default = ["lua-jit", "py-abi3"]
|
||||
# extra
|
||||
async-trait = ["dep:async-trait"]
|
||||
serialize = ["dep:serde", "uuid/serde"]
|
||||
# special tests which require more setup
|
||||
test-e2e = []
|
||||
# ffi
|
||||
java = ["lazy_static", "jni", "tracing-subscriber", "jni-toolbox"]
|
||||
js = ["napi-build", "tracing-subscriber", "napi", "napi-derive"]
|
||||
py-noabi = ["pyo3", "tracing-subscriber", "pyo3-build-config"]
|
||||
py = ["py-noabi", "pyo3/abi3-py38"]
|
||||
lua = ["mlua-codemp-patch", "tracing-subscriber", "lazy_static", "serialize"]
|
||||
lua54 =["lua", "mlua-codemp-patch/lua54"]
|
||||
luajit = ["lua", "mlua-codemp-patch/luajit"]
|
||||
java = ["dep:lazy_static", "dep:jni", "dep:tracing-subscriber", "dep:jni-toolbox"]
|
||||
js = ["dep:napi-build", "dep:tracing-subscriber", "dep:napi", "dep:napi-derive"]
|
||||
py = ["dep:pyo3", "dep:tracing-subscriber", "dep:pyo3-build-config"]
|
||||
lua = ["serialize", "dep:mlua-codemp-patch", "dep:tracing-subscriber", "dep:lazy_static"]
|
||||
# ffi variants
|
||||
lua-jit = ["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
|
||||
|
|
4
build.rs
4
build.rs
|
@ -1,7 +1,7 @@
|
|||
#[cfg(feature = "js")]
|
||||
extern crate napi_build;
|
||||
|
||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
||||
#[cfg(feature = "py")]
|
||||
extern crate pyo3_build_config;
|
||||
|
||||
/// The main method of the buildscript, required by some glue modules.
|
||||
|
@ -11,7 +11,7 @@ fn main() {
|
|||
napi_build::setup();
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
||||
#[cfg(feature = "py")]
|
||||
{
|
||||
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 = {
|
||||
type = "rust-mlua",
|
||||
modules = { "codemp" },
|
||||
default_features = false,
|
||||
features = { "lua" },
|
||||
target_path = "../..",
|
||||
include = {
|
||||
["dist/lua/annotations.lua"] = "codemp-annotations.lua",
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
/// be provided every time.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
#[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))]
|
||||
pub struct BufferUpdate {
|
||||
/// Optional content hash after applying this change.
|
||||
|
@ -51,7 +51,7 @@ pub struct BufferUpdate {
|
|||
/// ```
|
||||
#[derive(Clone, Debug, Default)]
|
||||
#[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))]
|
||||
pub struct TextChange {
|
||||
/// 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 {
|
||||
/// Returns true if this [`TextChange`] deletes existing text.
|
||||
///
|
||||
|
|
|
@ -10,10 +10,7 @@
|
|||
/// http{tls?'s':''}://{host}:{port}
|
||||
#[derive(Clone, Debug, Default)]
|
||||
#[cfg_attr(feature = "js", napi_derive::napi(object))]
|
||||
#[cfg_attr(
|
||||
any(feature = "py", feature = "py-noabi"),
|
||||
pyo3::pyclass(get_all, set_all)
|
||||
)]
|
||||
#[cfg_attr(feature = "py", pyo3::pyclass(get_all, set_all))]
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct Config {
|
||||
/// User identifier used to register, possibly your email.
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
//! ### Cursor
|
||||
//! Represents the position of a remote user's cursor.
|
||||
|
||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
||||
#[cfg(feature = "py")]
|
||||
use pyo3::prelude::*;
|
||||
|
||||
/// An event that occurred about a user's cursor.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
#[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 = "py", pyo3(crate = "reexported::pyo3"))]
|
||||
pub struct Cursor {
|
||||
|
@ -20,7 +20,7 @@ pub struct Cursor {
|
|||
/// A cursor selection span.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
#[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 = "py", pyo3(crate = "reexported::pyo3"))]
|
||||
pub struct Selection {
|
||||
|
|
|
@ -6,7 +6,7 @@ use codemp_proto::workspace::workspace_event::Event as WorkspaceEventInner;
|
|||
|
||||
/// Event in a [crate::Workspace].
|
||||
#[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", serde(tag = "type"))]
|
||||
pub enum Event {
|
||||
|
|
|
@ -6,7 +6,7 @@ use uuid::Uuid;
|
|||
|
||||
/// Represents a service user
|
||||
#[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))]
|
||||
pub struct User {
|
||||
/// 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
|
||||
/// with the server while allowing to procedurally receive changes while still sending new ones.
|
||||
#[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)]
|
||||
pub struct BufferController(pub(crate) Arc<BufferControllerInner>);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ use codemp_proto::{
|
|||
session::{session_client::SessionClient, InviteRequest, WorkspaceRequest},
|
||||
};
|
||||
|
||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
||||
#[cfg(feature = "py")]
|
||||
use pyo3::prelude::*;
|
||||
|
||||
/// A `codemp` client handle.
|
||||
|
@ -32,7 +32,7 @@ use pyo3::prelude::*;
|
|||
/// A new [`Client`] can be obtained with [`Client::connect`].
|
||||
#[derive(Debug, Clone)]
|
||||
#[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>);
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -21,7 +21,7 @@ use codemp_proto::{
|
|||
///
|
||||
/// An unique [CursorController] exists for each active [crate::Workspace].
|
||||
#[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)]
|
||||
pub struct CursorController(pub(crate) Arc<CursorControllerInner>);
|
||||
|
||||
|
|
|
@ -210,5 +210,5 @@ pub mod lua;
|
|||
pub mod js;
|
||||
|
||||
/// python bindings, built with [pyo3]
|
||||
#[cfg(any(feature = "py", feature = "py-noabi"))]
|
||||
#[cfg(feature = "py")]
|
||||
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)
|
||||
/// and create/delete/attach to new buffers.
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(any(feature = "py", feature = "py-noabi"), pyo3::pyclass)]
|
||||
#[cfg_attr(feature = "py", pyo3::pyclass)]
|
||||
#[cfg_attr(feature = "js", napi)]
|
||||
pub struct Workspace(Arc<WorkspaceInner>);
|
||||
|
||||
|
|
Loading…
Reference in a new issue