Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions .cirrus/.cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,17 @@ sq_analysis_task:
- .cirrus/cirrus-sq-analysis.sh
<<: *CLEANUP_GRADLE_CACHE_SCRIPT
<<: *DEFAULT_ARTIFACTS_TEMPLATE

rewrite_task:
depends_on: junit_task
container:
dockerfile: .cirrus/Dockerfile
cpu: 8
memory: 10Gb
no_output_timeout: 2h
<<: *DEFAULT_TEMPLATE
<<: *GRADLE_CACHE_TEMPLATE
script:
- .cirrus/cirrus-rewrite.sh
<<: *CLEANUP_GRADLE_CACHE_SCRIPT
<<: *DEFAULT_ARTIFACTS_TEMPLATE
7 changes: 7 additions & 0 deletions .cirrus/cirrus-rewrite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail

source .cirrus/cirrus-env

./gradlew rewriteDryRun --build-cache -Dorg.gradle.jvmargs=-Xmx8G
# https://docs.openrewrite.org/reference/faq#im-getting-javalangoutofmemoryerror-java-heap-space-when-running-openrewrite
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ import org.sonar.build.BlackBoxTest

import static org.gradle.api.JavaVersion.VERSION_17

// Ordered alphabetically
plugins {
// Ordered alphabetically
id 'com.github.hierynomus.license' version '0.16.1'
id "com.github.hierynomus.license-report" version "0.16.1" apply false
id 'com.gradleup.shadow' version '8.3.6' apply false
id 'com.github.hierynomus.license-report' version '0.16.1' apply false
id 'com.google.protobuf' version '0.8.19' apply false
// dont update com.jfrog.artifactory, new version contains a bug
id 'com.jfrog.artifactory' version '5.2.5'
id "de.undercouch.download" version "5.6.0" apply false
id 'com.gradleup.shadow' version '8.3.6' apply false
id 'com.jfrog.artifactory' version '5.2.5' // dont update new version contains a bug
id 'de.undercouch.download' version '5.6.0' apply false
id 'io.spring.dependency-management' version '1.1.7'
id "org.cyclonedx.bom" version "2.3.1" apply false
id 'org.cyclonedx.bom' version '2.3.1' apply false
id 'org.openrewrite.rewrite' version '7.12.1' apply false
id 'org.sonarqube' version '6.2.0.5505'
}

apply from: "$rootDir/gradle/rewrite.gradle"

if (!JavaVersion.current().isCompatibleWith(VERSION_17)) {
throw new GradleException("JDK 17+ is required to perform this build. It's currently " + System.getProperty("java.home") + ".")
}
Expand Down
54 changes: 54 additions & 0 deletions gradle/rewrite.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
project.apply plugin: "org.openrewrite.rewrite"

rewrite {
activeRecipe(
"org.openrewrite.gradle.GradleBestPractices",
//"org.openrewrite.java.RemoveUnusedImports",
//"org.openrewrite.java.migrate.UpgradeToJava17",
//"org.openrewrite.java.recipes.JavaRecipeBestPractices",
//"org.openrewrite.java.recipes.RecipeNullabilityBestPractices",
//"org.openrewrite.java.recipes.RecipeTestingBestPractices",
//"org.openrewrite.staticanalysis.CodeCleanup",
//"org.openrewrite.staticanalysis.CommonStaticAnalysis",
//"org.openrewrite.staticanalysis.EqualsAvoidsNull",
//"org.openrewrite.staticanalysis.JavaApiBestPractices",
//"org.openrewrite.staticanalysis.LowercasePackage",
//"org.openrewrite.staticanalysis.MissingOverrideAnnotation",
//"org.openrewrite.staticanalysis.ModifierOrder",
//"org.openrewrite.staticanalysis.NoFinalizer",
//"org.openrewrite.staticanalysis.RemoveUnusedLocalVariables",
//"org.openrewrite.staticanalysis.RemoveUnusedPrivateFields",
//"org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods",
//"org.openrewrite.staticanalysis.UnnecessaryThrows",
//"org.sonar.openrewrite.java.AddLicenseHeader", https://github.com/openrewrite/rewrite/issues/5762
//"tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes",
//"tech.picnic.errorprone.refasterrules.BugCheckerRulesRecipes",
//"tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes",
//"tech.picnic.errorprone.refasterrules.ClassRulesRecipes",
//"tech.picnic.errorprone.refasterrules.CollectionRulesRecipes", bug
//"tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes",
//"tech.picnic.errorprone.refasterrules.EqualityRulesRecipes",
//"tech.picnic.errorprone.refasterrules.FileRulesRecipes",
//"tech.picnic.errorprone.refasterrules.JUnitRulesRecipes",
//"tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes",
//"tech.picnic.errorprone.refasterrules.NullRulesRecipes",
//"tech.picnic.errorprone.refasterrules.OptionalRulesRecipes",
//"tech.picnic.errorprone.refasterrules.PatternRulesRecipes",
//"tech.picnic.errorprone.refasterrules.PreconditionsRulesRecipes",
//"tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes",
//"tech.picnic.errorprone.refasterrules.StreamRulesRecipes",
//"tech.picnic.errorprone.refasterrules.StringRulesRecipes",
//"tech.picnic.errorprone.refasterrules.SuggestedFixRulesRecipes",
//"tech.picnic.errorprone.refasterrules.TimeRulesRecipes",
)
exclusions.add("**DefaultAdminCredentialsVerifierImpl.java") // bug
exportDatatables = true
failOnDryRunResults = true
}

dependencies {
//rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.14.1")
//rewrite("org.openrewrite.recipe:rewrite-static-analysis:2.14.0")
//rewrite("org.openrewrite.recipe:rewrite-third-party:0.24.1")
rewrite("org.openrewrite.recipe:rewrite-rewrite:0.10.1")
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
3 changes: 1 addition & 2 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/sonar-auth-github/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies {
testImplementation project(path: ':server:sonar-webserver-api')

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-auth-gitlab/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
testImplementation 'org.mockito:mockito-junit-jupiter'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-auth-ldap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
testImplementation project(":sonar-testing-ldap")

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-auth-saml/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {
testImplementation testFixtures(project(':server:sonar-db-dao'))

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-ce-task-projectanalysis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ dependencies {
testFixturesCompileOnly 'com.github.spotbugs:spotbugs-annotations'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-ce-task/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {
testFixturesCompileOnly 'com.github.spotbugs:spotbugs-annotations'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-ce/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
testImplementation testFixtures(project(':server:sonar-server-common'))

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-db-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
testImplementation project(':sonar-testing-harness')

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testRuntimeOnly 'com.h2database:h2'
testRuntimeOnly 'com.microsoft.sqlserver:mssql-jdbc'
Expand Down
1 change: 1 addition & 0 deletions server/sonar-db-dao/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies {
testRuntimeOnly 'com.microsoft.sqlserver:mssql-jdbc'
testRuntimeOnly 'com.oracle.database.jdbc:ojdbc11'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.postgresql:postgresql'

testFixturesApi 'org.junit.jupiter:junit-jupiter-api'
Expand Down
1 change: 1 addition & 0 deletions server/sonar-db-migration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
testRuntimeOnly 'com.microsoft.sqlserver:mssql-jdbc'
testRuntimeOnly 'com.oracle.database.jdbc:ojdbc11'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testRuntimeOnly 'org.postgresql:postgresql'
}
Expand Down
1 change: 1 addition & 0 deletions server/sonar-process/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies {
testImplementation project(':sonar-testing-harness')

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-server-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dependencies {
testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-statemachine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies {
testImplementation 'org.mockito:mockito-junit-jupiter'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-telemetry-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies {
testImplementation 'org.mockito:mockito-core'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
}

tasks.test {
Expand Down
1 change: 1 addition & 0 deletions server/sonar-telemetry/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {
testImplementation testFixtures(project(':server:sonar-server-common'))

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
}

tasks.test {
Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
testFixturesCompileOnly 'org.junit.jupiter:junit-jupiter-api'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {


testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ dependencies {
testImplementation project(':sonar-testing-harness')

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'

runtimeOnly 'io.jsonwebtoken:jjwt-jackson'
Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver-es/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {
testFixturesApi testFixtures(project(':server:sonar-server-common'))

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver-monitoring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies {
testImplementation 'org.sonarsource.api.plugin:sonar-plugin-api-test-fixtures'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver-pushapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies {
testFixturesCompileOnly testFixtures(project(':server:sonar-webserver-ws'))

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver-webapi-v2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {

testRuntimeOnly 'org.apache.logging.log4j:log4j-core'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver-webapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dependencies {


testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}
test {
Expand Down
1 change: 1 addition & 0 deletions server/sonar-webserver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
testImplementation project(':sonar-testing-harness')

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
2 changes: 1 addition & 1 deletion sonar-application/bundled_plugins.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
bundledPlugin 'org.sonarsource.java:sonar-java-plugin'
bundledPlugin 'org.sonarsource.java:sonar-java-symbolic-execution-plugin'
bundledPlugin 'org.sonarsource.jacoco:sonar-jacoco-plugin'
bundledPlugin (group: 'org.sonarsource.javascript', name: 'sonar-javascript-plugin', classifier:'multi')
bundledPlugin ("org.sonarsource.javascript:sonar-javascript-plugin::multi")
bundledPlugin 'org.sonarsource.php:sonar-php-plugin'
bundledPlugin 'org.sonarsource.plugins.cayc:sonar-cayc-plugin'
bundledPlugin 'org.sonarsource.python:sonar-python-plugin'
Expand Down
1 change: 1 addition & 0 deletions sonar-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
testCompileOnly 'com.github.spotbugs:spotbugs-annotations'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions sonar-plugin-api-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies {
testImplementation 'org.sonarsource.api.plugin:sonar-plugin-api-test-fixtures'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down
1 change: 1 addition & 0 deletions sonar-scanner-protocol/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
testImplementation 'org.assertj:assertj-core'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

Expand Down