Skip to content

Commit

Permalink
[c#] Add support to importCode (#4150)
Browse files Browse the repository at this point in the history
  • Loading branch information
karan-batavia authored Feb 12, 2024
1 parent 63eaac6 commit ea6cf04
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions joern-cli/src/universal/csharpsrc2cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env sh

if [ "$(uname -s)" = "Darwin" ]; then
SCRIPT_ABS_PATH=$(greadlink -f "$0")
else
SCRIPT_ABS_PATH=$(readlink -f "$0")
fi

SCRIPT_ABS_DIR=$(dirname "$SCRIPT_ABS_PATH")
SCRIPT="$SCRIPT_ABS_DIR"/frontends/csharpsrc2cpg/csharpsrc2cpg

if [ ! -f "$SCRIPT" ]; then
echo "Unable to find $SCRIPT, have you created the distribution?"
exit 1
fi

$SCRIPT -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m -Dlog4j.configurationFile="$SCRIPT_ABS_DIR"/conf/log4j2.xml "$@"
6 changes: 6 additions & 0 deletions joern-cli/src/universal/csharpsrc2cpg.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off

set "SCRIPT_ABS_DIR=%~dp0"
set "SCRIPT=%SCRIPT_ABS_DIR%frontends\csharpsrc2cpg\bin\csharpsrc2cpg.bat"

"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %*

0 comments on commit ea6cf04

Please sign in to comment.