Integrate cloud-native-gradle-modules as a source of shared build logic

Description

Currently, sonar-php has a dedicated included build build-logic. These things are generally copy-pasted from other repos. To centralize this solution, we have a shared solution with a repository . Similar to how it’s already done in sonar-go and sonar-iac, sonar-php should be using this repo as well.

Steps to be done:

  1. Add a submodule at gradle/build-logic-common

  2. Update CI scripts and Readme to include the command for cloning this submodule before any Gradle invocation

  3. Some parts have a drop-in replacement. For them it’s necessary to change groupId from org.sonarsource.php to org.sonarsource.cloud-native with maybe minor changes in API

    1. artifactory-configuration

    2. java-conventions, code-style-convention

    3. integration-test

    4. rule-api

    5. Methods defined in BuildUtils

  4. Additionally, plugins "org.sonarsource.cloud-native.common-settings" and org.sonarsource.cloud-native.sonar-plugin need to be applied to settings.gradle.kts and sonar-php-plugin respectively.

    1. Settings plugin is a prerequisite for

  5. Clean up old code by removing unused code from build-logic

    1. If there is nothing left, remove it in favor of gradle/build-logic-common

  6. Replace invocation of store_project_version_script in the Cirrus build task with storeProjectVersion Gradle task

Activity

Show:
Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Sprint

Fix versions

Priority

Sentry

Created February 27, 2025 at 9:59 AM
Updated March 26, 2025 at 8:59 AM
Resolved March 26, 2025 at 8:59 AM