0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-23 15:50:11 -05:00

fix: separate out android example into crate (#871)

This commit is contained in:
Divy Srivastava 2022-01-19 16:09:07 +05:30 committed by GitHub
parent 107c11905c
commit d171fbb890
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 80 additions and 70 deletions

112
Cargo.lock generated
View file

@ -96,9 +96,9 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
[[package]]
name = "bumpalo"
version = "3.8.0"
version = "3.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c"
checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899"
[[package]]
name = "bytemuck"
@ -114,9 +114,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]]
name = "calloop"
version = "0.9.1"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42dcfbd723aa6eff9f024cfd5ad08b11144d79b2d8d37b4a31a006ceab255c77"
checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82"
dependencies = [
"log",
"nix",
@ -327,17 +327,6 @@ dependencies = [
"syn",
]
[[package]]
name = "derivative"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "dispatch"
version = "0.2.0"
@ -396,6 +385,17 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "fractal"
version = "0.38.0"
dependencies = [
"ndk 0.3.0",
"ndk-glue",
"pixels",
"v8",
"winit",
]
[[package]]
name = "fslock"
version = "0.1.6"
@ -417,9 +417,9 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c"
dependencies = [
"cfg-if 1.0.0",
"libc",
@ -434,9 +434,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]]
name = "glow"
version = "0.11.1"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c07210904884e8e2e6a2d7f36f39040a9cefe3b379b721969b5275e9f5b464a"
checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919"
dependencies = [
"js-sys",
"slotmap",
@ -506,9 +506,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "indexmap"
version = "1.7.0"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"
dependencies = [
"autocfg",
"hashbrown",
@ -577,9 +577,9 @@ checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
[[package]]
name = "libloading"
version = "0.7.2"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52"
checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"
dependencies = [
"cfg-if 1.0.0",
"winapi",
@ -799,19 +799,18 @@ dependencies = [
[[package]]
name = "num_enum"
version = "0.5.5"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "085fe377a4b2805c0fbc09484415ec261174614b7f080b0e0d520456ac421a67"
checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad"
dependencies = [
"derivative",
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
version = "0.5.5"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5249369707a1e07b39f78d98c8f34e00aca7dcb053812fdbb5ad7be82c1bba38"
checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@ -897,9 +896,9 @@ checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
[[package]]
name = "pollster"
version = "0.2.4"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb20dcc30536a1508e75d47dd0e399bb2fe7354dcf35cda9127f2bf1ed92e30e"
checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7"
[[package]]
name = "proc-macro-crate"
@ -922,9 +921,9 @@ dependencies = [
[[package]]
name = "profiling"
version = "1.0.4"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9926767b8b8244d7b6b64546585121d193c3d0b4856ccd656b7bfa9deb91ab6a"
checksum = "9145ac0af1d93c638c98c40cf7d25665f427b2a44ad0a99b1dccf3e2f25bb987"
[[package]]
name = "quote"
@ -1061,15 +1060,15 @@ dependencies = [
[[package]]
name = "smallvec"
version = "1.7.0"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
[[package]]
name = "smithay-client-toolkit"
version = "0.15.2"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "210cf40de565aaaa085face1d860b17f6aee9f76f9d2816307ea2cc45eeb64f3"
checksum = "1325f292209cee78d5035530932422a30aa4c8fda1a16593ac083c1de211e68a"
dependencies = [
"bitflags",
"calloop",
@ -1193,25 +1192,21 @@ dependencies = [
"fslock",
"lazy_static",
"libc",
"ndk 0.3.0",
"ndk-glue",
"pixels",
"trybuild",
"which",
"winit",
]
[[package]]
name = "version_check"
version = "0.9.3"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "wasi"
version = "0.10.2+wasi-snapshot-preview1"
version = "0.10.3+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
checksum = "46a2e384a3f170b0c7543787a91411175b71afd56ba4d3a0ae5678d4e2243c0e"
[[package]]
name = "wasm-bindgen"
@ -1281,9 +1276,9 @@ checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
[[package]]
name = "wayland-client"
version = "0.29.1"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9108ec1c37f4774d0c2937ba1a6c23d1786b2152c4a13bd9fdb20e42d16e8841"
checksum = "91223460e73257f697d9e23d401279123d36039a3f7a449e983f123292d4458f"
dependencies = [
"bitflags",
"downcast-rs",
@ -1297,9 +1292,9 @@ dependencies = [
[[package]]
name = "wayland-commons"
version = "0.29.1"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "265ef51b3b3e5c9ef098f10425c39624663f459c3821dcaacc4748be975f1beb"
checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e"
dependencies = [
"nix",
"once_cell",
@ -1309,9 +1304,9 @@ dependencies = [
[[package]]
name = "wayland-cursor"
version = "0.29.1"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c19bb6628daf4097e58b7911481e8371e13318d5a60894779901bd3267407a7"
checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd"
dependencies = [
"nix",
"wayland-client",
@ -1320,9 +1315,9 @@ dependencies = [
[[package]]
name = "wayland-protocols"
version = "0.29.1"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b3b6f1dc0193072ef4eadcb144da30d58c1f2895516c063804d213310703c8e"
checksum = "60147ae23303402e41fe034f74fb2c35ad0780ee88a1c40ac09a3be1e7465741"
dependencies = [
"bitflags",
"wayland-client",
@ -1332,9 +1327,9 @@ dependencies = [
[[package]]
name = "wayland-scanner"
version = "0.29.1"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaaf2bc85e7b9143159af96bd23d954a5abe391c4376db712320643280fdc6f4"
checksum = "39a1ed3143f7a143187156a2ab52742e89dac33245ba505c17224df48939f9e0"
dependencies = [
"proc-macro2",
"quote",
@ -1343,9 +1338,9 @@ dependencies = [
[[package]]
name = "wayland-sys"
version = "0.29.1"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba9e06acb775b3007f8d3094438306979e572d1d3b844d7a71557a84b055d959"
checksum = "d9341df79a8975679188e37dab3889bfa57c44ac2cb6da166f519a81cbe452d4"
dependencies = [
"dlib",
"lazy_static",
@ -1504,12 +1499,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "winit"
version = "0.26.0"
version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70466a5f4825cc88c92963591b06dbc255420bffe19d847bfcda475e82d079c0"
checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a"
dependencies = [
"bitflags",
"block",
"cocoa",
"core-foundation 0.9.2",
"core-graphics 0.22.3",

View file

@ -87,12 +87,6 @@ fslock = "0.1.6"
trybuild = "1.0.53"
align-data = "0.1.0"
[target.'cfg(target_os = "android")'.dependencies]
winit = "0.26"
pixels = "0.8.0"
ndk = "0.3.0"
ndk-glue = { version = "0.5.0", features = ["logger"] }
[[example]]
name = "hello_world"
@ -102,6 +96,8 @@ name = "shell"
[[example]]
name = "process"
[[example]]
name = "android_fractal"
crate-type = ["cdylib"]
[workspace]
members = [
"examples/android"
]

View file

@ -0,0 +1,21 @@
[package]
name = "fractal"
version = "0.38.0"
description = "rusty_v8 android example"
authors = ["the Deno authors"]
license = "MIT"
edition = "2021"
repository = "https://github.com/denoland/rusty_v8"
publish = false
[lib]
path = "lib.rs"
crate-type = ["cdylib"]
[dependencies]
v8 = { path = "../../" }
winit = "0.26"
pixels = "0.8.0"
ndk = "0.3.0"
ndk-glue = { version = "0.5.0", features = ["logger"] }

View file

@ -28,8 +28,7 @@ fn main() {
let mut isolate = v8::Isolate::new(v8::CreateParams::default());
let mut scope = v8::HandleScope::new(&mut isolate);
let source =
v8::String::new(&mut scope, include_str!("android_fractal.js")).unwrap();
let source = v8::String::new(&mut scope, include_str!("fractal.js")).unwrap();
let context = v8::Context::new(&mut scope);
let mut context_scope = v8::ContextScope::new(&mut scope, context);