mirror of
https://github.com/mc1arke/sonarqube-community-branch-plugin.git
synced 2024-11-28 08:58:55 +02:00
83d3a7ffcc
Bumps [assertj-core](https://github.com/assertj/assertj-core) from 3.21.0 to 3.22.0. - [Release notes](https://github.com/assertj/assertj-core/releases) - [Commits](https://github.com/assertj/assertj-core/compare/assertj-core-3.21.0...assertj-core-3.22.0) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
153 lines
4.7 KiB
Groovy
153 lines
4.7 KiB
Groovy
/*
|
|
* Copyright (C) 2020-2021 Michael Clarke
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 3 of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
*/
|
|
plugins {
|
|
id('java')
|
|
id('jacoco')
|
|
id('org.sonarqube') version('2.8')
|
|
id('info.solidsoft.pitest') version('1.4.0')
|
|
id('com.github.johnrengelman.shadow') version('5.1.0')
|
|
id('net.researchgate.release') version('2.6.0')
|
|
}
|
|
|
|
group 'com.github.mc1arke.sonarqube.plugin'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
ivy {
|
|
url 'https://binaries.sonarsource.com/'
|
|
patternLayout({a ->
|
|
artifact '/Distribution/[module]/[module]-[revision].[ext]'
|
|
})
|
|
metadataSources(sources -> {
|
|
sources.artifact()
|
|
})
|
|
}
|
|
}
|
|
|
|
def sonarqubeVersion = '9.1.0.47736'
|
|
def sonarqubeLibDir = "${projectDir}/sonarqube-lib"
|
|
def sonarLibraries = "${sonarqubeLibDir}/sonarqube-${sonarqubeVersion}/lib"
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
configurations {
|
|
zip
|
|
}
|
|
|
|
compileJava {
|
|
options.compilerArgs += '-proc:none'
|
|
}
|
|
|
|
|
|
dependencies {
|
|
compileOnly(fileTree(dir: sonarLibraries, include: '**/*.jar', exclude: 'extensions/*.jar'))
|
|
testImplementation(fileTree(dir: sonarLibraries, include: '**/*.jar', exclude: 'extensions/*.jar'))
|
|
testImplementation('org.mockito:mockito-core:4.2.0')
|
|
testImplementation('org.assertj:assertj-core:3.22.0')
|
|
testImplementation('com.github.tomakehurst:wiremock:2.27.2')
|
|
zip("sonarqube:sonarqube:${sonarqubeVersion}@zip")
|
|
implementation('org.bouncycastle:bcpkix-jdk15on:1.70')
|
|
implementation(files('lib/nodes-0.5.0.jar'))
|
|
runtimeOnly('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.1')
|
|
compileOnly('com.google.code.findbugs:jsr305:3.0.2')
|
|
implementation('org.javassist:javassist:3.28.0-GA')
|
|
implementation('com.squareup.okhttp3:logging-interceptor:4.9.3')
|
|
testImplementation(platform('org.junit:junit-bom:5.8.2'))
|
|
testImplementation('org.junit.jupiter:junit-jupiter')
|
|
testImplementation('junit:junit:4.13.2')
|
|
testRuntimeOnly('org.junit.vintage:junit-vintage-engine')
|
|
}
|
|
|
|
|
|
project.afterEvaluate {
|
|
if (file("${sonarLibraries}").exists()) {
|
|
return
|
|
}
|
|
project.getLogger().lifecycle('Extracting SonarQube libraries (this may take a while)...')
|
|
configurations.zip.resolvedConfiguration.resolvedArtifacts.each { artifact ->
|
|
copy {
|
|
from zipTree(artifact.getFile())
|
|
into sonarqubeLibDir
|
|
}
|
|
}
|
|
}
|
|
|
|
jar {
|
|
manifest {
|
|
attributes 'Plugin-Description': 'Enables branch and pull request analysis in SonarQube Community Edition, without having to upgrade to Developer Edition',
|
|
'SonarLint-Supported': false,
|
|
'Plugin-Homepage': 'https://github.com/mc1arke/sonarqube-community-branch-plugin',
|
|
'Plugin-License': 'GNU LGPL 3',
|
|
'Plugin-Version': "${project.version}",
|
|
'Plugin-Organization': 'Michael Clarke',
|
|
'Sonar-Version': "${sonarqubeVersion}",
|
|
'Plugin-IssueTrackerUrl': 'https://github.com/mc1arke/sonarqube-community-branch-plugin/issues',
|
|
'Plugin-Key': 'communityBranchPlugin',
|
|
'Plugin-Class': 'com.github.mc1arke.sonarqube.plugin.CommunityBranchPluginBootstrap',
|
|
'Plugin-Name': 'Community Branch Plugin',
|
|
'Premain-Class': 'com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent',
|
|
'Can-Retransform-Classes': 'true'
|
|
}
|
|
}
|
|
|
|
release {
|
|
git {
|
|
requireBranch = ''
|
|
commitVersionFileOnly = true
|
|
}
|
|
}
|
|
|
|
tasks.jar.configure {
|
|
classifier = 'nodeps'
|
|
enabled = false
|
|
}
|
|
|
|
tasks.shadowJar.configure {
|
|
classifier = null
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.compilerArgs << '-Xlint:unchecked'
|
|
options.deprecation = true
|
|
}
|
|
|
|
assemble.dependsOn('shadowJar')
|
|
|
|
pitest {
|
|
timestampedReports = false
|
|
avoidCallsTo = ['org.sonar.api.utils.log.Logger']
|
|
}
|
|
|
|
jacocoTestReport {
|
|
reports {
|
|
xml.required = true
|
|
}
|
|
}
|
|
|
|
plugins.withType(JacocoPlugin) {
|
|
tasks["test"].finalizedBy 'jacocoTestReport'
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
events "passed", "skipped", "failed"
|
|
}
|
|
}
|