mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Javascript: use codeql_pack for javascript extractor
This commit is contained in:
committed by
Cornelius Riemenschneider
parent
fe8f13e8dd
commit
7b8c11379d
30
javascript/resources/tools/autobuild.cmd
Normal file
30
javascript/resources/tools/autobuild.cmd
Normal file
@@ -0,0 +1,30 @@
|
||||
@echo off
|
||||
SETLOCAL EnableDelayedExpansion
|
||||
|
||||
set jvm_args=-Xss16m
|
||||
|
||||
rem If CODEQL_RAM is set, use half for Java and half for TS.
|
||||
if NOT [%CODEQL_RAM%] == [] (
|
||||
set /a "half_ram=CODEQL_RAM/2"
|
||||
set LGTM_TYPESCRIPT_RAM=%half_ram%
|
||||
set jvm_args=!jvm_args! -Xmx!half_ram!m
|
||||
)
|
||||
|
||||
rem If CODEQL_THREADS is set, propagate via LGTM_THREADS.
|
||||
if NOT [%CODEQL_THREADS%] == [] (
|
||||
set LGTM_THREADS=%CODEQL_THREADS%
|
||||
)
|
||||
|
||||
rem The JS autobuilder expects to find typescript modules under SEMMLE_DIST/tools.
|
||||
rem They are included in the pack, but we need to set SEMMLE_DIST appropriately.
|
||||
set SEMMLE_DIST=%CODEQL_EXTRACTOR_JAVASCRIPT_ROOT%
|
||||
|
||||
rem The JS autobuilder expects LGTM_SRC to be set to the source root.
|
||||
set LGTM_SRC=%CD%
|
||||
|
||||
type NUL && "%CODEQL_JAVA_HOME%\bin\java.exe" %jvm_args% ^
|
||||
-cp "%CODEQL_EXTRACTOR_JAVASCRIPT_ROOT%\tools\extractor-javascript.jar" ^
|
||||
com.semmle.js.extractor.AutoBuild
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
ENDLOCAL
|
||||
29
javascript/resources/tools/autobuild.sh
Executable file
29
javascript/resources/tools/autobuild.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
jvm_args=-Xss16m
|
||||
|
||||
# If CODEQL_RAM is set, use half for Java and half for TS.
|
||||
if [ -n "${CODEQL_RAM:-}" ] ; then
|
||||
half_ram="$(( CODEQL_RAM / 2 ))"
|
||||
LGTM_TYPESCRIPT_RAM="$half_ram"
|
||||
export LGTM_TYPESCRIPT_RAM
|
||||
jvm_args="$jvm_args -Xmx${half_ram}m"
|
||||
fi
|
||||
|
||||
# If CODEQL_THREADS is set, propagate via LGTM_THREADS.
|
||||
if [ -n "${CODEQL_THREADS:-}" ] ; then
|
||||
LGTM_THREADS="$CODEQL_THREADS"
|
||||
export LGTM_THREADS
|
||||
fi
|
||||
|
||||
# The JS autobuilder expects to find typescript modules under SEMMLE_DIST/tools.
|
||||
# They are included in the pack, but we need to set SEMMLE_DIST appropriately.
|
||||
# We want to word-split $jvm_args, so disable the shellcheck warning.
|
||||
# shellcheck disable=SC2086
|
||||
env SEMMLE_DIST="$CODEQL_EXTRACTOR_JAVASCRIPT_ROOT" \
|
||||
LGTM_SRC="$(pwd)" \
|
||||
"${CODEQL_JAVA_HOME}/bin/java" $jvm_args \
|
||||
-cp "$CODEQL_EXTRACTOR_JAVASCRIPT_ROOT/tools/extractor-javascript.jar" \
|
||||
com.semmle.js.extractor.AutoBuild
|
||||
8
javascript/resources/tools/baseline-config.json
Normal file
8
javascript/resources/tools/baseline-config.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"paths-ignore": [
|
||||
"**/node_modules/**",
|
||||
"**/bower_components/**",
|
||||
"**/*.min.js",
|
||||
"**/*-min.js"
|
||||
]
|
||||
}
|
||||
2
javascript/resources/tools/configure-baseline.cmd
Normal file
2
javascript/resources/tools/configure-baseline.cmd
Normal file
@@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
type "%CODEQL_EXTRACTOR_JAVASCRIPT_ROOT%\tools\baseline-config.json"
|
||||
3
javascript/resources/tools/configure-baseline.sh
Executable file
3
javascript/resources/tools/configure-baseline.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat "$CODEQL_EXTRACTOR_JAVASCRIPT_ROOT/tools/baseline-config.json"
|
||||
4
javascript/resources/tools/index-dir.sh
Executable file
4
javascript/resources/tools/index-dir.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Not implemented." 1>&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user