-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARPHP-1520 Migrate Custom Rules module to Gradle (#1305)
- Loading branch information
Showing
26 changed files
with
140 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 0 additions & 53 deletions
53
.../php-custom-rules-plugin/src/main/java/org/sonar/samples/php/CustomPHPRuleRepository.java
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
...ins/php-custom-rules-plugin/src/main/java/org/sonar/samples/php/CustomPHPRulesPlugin.java
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
...p-custom-rules-plugin/src/main/java/org/sonar/samples/php/CustomPHPSubscriptionCheck.java
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
...ns/php-custom-rules-plugin/src/main/java/org/sonar/samples/php/CustomPHPVisitorCheck.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
<?php | ||
|
||
function f() { | ||
|
||
$f1 = function () { // NOK - function expression | ||
}; | ||
|
||
for (;;) { // NOK - for statement | ||
} | ||
|
||
} | ||
some_function(); | ||
foo(); | ||
test(); | ||
buzz(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import org.sonarsource.php.registerCleanupTask | ||
|
||
plugins { | ||
id("java-library") | ||
id("jacoco") | ||
alias(libs.plugins.shadow) | ||
} | ||
|
||
dependencies { | ||
compileOnly(libs.sonar.plugin.api) | ||
compileOnly(project(":php-frontend")) | ||
|
||
testImplementation(libs.junit.jupiter) | ||
testImplementation(libs.sonar.plugin.api.impl) | ||
testImplementation(testFixtures(project(":php-frontend"))) | ||
} | ||
|
||
description = "PHP Custom Rules Example for SonarQube" | ||
|
||
tasks.jar { | ||
manifest { | ||
attributes( | ||
mapOf( | ||
"Plugin-ChildFirstClassLoader" to "false", | ||
"Plugin-Class" to "org.sonar.samples.php.PHPCustomRulesPlugin", | ||
"Plugin-Description" to "PHP Custom Rules Example for SonarQube", | ||
"Plugin-Developers" to "SonarSource Team", | ||
"Plugin-Display-Version" to version, | ||
"Plugin-Homepage" to "https://sonarsource.atlassian.net/browse/SONARPHP", | ||
"Plugin-IssueTrackerUrl" to "https://sonarsource.atlassian.net/browse/SONARPHP", | ||
"Plugin-Key" to "custom", | ||
"Plugin-License" to "GNU LGPL 3", | ||
"Plugin-Name" to "PHP Custom Rules", | ||
"Plugin-Organization" to "SonarSource", | ||
"Plugin-OrganizationUrl" to "https://www.sonarsource.com", | ||
"Plugin-RequiredForLanguages" to "php", | ||
"Plugin-SourcesUrl" to "https://github.com/SonarSource/sonar-php", | ||
"Plugin-Version" to project.version, | ||
"Sonar-Version" to "9.9", | ||
"SonarLint-Supported" to "true", | ||
"Version" to project.version.toString(), | ||
"Jre-Min-Version" to java.sourceCompatibility.majorVersion, | ||
), | ||
) | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
|
||
plugins.withType<JacocoPlugin> { | ||
tasks["test"].finalizedBy("jacocoTestReport") | ||
} | ||
|
||
tasks.jacocoTestReport { | ||
dependsOn(tasks.test) | ||
reports { | ||
xml.required.set(true) | ||
} | ||
} | ||
|
||
val cleanupTask = registerCleanupTask() | ||
|
||
tasks.shadowJar { | ||
dependsOn(cleanupTask) | ||
exclude("**/*.php") | ||
} | ||
|
||
artifacts { | ||
archives(tasks.shadowJar) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.