Browse Source

SONAR-15469 Stop using deprecated Gradle API in SonarQube

tags/9.2.0.49834
Kengo TODA 2 years ago
parent
commit
d0b6b0f341

+ 5
- 5
build.gradle View File

} }


task sourcesJar(type: Jar, dependsOn: classes) { task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource from sourceSets.main.allSource
} }


task javadocJar(type: Jar, dependsOn: javadoc) { task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.destinationDir from javadoc.destinationDir
} }




jacocoTestReport { jacocoTestReport {
reports { reports {
xml.enabled true
csv.enabled false
html.enabled false
xml.required = true
csv.required = false
html.required = false
} }
} }



+ 3
- 3
server/sonar-db-dao/build.gradle View File

} }


task dumpSchema(type:JavaExec) { task dumpSchema(type:JavaExec) {
main = 'org.sonar.db.dump.DumpSQSchema'
mainClass = 'org.sonar.db.dump.DumpSQSchema'
classpath = sourceSets.test.runtimeClasspath classpath = sourceSets.test.runtimeClasspath
} }
tasks.check.dependsOn dumpSchema tasks.check.dependsOn dumpSchema


task createDB(type:JavaExec) { task createDB(type:JavaExec) {
main = 'org.sonar.db.createdb.CreateDb'
mainClass = 'org.sonar.db.createdb.CreateDb'
classpath = sourceSets.test.runtimeClasspath classpath = sourceSets.test.runtimeClasspath
systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl') systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
if (!project.version.endsWith("-SNAPSHOT")) { if (!project.version.endsWith("-SNAPSHOT")) {
} }


task testJar(type: Jar) { task testJar(type: Jar) {
classifier = 'tests'
archiveClassifier = 'tests'
from sourceSets.test.output from sourceSets.test.output
} }



+ 4
- 4
sonar-application/build.gradle View File



jar.enabled = false jar.enabled = false
shadowJar { shadowJar {
baseName = 'sonar-application'
classifier = null
archiveBaseName = 'sonar-application'
archiveClassifier = null
mergeServiceFiles() mergeServiceFiles()
manifest { manifest {
attributes('Main-Class': 'org.sonar.application.App') attributes('Main-Class': 'org.sonar.application.App')


def length = archiveFile.get().asFile.length() def length = archiveFile.get().asFile.length()
if (length < minLength) if (length < minLength)
throw new GradleException("$archiveName size ($length) too small. Min is $minLength")
throw new GradleException("${archiveFileName.get()} size ($length) too small. Min is $minLength")
if (length > maxLength) if (length > maxLength)
throw new GradleException("$distsDir/$archiveName size ($length) too large. Max is $maxLength")
throw new GradleException("${destinationDirectory.get()}/${archiveFileName.get()} size ($length) too large. Max is $maxLength")
} }
assemble.dependsOn zip assemble.dependsOn zip



+ 2
- 1
sonar-scanner-protocol/build.gradle View File

manifest { manifest {
attributes 'Main-Class': 'org.sonar.scanner.protocol.viewer.ScannerReportViewerApp' attributes 'Main-Class': 'org.sonar.scanner.protocol.viewer.ScannerReportViewerApp'
} }
baseName = project.name + '-all'
archiveBaseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar with jar
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
} }


build.dependsOn fatJar build.dependsOn fatJar

+ 1
- 1
sonar-ws-generator/build.gradle View File

manifest { manifest {
attributes 'Main-Class': 'org.sonarqube.wsgenerator.Generator' attributes 'Main-Class': 'org.sonarqube.wsgenerator.Generator'
} }
classifier = 'jar-with-dependencies'
archiveClassifier = 'jar-with-dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar with jar
} }

Loading…
Cancel
Save