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" edition = "2018"
[dependencies] [dependencies]
minify-html = { path = "../.." } minify-html = { path = "../../rust/main" }
structopt = "0.3.5" structopt = "0.3.5"
serde = { version = "1.0.104", features = ["derive"] } serde = { version = "1.0.104", features = ["derive"] }
serde_json = "1.0.44" serde_json = "1.0.44"

View File

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

View File

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

View File

@ -1,7 +1,7 @@
import { mkdirSync, writeFileSync } from "fs"; import { mkdirSync, writeFileSync } from "fs";
import { join } from "path"; 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 { try {
mkdirSync(RUST_OUT_DIR); mkdirSync(RUST_OUT_DIR);

View File

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

View File

@ -19,4 +19,4 @@ cbindgen = "0.14"
[dependencies] [dependencies]
libc = "0.2" 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")" pushd "$(dirname "$0")"
# Generate crate::gen::* code. # Generate common::gen::* code.
pushd gen pushd gen
npm i npm i
bash gen.sh bash gen.sh

View File

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

View File

@ -1,3 +1,3 @@
/Cargo.lock /Cargo.lock
/target
/src/gen/ /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', 'add', '-A');
cmd('git', 'commit', '-m', NEW_VERSION); cmd('git', 'commit', '-m', NEW_VERSION);
cmd('git', 'tag', '-a', `v${NEW_VERSION}`, '-m', ''); 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('cargo', 'publish', '--allow-dirty');
cmd('git', 'push', '--follow-tags'); cmd('git', 'push', '--follow-tags');