Skip to content

Commit ff30e7c

Browse files
committed
bundle integration
1 parent 8d43622 commit ff30e7c

File tree

11 files changed

+308
-34
lines changed

11 files changed

+308
-34
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
lockVersion: 1.0.0
3+
dependencies:
4+
codeql/cpp-all:
5+
version: 0.12.2
6+
codeql/dataflow:
7+
version: 0.1.5
8+
codeql/rangeanalysis:
9+
version: 0.0.4
10+
codeql/ssa:
11+
version: 0.2.5
12+
codeql/tutorial:
13+
version: 0.2.5
14+
codeql/typetracking:
15+
version: 0.2.5
16+
codeql/util:
17+
version: 0.2.5
18+
compiled: false

example/cpp/stuff/src/qlpack.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
---
2+
library: true
13
name: qlt55/stuff
2-
version: 0.0.0
4+
version: 0.0.1
35
description: Default description
46
suites:
57
license:
68
dependencies:
7-
codeql/cpp-all: 0.3.5
9+
codeql/cpp-all: "0.12.2"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
lockVersion: 1.0.0
3+
dependencies:
4+
codeql/cpp-all:
5+
version: 0.12.2
6+
codeql/dataflow:
7+
version: 0.1.5
8+
codeql/rangeanalysis:
9+
version: 0.0.4
10+
codeql/ssa:
11+
version: 0.2.5
12+
codeql/tutorial:
13+
version: 0.2.5
14+
codeql/typetracking:
15+
version: 0.2.5
16+
codeql/util:
17+
version: 0.2.5
18+
compiled: false
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
lockVersion: 1.0.0
3+
dependencies:
4+
codeql/cpp-all:
5+
version: 0.12.2
6+
codeql/dataflow:
7+
version: 0.1.5
8+
codeql/rangeanalysis:
9+
version: 0.0.4
10+
codeql/ssa:
11+
version: 0.2.5
12+
codeql/tutorial:
13+
version: 0.2.5
14+
codeql/typetracking:
15+
version: 0.2.5
16+
codeql/util:
17+
version: 0.2.5
18+
compiled: false

example/cpp/stuff2/src/qlpack.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
---
2+
library: true
13
name: qlt2/stuff2
2-
version: 0.0.0
4+
version: 0.0.1
35
description: Default description
46
suites:
57
license:
68
dependencies:
7-
codeql/cpp-all: 0.3.5
9+
codeql/cpp-all: "0.12.2"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
lockVersion: 1.0.0
3+
dependencies:
4+
codeql/cpp-all:
5+
version: 0.12.2
6+
codeql/dataflow:
7+
version: 0.1.5
8+
codeql/rangeanalysis:
9+
version: 0.0.4
10+
codeql/ssa:
11+
version: 0.2.5
12+
codeql/tutorial:
13+
version: 0.2.5
14+
codeql/typetracking:
15+
version: 0.2.5
16+
codeql/util:
17+
version: 0.2.5
18+
compiled: false

example/qlt.conf.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"CodeQLCLI": "2.11.6",
3-
"CodeQLStandardLibrary": "codeql-cli/v2.11.6",
4-
"CodeQLCLIBundle": "codeql-bundle-20221211",
5-
"EnableCustomCodeQLBundles": false,
6-
"CodeQLStandardLibraryIdent": "codeql-cli_v2.11.6"
2+
"CodeQLCLI": "2.15.5",
3+
"CodeQLStandardLibrary": "codeql-cli/v2.15.5",
4+
"CodeQLCLIBundle": "codeql-bundle-v2.15.5",
5+
"EnableCustomCodeQLBundles": true,
6+
"CodeQLStandardLibraryIdent": "codeql-cli_v2.15.5",
7+
"ExportedCustomizationPacks" : [
8+
"qlt2/stuff2"
9+
]
710
}

src/CodeQLToolkit.Features/CodeQL/Commands/Targets/InstallCommand.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public override void Run()
2121

2222
Log<InstallCommand>.G().LogInformation($"Checking for installation...");
2323

24-
if (installation.IsInstalled())
24+
// if it is the case that it is installed but we are in custom bundle mode we RE install it.
25+
26+
if (installation.IsInstalled() && !installation.EnableCustomCodeQLBundles)
2527
{
2628
Log<InstallCommand>.G().LogInformation($"CodeQL is already installed at that version. Please delete the installation directory to reinstall.");
2729
}
@@ -40,8 +42,11 @@ public override void Run()
4042

4143
if (AutomationTypeHelper.AutomationTypeFromString(AutomationTarget) == AutomationType.ACTIONS)
4244
{
43-
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_HOME={installation.CodeQLHome}" + "\n");
44-
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_PATH={installation.CodeQLToolBinary}" + "\n");
45+
if (Environment.GetEnvironmentVariable("GITHUB_ENV") != null && File.Exists(Environment.GetEnvironmentVariable("GITHUB_ENV")))
46+
{
47+
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_HOME={installation.CodeQLHome}" + "\n");
48+
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_PATH={installation.CodeQLToolBinary}" + "\n");
49+
}
4550
}
4651

4752
}

0 commit comments

Comments
 (0)