Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
90fa36e
SONARJAVA-5049 Add CheckListGenerator
irina-batinic-sonarsource Jun 18, 2024
3275b5d
Revert maxSize
irina-batinic-sonarsource Jun 18, 2024
2406170
Separate writing to a file to a method
irina-batinic-sonarsource Jun 18, 2024
23b60c2
Separate check files search and filtering to a method
irina-batinic-sonarsource Jun 18, 2024
feebe50
Remove commons io library
irina-batinic-sonarsource Jun 19, 2024
9e5cb7c
Fix windows file separator
leonardo-pilastri-sonarsource Jun 19, 2024
f731fe5
Update some field names
irina-batinic-sonarsource Jun 19, 2024
387dc3a
Move CheckList generation to java-frontend.
irina-batinic-sonarsource Jun 20, 2024
22b60eb
Try moving checkList generator to separate module.
irina-batinic-sonarsource Jun 20, 2024
88720d6
Build before sanity tests and autoscan
irina-batinic-sonarsource Jun 20, 2024
8a24b2b
Try fixing autocan and sanity
irina-batinic-sonarsource Jun 20, 2024
0332699
Update gson version to be compatible with records.
irina-batinic-sonarsource Jun 20, 2024
86ac8a9
Add GeneratedCheckListTest
irina-batinic-sonarsource Jun 20, 2024
4c7fc94
Add tests for CheckListGenerator
irina-batinic-sonarsource Jun 20, 2024
093a35c
Add tests for CheckListGenerator
irina-batinic-sonarsource Jun 21, 2024
c349903
Updating gson version breaks build - 1 forbidden licenses used.
irina-batinic-sonarsource Jun 21, 2024
0b6c15d
Remove unnecessary test.
irina-batinic-sonarsource Jun 21, 2024
2368659
Add test for wrong metadata
irina-batinic-sonarsource Jun 21, 2024
e37da21
Rename test method
irina-batinic-sonarsource Jun 21, 2024
6e2041b
Add test for writing to file
irina-batinic-sonarsource Jun 21, 2024
c5995f0
Changes after code review
irina-batinic-sonarsource Jun 21, 2024
231a86a
Compiling explicitly just test sources
irina-batinic-sonarsource Jun 21, 2024
7218164
Update readme for compiling test sources
irina-batinic-sonarsource Jun 21, 2024
60c41dc
Remove CheckList class
irina-batinic-sonarsource Jun 21, 2024
4ba50bb
Remove update of scope to "All". Done in #4825 PR
irina-batinic-sonarsource Jun 24, 2024
7649046
Merge with master
irina-batinic-sonarsource Jun 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ sanity_task:
sanity_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- mvn clean compile --projects java-checks-test-sources --also-make-dependents
- cd java-checks-test-sources
- mvn clean compile
- cd ../
- mvn verify -f sonar-java-plugin/pom.xml -Psanity -Dtest=SanityTest
cleanup_before_cache_script: cleanup_maven_repository

Expand Down Expand Up @@ -261,8 +263,9 @@ autoscan_task:
autoscan_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- JAVA_HOME="${JAVA_21_HOME}" mvn clean compile --projects java-checks-test-sources --also-make-dependents
- cd its/autoscan
- cd java-checks-test-sources
- JAVA_HOME="${JAVA_21_HOME}" mvn clean compile
- cd ../its/autoscan
- mvn clean package --batch-mode --errors --show-version --activate-profiles it-autoscan -Dsonar.runtimeVersion=LATEST_RELEASE[10.3] -Dmaven.test.redirectTestOutputToFile=false -Dparallel=methods -DuseUnlimitedThreads=true
cleanup_before_cache_script: cleanup_maven_repository
on_failure:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ Running this test can be broken down in 2 steps:

Make sure that the `java-checks-tests-sources` module has been compiled (ie: the .class files in `java-checks-tests-sources/target/` are up to date).

In doubt, go the top-level of the project and run:
In doubt, go the [`java-checks-tests-sources`](java-checks-tests-sources) module and run:
```shell
# Use java 21!
mvn clean compile --projects java-checks-test-sources --also-make-dependents
mvn clean compile
```

##### Executing the autoscan test
Expand Down
117 changes: 117 additions & 0 deletions check-list/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.sonarsource.java</groupId>
<artifactId>java</artifactId>
<version>8.1.0-SNAPSHOT</version>
</parent>

<artifactId>check-list</artifactId>

<name>SonarQube Java :: Check List</name>
<inceptionYear>2024</inceptionYear>

<dependencies>
<dependency>
<groupId>org.sonarsource.api.plugin</groupId>
<artifactId>sonar-plugin-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>java-checks</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>java-checks-aws</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.sonar.java.CheckListGenerator</mainClass>
<classpathScope>compile</classpathScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<!-- second compilation execution to compile the generated sources before the tests -->
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading