Skip to content

Commit aaaa7f4

Browse files
authored
Merge pull request #19135 from smowton/smowton/admin/test-gradle-bom-downloads
Java: add test exercising Gradle download pruning
2 parents 279e9e2 + d8f7f18 commit aaaa7f4

File tree

8 files changed

+127
-0
lines changed

8 files changed

+127
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* This is a general purpose Gradle build.
5+
* To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.3/samples
6+
*/
7+
8+
apply plugin: 'java-library'
9+
10+
repositories {
11+
mavenCentral()
12+
}
13+
14+
dependencies {
15+
api 'org.apache.commons:commons-math3:3.6.1'
16+
17+
api 'org.junit.jupiter:junit-jupiter-api:5.12.1'
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
https://repo.maven.apache.org/maven2/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar
2+
https://repo.maven.apache.org/maven2/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar
3+
https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.12.1/junit-jupiter-api-5.12.1.jar
4+
https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-commons/1.12.1/junit-platform-commons-1.12.1.jar
5+
https://repo.maven.apache.org/maven2/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"markdownMessage": "Java analysis used build tool Gradle to pick a JDK version and/or to recommend external dependencies.",
3+
"severity": "unknown",
4+
"source": {
5+
"extractorName": "java",
6+
"id": "java/autobuilder/buildless/using-build-tool-advice",
7+
"name": "Java analysis used build tool Gradle to pick a JDK version and/or to recommend external dependencies"
8+
},
9+
"visibility": {
10+
"cliSummaryTable": true,
11+
"statusPage": false,
12+
"telemetry": true
13+
}
14+
}
15+
{
16+
"markdownMessage": "Java analysis used the system default JDK.",
17+
"severity": "unknown",
18+
"source": {
19+
"extractorName": "java",
20+
"id": "java/autobuilder/buildless/jdk-system-default",
21+
"name": "Java analysis used the system default JDK"
22+
},
23+
"visibility": {
24+
"cliSummaryTable": true,
25+
"statusPage": false,
26+
"telemetry": true
27+
}
28+
}
29+
{
30+
"markdownMessage": "Java analysis with build-mode 'none' completed.",
31+
"severity": "unknown",
32+
"source": {
33+
"extractorName": "java",
34+
"id": "java/autobuilder/buildless/complete",
35+
"name": "Java analysis with build-mode 'none' completed"
36+
},
37+
"visibility": {
38+
"cliSummaryTable": true,
39+
"statusPage": false,
40+
"telemetry": true
41+
}
42+
}
43+
{
44+
"markdownMessage": "Java was extracted with build-mode set to 'none'. This means that all Java source in the working directory will be scanned, with build tools such as Maven and Gradle only contributing information about external dependencies.",
45+
"severity": "note",
46+
"source": {
47+
"extractorName": "java",
48+
"id": "java/autobuilder/buildless/mode-active",
49+
"name": "Java was extracted with build-mode set to 'none'"
50+
},
51+
"visibility": {
52+
"cliSummaryTable": true,
53+
"statusPage": true,
54+
"telemetry": true
55+
}
56+
}
57+
{
58+
"markdownMessage": "Reading the dependency graph from build files provided 5 classpath entries",
59+
"severity": "unknown",
60+
"source": {
61+
"extractorName": "java",
62+
"id": "java/autobuilder/buildless/depgraph-provided-by-gradle",
63+
"name": "Java analysis extracted precise dependency graph information from tool Gradle"
64+
},
65+
"visibility": {
66+
"cliSummaryTable": true,
67+
"statusPage": false,
68+
"telemetry": true
69+
}
70+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* The settings file is used to specify which projects to include in your build.
5+
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.3/userguide/building_swift_projects.html in the Gradle documentation.
6+
*/
7+
8+
rootProject.name = 'buildless-gradle'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.gradle/8.3/dependencies-accessors/gc.properties
2+
.gradle/8.3/gc.properties
3+
.gradle/buildOutputCleanup/cache.properties
4+
.gradle/vcs-1/gc.properties
5+
gradle/wrapper/gradle-wrapper.properties
6+
src/main/java/com/fractestexample/Test.java
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.fractestexample;
2+
3+
import org.apache.commons.math3.fraction.Fraction;
4+
5+
public class Test {
6+
7+
public Fraction test(org.junit.jupiter.api.Test t) { return Fraction.ONE; }
8+
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def test(codeql, java, gradle_8_3):
2+
codeql.database.create(
3+
_env={
4+
"CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS": "true",
5+
"CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS_CLASSPATH_FROM_BUILD_FILES": "true",
6+
}
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: fix
3+
---
4+
* In `build-mode: none` where the project has a Gradle build system, database creation no longer attempts to download some non-existent jar files relating to non-jar Maven artifacts, such as BOMs. This was harmless, but saves some time and reduces spurious warnings.

0 commit comments

Comments
 (0)