mirror of
https://github.com/ApfelTeeSaft/LiveSplitOne.git
synced 2026-08-29 03:43:26 +00:00
Merge branch 'wasm'
This commit is contained in:
@@ -2,3 +2,4 @@ node_modules
|
||||
dist
|
||||
npm-debug.log
|
||||
src/livesplit_core.js
|
||||
src/livesplit_core.wasm
|
||||
|
||||
+1
-4
@@ -8,7 +8,7 @@ env:
|
||||
- ENCRYPTION_LABEL: 341f345e5c8f
|
||||
matrix:
|
||||
include:
|
||||
- env: TARGET=asmjs-unknown-emscripten
|
||||
- env: TARGET=wasm32-unknown-unknown
|
||||
rust: nightly
|
||||
before_install: set -e
|
||||
install:
|
||||
@@ -29,6 +29,3 @@ notifications:
|
||||
|
||||
node_js:
|
||||
- "6"
|
||||
|
||||
# Temporary fix for emscripten
|
||||
group: deprecated-2017Q2
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
core: bindings
|
||||
wasm-unknown:
|
||||
@make bindings -C livesplit-core/capi/js
|
||||
@cp livesplit-core/capi/bindings/wasm/livesplit_core.ts src/livesplit.ts
|
||||
@make wasm-unknown -C livesplit-core/capi/js
|
||||
@cp livesplit-core/capi/js/livesplit_core.wasm src/livesplit_core.wasm
|
||||
|
||||
asmjs: bindings
|
||||
@make -C livesplit-core/capi/js
|
||||
@cp livesplit-core/capi/js/livesplit.js src/livesplit_core.js
|
||||
|
||||
wasm: bindings
|
||||
wasm-emscripten: bindings
|
||||
@make wasm -C livesplit-core/capi/js
|
||||
@cp livesplit-core/capi/js/livesplit.js src/livesplit_core.js
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ main() {
|
||||
sort=sort
|
||||
fi
|
||||
|
||||
rustup target install $TARGET
|
||||
|
||||
# This fetches latest stable release
|
||||
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
|
||||
| cut -d/ -f3 \
|
||||
|
||||
+4
-5
@@ -6,12 +6,11 @@ SOURCE_BRANCH="master"
|
||||
TARGET_BRANCH="gh-pages"
|
||||
|
||||
doCompile() {
|
||||
(cd livesplit-core && cross rustc -p livesplit --target $TARGET --release -- -C opt-level=z)
|
||||
(cd livesplit-core && cargo build -p cdylib --target wasm32-unknown-unknown --release)
|
||||
(cd livesplit-core/capi/bind_gen && cargo run)
|
||||
|
||||
cp livesplit-core/target/asmjs-unknown-emscripten/release/livesplit*.js* src/livesplit_core.js
|
||||
cat livesplit-core/capi/js/exports.js >> src/livesplit_core.js
|
||||
cp livesplit-core/capi/bindings/emscripten/livesplit_core.ts src/livesplit.ts
|
||||
cp livesplit-core/target/wasm32-unknown-unknown/release/livesplit_core.wasm src/livesplit_core.wasm
|
||||
cp livesplit-core/capi/bindings/wasm/livesplit_core.ts src/livesplit.ts
|
||||
|
||||
npm install
|
||||
webpack -p
|
||||
@@ -29,7 +28,7 @@ git config --global user.email "[email protected]"
|
||||
git config --global user.name "Travis CI"
|
||||
git checkout -b gh-pages
|
||||
git add -f dist
|
||||
git add -f src/livesplit_core.js
|
||||
git add -f src/livesplit_core.wasm
|
||||
git commit -m "gh pages"
|
||||
|
||||
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
|
||||
|
||||
+14
-17
@@ -1,23 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="theme-color" content="#232323" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<link rel="icon" href="images/icon.ico">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<title>LiveSplit One</title>
|
||||
</head>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="theme-color" content="#232323" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<link rel="icon" href="images/icon.ico">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<title>LiveSplit One</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="base"></div>
|
||||
|
||||
|
||||
<!-- Main -->
|
||||
<script src="./dist/bundle.js"></script>
|
||||
</body>
|
||||
<body>
|
||||
<div id="base"></div>
|
||||
<script src="./dist/bundle.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+1
-1
Submodule livesplit-core updated: b1168ad02d...615fa72e3f
+23
-16
@@ -1,24 +1,31 @@
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
|
||||
import { toast, ToastContainer } from "react-toastify";
|
||||
import { load } from "./livesplit";
|
||||
import { LiveSplit } from "./ui/LiveSplit";
|
||||
import { ToastContainer, toast } from "react-toastify";
|
||||
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
import "./css/font-awesome.css";
|
||||
import "./css/livesplit.css";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<LiveSplit />
|
||||
<ToastContainer
|
||||
position={toast.POSITION.BOTTOM_RIGHT}
|
||||
toastClassName="toast-class"
|
||||
bodyClassName="toast-body"
|
||||
style={{
|
||||
textShadow: "none",
|
||||
}}
|
||||
/>
|
||||
</div>,
|
||||
document.getElementById("base"),
|
||||
);
|
||||
async function run() {
|
||||
await load("src/livesplit_core.wasm");
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<LiveSplit />
|
||||
<ToastContainer
|
||||
position={toast.POSITION.BOTTOM_RIGHT}
|
||||
toastClassName="toast-class"
|
||||
bodyClassName="toast-body"
|
||||
style={{
|
||||
textShadow: "none",
|
||||
}}
|
||||
/>
|
||||
</div>,
|
||||
document.getElementById("base"),
|
||||
);
|
||||
}
|
||||
|
||||
run();
|
||||
|
||||
+698
-848
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user