Remove some crates and rename others

This commit is contained in:
Maximilian Ammann 2022-04-22 21:13:58 +02:00
parent b178518705
commit 24bd16c112
55 changed files with 76 additions and 144 deletions

View File

@ -19,8 +19,8 @@ runs:
run: sudo apt-get install -y libwayland-dev libxkbcommon-dev # Required for winit
- name: Build
shell: bash
run: cargo build -p maplibre-example
run: cargo build -p maplibre-demo
- uses: actions/upload-artifact@v2
with:
name: maplibre-rs
path: target/x86_64-unknown-linux-gnu/debug/maplibre-example
path: target/x86_64-unknown-linux-gnu/debug/maplibre-demo

3
.gitignore vendored
View File

@ -6,9 +6,6 @@ target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
!maplibre-android/Cargo.lock
!maplibre-apple/Cargo.lock
!maplibre-example/Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

12
.idea/maplibre-rs.iml generated
View File

@ -5,17 +5,17 @@
<sourceFolder url="file://$MODULE_DIR$/examples" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/libs/mbtiles/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-android/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-apple/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-benchmark/benches" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-benchmark/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-build-tools/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-core/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-example/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-style/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-tilejson/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-web/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/android/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/apple/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/benchmarks/benches" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/benchmarks/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/maplibre-demo/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/web/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />

View File

@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run desktop (release)" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run -p maplibre-example --release" />
<configuration default="false" name="Run demo (debug+enable-tracing)" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run -p maplibre-demo --features enable-tracing" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />

View File

@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Render" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="bench --bench render" />
<configuration default="false" name="Run demo (release)" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run -p maplibre-demo --release" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />

View File

@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run desktop (debug+enable-tracing)" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run -p maplibre-example --features enable-tracing" />
<configuration default="false" name="Run demo (release+enable-tracing)" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run -p maplibre-demo --release --features enable-tracing" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />

View File

@ -1,18 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run desktop (release+enable-tracing)" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run -p maplibre-example --release --features enable-tracing" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />
<option name="allFeatures" value="false" />
<option name="emulateTerminal" value="false" />
<option name="withSudo" value="false" />
<option name="backtrace" value="SHORT" />
<envs />
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2">
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
</component>

View File

@ -1,18 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Tesselation" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="bench --bench tessellation" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />
<option name="allFeatures" value="false" />
<option name="emulateTerminal" value="false" />
<option name="withSudo" value="false" />
<option name="backtrace" value="SHORT" />
<envs />
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2">
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
</component>

View File

@ -5,17 +5,14 @@ resolver = "2"
members = [
"maplibre",
"maplibre-core",
"maplibre-android",
"maplibre-apple",
"maplibre-web",
"maplibre-style",
"maplibre-tilejson",
"maplibre-benchmark",
"maplibre-build-tools",
"maplibre-demo",
"maplibre-example",
"android",
"apple",
"web",
"benchmarks",
]
[profile.release]

View File

@ -1,9 +1,10 @@
[package]
name = "maplibre-android"
name = "android"
version = "0.1.0"
description = ""
categories = []
edition = "2021"
publish = false
[dependencies]
maplibre = { path = "../maplibre" }
@ -13,6 +14,7 @@ env_logger = "0.9"
ndk-glue = "0.5.0" # version is required by winit
[lib]
name = "maplibre_android"
crate-type = ["rlib", "cdylib"]
[package.metadata.android]

View File

@ -4,7 +4,7 @@ pub use std::time::Instant;
// TODO clippy
// #[cfg(not(target_os = "android"))]
// compile_error!("maplibre-android works only on android.");
// compile_error!("android works only on android.");
#[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))]
pub fn main() {

View File

@ -1,13 +1,15 @@
[package]
name = "maplibre-apple"
name = "apple"
version = "0.1.0"
description = ""
categories = []
edition = "2021"
publish = false
[dependencies]
maplibre = { path = "../maplibre" }
env_logger = "0.9"
[lib]
name = "maplibre_apple"
crate-type = ["staticlib"]

View File

@ -4,7 +4,7 @@ pub use std::time::Instant;
// TODO clippy
// #[cfg(not(any(target_os = "macos", target_os = "ios")))]
// compile_error!("maplibre-apple works only on macOS and iOS.");
// compile_error!("apple works only on macOS and iOS.");
#[no_mangle]
pub fn maplibre_apple_main() {

View File

@ -27,10 +27,10 @@ nightly-toolchain:
rustup component add rust-src --toolchain $RUSTUP_TOOLCHAIN
webpack-webgl-production: nightly-toolchain
cd maplibre-web/web && npm install && npm run webgl-production-build
cd web/web && npm install && npm run webgl-production-build
webpack-production: nightly-toolchain
cd maplibre-web/web && npm install && npm run production-build
cd web/web && npm install && npm run production-build
# TODO
# wasm-pack-webgl: nightly-toolchain
@ -65,10 +65,10 @@ install-cargo-apk:
cargo install cargo-apk
run-apk: nightly-toolchain install-cargo-apk
cargo apk run -p maplibre-android --lib -Zbuild-std
cargo apk run -p android --lib -Zbuild-std
build-apk: nightly-toolchain install-cargo-apk
cargo apk build -p maplibre-android --lib -Zbuild-std
cargo apk build -p android --lib -Zbuild-std
# language=bash
print-android-env:

View File

@ -52,9 +52,6 @@ raw-window-handle = "0.4"
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3", optional = true }
maplibre-style = { path = "../maplibre-style" }
maplibre-tilejson = { path = "../maplibre-tilejson" }
cgmath = "0.18"
geo = { version = "0.19" }
@ -80,5 +77,9 @@ bytemuck_derive = "1.0"
include_dir = "0.7.2"
serde = { version = "1.0", features = ["derive"] }
csscolorparser = { version = "0.5", features = ["serde", "cint"]}
cint = "0.2"
[build-dependencies]
maplibre-build-tools = { path = "../maplibre-build-tools" }

View File

@ -21,6 +21,28 @@ fn clean_static_tiles() -> PathBuf {
out
}
/*use std::fs::File;
use std::io::BufReader;
use serde_json::Value;*/
fn generate_type_def() -> Option<u32> {
/* let f = File::open("style-spec-v8.json").unwrap();
let mut reader = BufReader::new(f);
let result = serde_json::from_reader::<_, Value>(&mut reader).unwrap();
let spec_root = result.as_object()?;
let version = &spec_root["$version"].as_i64()?;
let root = &spec_root["$root"].as_object()?;
for x in spec_root {
}
println!("cargo:warning={:?}", version);*/
Some(5)
}
fn embed_tiles_statically() {
let out = clean_static_tiles();

View File

@ -6,7 +6,7 @@ use std::fmt::Formatter;
use cgmath::num_traits::Pow;
use cgmath::{AbsDiffEq, Matrix4, Point3, Vector3};
use maplibre_style::source::TileAddressingScheme;
use crate::style::source::TileAddressingScheme;
use crate::util::math::{div_floor, Aabb2};
use crate::util::SignificantlyDifferent;

View File

@ -1,6 +1,6 @@
use crate::coords::WorldTileCoords;
use crate::error::Error;
use maplibre_style::source::TileAddressingScheme;
use crate::style::source::TileAddressingScheme;
pub struct HttpSourceClient {
#[cfg(not(target_arch = "wasm32"))]

View File

@ -11,6 +11,8 @@ pub(crate) mod render;
pub(crate) mod tessellation;
pub(crate) mod util;
pub(crate) mod winit;
pub(crate) mod style;
pub(crate) mod tilejson;
// Used for benchmarking
pub mod benchmarking;
@ -20,7 +22,7 @@ use crate::map_state::{MapState, Runnable};
use crate::render::render_state::RenderState;
use crate::window::{WindowFactory, WindowSize};
pub use io::scheduler::ScheduleMethod;
use maplibre_style::Style;
use crate::style::Style;
pub use platform::schedule_method::*;
pub struct Map<W, E> {

View File

@ -17,7 +17,7 @@ use crate::io::source_client::{HttpSourceClient, SourceClient};
use crate::io::tile_cache::TileCache;
use crate::io::tile_request_state::TileRequestState;
use crate::io::{TessellateMessage, TileRequest, TileTessellateMessage};
use maplibre_style::Style;
use crate::style::Style;
use wgpu::SurfaceError;
pub trait Runnable<E> {

View File

@ -4,7 +4,7 @@ use std::marker::PhantomData;
use std::mem::size_of;
use std::ops::Range;
use maplibre_style::layer::StyleLayer;
use crate::style::layer::StyleLayer;
use wgpu::BufferAddress;
use crate::coords::{Quadkey, WorldTileCoords};

View File

@ -5,7 +5,7 @@ use std::{cmp, iter};
use tracing;
use wgpu::{Buffer, Limits, Queue};
use maplibre_style::Style;
use crate::style::Style;
use crate::coords::{ViewRegion, Zoom};

View File

@ -2,6 +2,6 @@ pub mod layer;
pub mod source;
mod style;
pub use crate::style::*;
pub use style::*;
pub use cint::*;

View File

@ -1,5 +1,5 @@
use crate::layer::{LayerPaint, LinePaint, StyleLayer};
use crate::source::Source;
use crate::style::layer::{LayerPaint, LinePaint, StyleLayer};
use crate::style::source::Source;
use csscolorparser::Color;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

View File

@ -0,0 +1,3 @@
mod tilejson;
pub use tilejson::*;

View File

@ -1,5 +1,5 @@
[package]
name = "maplibre-example"
name = "maplibre-demo"
version = "0.1.0"
description = ""
categories = []

View File

View File

@ -1,19 +0,0 @@
[package]
name = "maplibre-style"
version = "0.1.0"
description = "A library for decoding style specs"
readme = "README.md"
categories = ["encoding"]
edition = "2021"
build = "build.rs"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
csscolorparser = { version = "0.5", features = ["serde", "cint"]}
cint = "0.2"
[build-dependencies]
serde_json = "1.0"
[dev-dependencies]
serde_json = "1.0"

View File

@ -1,25 +0,0 @@
/*use std::fs::File;
use std::io::BufReader;
use serde_json::Value;*/
fn generate_type_def() -> Option<u32> {
/* let f = File::open("style-spec-v8.json").unwrap();
let mut reader = BufReader::new(f);
let result = serde_json::from_reader::<_, Value>(&mut reader).unwrap();
let spec_root = result.as_object()?;
let version = &spec_root["$version"].as_i64()?;
let root = &spec_root["$root"].as_object()?;
for x in spec_root {
}
println!("cargo:warning={:?}", version);*/
Some(5)
}
fn main() {
generate_type_def();
}

View File

View File

@ -1,12 +0,0 @@
[package]
name = "maplibre-tilejson"
version = "0.1.0"
description = "A library for decoding and encoding tilejson specs"
categories = []
edition = "2021"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
[dev-dependencies]
serde_json = "1.0"

View File

@ -1,3 +0,0 @@
mod tilejson;
pub use crate::tilejson::*;

View File

@ -1,9 +1,10 @@
[package]
name = "maplibre-web"
name = "web"
version = "0.1.0"
description = ""
categories = []
edition = "2021"
publish = false
[features]
web-webgl = ["maplibre-core/web-webgl"]

View File

@ -2,4 +2,4 @@ pub use maplibre_core::*;
// TODO clippy
// #[cfg(not(target_arch = "wasm32"))]
// compile_error!("maplibre-web works only on wasm32.");
// compile_error!("web works only on wasm32.");