Restructure Rust project

This commit is contained in:
Wilson Lin 2021-08-08 17:40:42 +10:00
parent 1179ec1769
commit 82d287d9c4
73 changed files with 15 additions and 11 deletions

View File

@ -6,7 +6,7 @@ authors = ["Wilson Lin <code@wilsonl.in>"]
edition = "2018"
[dependencies]
minify-html = { path = "../.." }
minify-html = { path = "../../rust/main" }
structopt = "0.3.5"
serde = { version = "1.0.104", features = ["derive"] }
serde_json = "1.0.44"

View File

@ -7,5 +7,5 @@ authors = ["Wilson Lin <code@wilsonl.in>"]
edition = "2018"
[dependencies]
minify-html = { path = "..", features = ["js-esbuild"] }
minify-html = { path = "../rust/main", features = ["js-esbuild"] }
structopt = "0.3"

View File

@ -7,4 +7,4 @@ edition = "2018"
[dependencies]
afl = "0.10.0"
minify-html = { path = ".." }
minify-html = { path = "../rust/main" }

View File

@ -5,4 +5,4 @@ authors = ["Wilson Lin <code@wilsonl.in>"]
edition = "2018"
[dependencies]
minify-html = { path = "../.." }
minify-html = { path = "../../rust/main" }

View File

@ -1,7 +1,7 @@
import { mkdirSync, writeFileSync } from "fs";
import { join } from "path";
export const RUST_OUT_DIR = join(__dirname, "..", "src", "gen");
export const RUST_OUT_DIR = join(__dirname, "..", "rust", "common", "src", "gen");
try {
mkdirSync(RUST_OUT_DIR);

View File

@ -6,7 +6,7 @@ authors = ["Wilson Lin <code@wilsonl.in>"]
edition = "2018"
[dependencies]
minify-html = { path = "..", features = ["js-esbuild"] }
minify-html = { path = "../rust/main", features = ["js-esbuild"] }
jni = "0.14.0"
[lib]

View File

@ -19,4 +19,4 @@ cbindgen = "0.14"
[dependencies]
libc = "0.2"
minify-html = { path = "../..", optional = true }
minify-html = { path = "../../rust/main", optional = true }

View File

@ -4,7 +4,7 @@ set -e
pushd "$(dirname "$0")"
# Generate crate::gen::* code.
# Generate common::gen::* code.
pushd gen
npm i
bash gen.sh

View File

@ -10,5 +10,5 @@ name = "minify_html_ruby_lib"
crate-type = ["cdylib"]
[dependencies]
minify-html = { path = "..", features = ["js-esbuild"] }
minify-html = { path = "../rust/main", features = ["js-esbuild"] }
rutie = "0.7.0"

View File

@ -1,3 +1,3 @@
/Cargo.lock
/target
/src/gen/
/target

2
rust/main/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/Cargo.lock
/target

2
rust/onepass/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/Cargo.lock
/target

View File

@ -101,6 +101,6 @@ cmd('cargo', 'generate-lockfile');
cmd('git', 'add', '-A');
cmd('git', 'commit', '-m', NEW_VERSION);
cmd('git', 'tag', '-a', `v${NEW_VERSION}`, '-m', '');
// We have generated but ignored in `src/gen`.
// We have generated but ignored in `rust/common/gen`.
cmd('cargo', 'publish', '--allow-dirty');
cmd('git', 'push', '--follow-tags');