Skip to content

Commit

Permalink
Remove auto generate files
Browse files Browse the repository at this point in the history
  • Loading branch information
Lycs-D committed Mar 16, 2024
1 parent 0cf2108 commit 5faefe2
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 322,458 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/analyzer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ jobs:
path: v-analyzer
submodules: true

- name: Insrall dependencies && generate
run: |
cd v-analyzer/tree_sitter_v
npm install
npm run generate
- name: Run tests
run: |
cd v-analyzer/tests
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
path: v-analyzer
submodules: true

- name: Insrall dependencies
run: |
cd v-analyzer/tree_sitter_v
npm install
- name: Build ${{ matrix.name }}
run: |
cd v-analyzer
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
path: v-analyzer
submodules: true

- name: Insrall dependencies
run: |
cd v-analyzer/tree_sitter_v
npm install
- name: Compile
run: |
cd v-analyzer
Expand Down Expand Up @@ -82,7 +87,6 @@ jobs:
with:
artifacts: ${{ env.ARTIFACT }}.zip
tag: nightly
body: ${{ env.BODY }}
name: v-analyzer development build
prerelease: true
allowUpdates: true
10 changes: 8 additions & 2 deletions .github/workflows/test_tree_sitter_v.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install V
uses: vlang/[email protected]
with:
check-latest: true

- name: Install Nodejs
uses: actions/setup-node@v4
with:
Expand All @@ -25,10 +30,11 @@ jobs:
path: v-analyzer
submodules: true

- name: Install dependencies
- name: Install dependencies && generate
run: |
cd v-analyzer/tree_sitter_v
npm update
npm install
npm run generate
- name: Run tests
run: |
Expand Down
49 changes: 30 additions & 19 deletions build.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,42 @@ fn prepare_output_dir() {
os.mkdir('./bin') or { errorln('Failed to create output directory: ${err}') }
}

fn generate() bool {
os.chdir('./tree_sitter_v') or { return false }
if os.execute('npm run generate').exit_code == 0 {
os.chdir('../') or { return false }
println('${term.green('✓')} Run tree-sitter generate')
return true
}
return false
}

fn build(mode ReleaseMode, explicit_debug bool) {
println('Building v-analyzer at commit: ${build_commit}, build time: ${build_datetime} ...')
if generate() {
prepare_output_dir()
println('${term.green('✓')} Prepared output directory')

cmd := mode.compile_cmd()
println('Building v-analyzer in ${term.bold(mode.str())} mode, using: ${cmd}')
if mode == .release {
println('This may take a while...')
}

prepare_output_dir()
println('${term.green('✓')} Prepared output directory')

cmd := mode.compile_cmd()
println('Building v-analyzer in ${term.bold(mode.str())} mode, using: ${cmd}')
if mode == .release {
println('This may take a while...')
}
if !explicit_debug && mode == .debug {
println('To build in ${term.bold('release')} mode, run ${term.bold('v build.vsh release')}')
println('Release mode is recommended for production use. At runtime, it is about 30-40% faster than debug mode.')
}

if !explicit_debug && mode == .debug {
println('To build in ${term.bold('release')} mode, run ${term.bold('v build.vsh release')}')
println('Release mode is recommended for production use. At runtime, it is about 30-40% faster than debug mode.')
}
os.execute_opt(cmd) or {
errorln('Failed to build v-analyzer')
eprintln(err)
exit(1)
}

os.execute_opt(cmd) or {
errorln('Failed to build v-analyzer')
eprintln(err)
exit(1)
println('${term.green('✓')} Successfully built v-analyzer!')
println('Binary is located at ${term.bold(abs_path(bin_path))}')
}

println('${term.green('✓')} Successfully built v-analyzer!')
println('Binary is located at ${term.bold(abs_path(bin_path))}')
}

// main program:
Expand Down
4 changes: 4 additions & 0 deletions tree_sitter_v/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ Cargo.toml
bindings/node/
bindings/rust/
binding.gyp

src/

node_types.v
Loading

0 comments on commit 5faefe2

Please sign in to comment.