Skip to content
This repository was archived by the owner on Jun 27, 2022. It is now read-only.

Commit e422fe4

Browse files
authored
Add support for new qlpack layout
* Add support for new qlpack layout * Add bundle for CodeQL CLI v2.7.3 with new layout
1 parent 79ff94b commit e422fe4

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

.github/workflows/build-bundles.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,36 @@ jobs:
5252
for lang_path in customizations/*; do
5353
# Copy custom modules
5454
lang=${lang_path##*/}
55-
mkdir codeql/qlpacks/codeql-$lang-lib/customizations
56-
cp $lang_path/*.qll codeql/qlpacks/codeql-$lang-lib/customizations
5755
58-
# Import custom modules
59-
for module_path in $lang_path/*.qll; do
60-
module_file=${module_path##*/}
61-
module_name=${module_file%.*}
62-
echo "import customizations.$module_name" >> codeql/qlpacks/codeql-$lang-lib/Customizations.qll
63-
done
56+
57+
if [ -d codeql/qlpacks/codeql-$lang-lib ]; then
58+
qllib_path=codeql/qlpacks/codeql-$lang-lib
59+
qlquery_path=codeql/qlpacks/codeql-$lang
60+
else
61+
qllib_version=$(ls codeql/qlpacks/codeql/$lang-all)
62+
qllib_path=codeql/qlpacks/codeql/$lang-all/$qllib_version
63+
qlquery_version=$(ls codeql/qlpacks/codeql/$lang-queries)
64+
qlquery_path=codeql/qlpacks/codeql/$lang-queries/$qlquery_version
65+
fi
6466
65-
# Rebuild cache
66-
rm -r codeql/qlpacks/codeql-$lang/.cache
67-
codeql/codeql query compile --search-path codeql --threads 0 codeql/qlpacks/codeql-$lang
67+
if [ -f $qllib_path/Customizations.qll ];
68+
then
69+
mkdir $qllib_path/customizations
70+
cp $lang_path/*.qll $qllib_path/customizations
71+
72+
# Import custom modules
73+
for module_path in $lang_path/*.qll; do
74+
module_file=${module_path##*/}
75+
module_name=${module_file%.*}
76+
echo "import customizations.$module_name" >> $qllib_path/Customizations.qll
77+
done
78+
79+
# Rebuild cache
80+
rm -r $qlquery_path/.cache
81+
codeql/codeql query compile --search-path codeql --threads 0 $qlquery_path
82+
else
83+
echo "Skipping customization for language $lang, because it doesn't have a Customizations.qll"
84+
fi
6885
done
6986
7087
tar -czf codeql-bundle.tar.gz codeql

bundles.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"bundle": [
3-
"codeql-bundle-20211005"
3+
"codeql-bundle-20211005",
4+
"codeql-bundle-20211208"
45
]
56
}

0 commit comments

Comments
 (0)