remove deadlock in build system

This commit is contained in:
Sebastian Hugentobler 2023-03-09 10:36:11 +01:00
parent 939201fedb
commit 9c5cd5f4da
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
16 changed files with 84 additions and 102 deletions

8
woweb/.idea/.gitignore generated vendored
View file

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/woweb-poc.iml" filepath="$PROJECT_DIR$/.idea/woweb-poc.iml" />
</modules>
</component>
</project>

6
woweb/.idea/vcs.xml generated
View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -2,7 +2,6 @@
name = "woweb"
version = "0.2.0"
edition = "2021"
build = "build.rs"
[dependencies]
dist_text = { path = "../dist_text" }

View file

@ -1,29 +0,0 @@
use std::env;
use std::fs;
use std::path::Path;
use std::process::Command;
fn main() {
let woweb_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let woweb_path = Path::new(&woweb_dir);
let woweb_asset_path = woweb_path.join("assets");
let dist_text_path = woweb_path.parent().unwrap().join("dist_text_js");
let dist_text_pkg_path = dist_text_path.join("pkg");
Command::new("wasm-pack")
.args(&["build", "--target", "web", "--release", "--no-typescript"])
.current_dir(dist_text_path)
.status()
.unwrap();
let js_path_src = dist_text_pkg_path.join("dist_text_js.js");
let js_path_dest = woweb_asset_path.join("dist_text_js.js");
let wasm_path_src = dist_text_pkg_path.join("dist_text_js_bg.wasm");
let wasm_path_dest = woweb_asset_path.join("dist_text_js_bg.wasm");
let _ = fs::copy(js_path_src, js_path_dest);
let _ = fs::copy(wasm_path_src, wasm_path_dest);
println!("cargo:rerun-if-changed=../dist_text_js/**/*.rs");
}