forked from SonarSource/sonarlint-intellij
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
145 lines (126 loc) · 4.15 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!groovy
// The above triggers groovy syntax highlighting in vim
plugins {
id "org.jetbrains.intellij" version "0.4.14"
id "org.sonarqube" version "2.7.1"
id "java"
id "com.github.hierynomus.license" version "0.14.0"
id "com.jfrog.artifactory" version "4.11.0"
id 'com.google.protobuf' version "0.8.10"
}
apply plugin: 'java'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'jacoco'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
group = 'org.sonarsource.sonarlint.intellij'
description = 'SonarLint for IntelliJ IDEA'
sourceCompatibility = 1.8
targetCompatibility = 1.8
if (!project.hasProperty("ijVersion")) {
ext.ijVersion = '2019.2'
}
intellij {
version ijVersion
pluginName 'sonarlint-intellij'
updateSinceUntilBuild false
type 'IC'
if (!ijVersion.startsWith("2017") && !ijVersion.startsWith("2018")) {
plugins = ['java']
}
}
protobuf {
// Configure the protoc executable
protoc {
// Download from repositories. Must be the same as the one used in sonarlint-core
artifact = 'com.google.protobuf:protoc:3.9.1'
}
}
runIde {
systemProperty 'sonarlint.telemetry.disabled', 'true'
}
repositories {
jcenter()
mavenLocal()
maven {
url "https://repox.jfrog.io/repox/sonarsource"
}
}
configurations {
sqplugins { transitive = false }
}
dependencies {
compile "org.sonarsource.sonarlint.core:sonarlint-client-api:$sonarlintCoreVersion"
compile "org.sonarsource.sonarlint.core:sonarlint-core:$sonarlintCoreVersion"
compile 'commons-lang:commons-lang:2.6'
compile 'com.google.code.findbugs:jsr305:2.0.2'
// provided by the core:
//compile 'com.google.protobuf:protobuf-java:3.1.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.6.2'
testImplementation 'org.mockito:mockito-core:2.19.0'
sqplugins (
'org.sonarsource.java:sonar-java-plugin:6.1.0.20866@jar',
'org.sonarsource.javascript:sonar-javascript-plugin:6.2.0.12043',
'org.sonarsource.php:sonar-php-plugin:3.3.0.5166@jar',
'org.sonarsource.python:sonar-python-plugin:2.5.0.5733@jar',
'org.sonarsource.slang:sonar-kotlin-plugin:1.5.0.315@jar',
'org.sonarsource.slang:sonar-ruby-plugin:1.5.0.315@jar',
'org.sonarsource.html:sonar-html-plugin:3.2.0.2082@jar'
)
}
task cleanSQPlugins(type: Delete) {
delete fileTree('src/main/resources/plugins').include('**/*.jar')
}
task downloadSQPlugins(type: Copy, dependsOn: cleanSQPlugins) {
outputs.upToDateWhen { false }
from configurations.sqplugins
into 'src/main/resources/plugins'
}
classes.dependsOn downloadSQPlugins
sonarqube {
properties {
property 'sonar.projectName', 'SonarLint for IntelliJ IDEA'
}
}
license {
mapping {
java = 'SLASHSTAR_STYLE'
}
strictCheck true
}
jacocoTestReport {
afterEvaluate {
classDirectories.setFrom(files('build/classes/java/main-instrumented'))
}
reports {
xml.enabled true
}
}
artifactory {
clientConfig.info.setBuildName('sonarlint-intellij')
clientConfig.info.setBuildNumber(System.getenv('BUILD_BUILDID'))
clientConfig.setIncludeEnvVars(true)
clientConfig.setEnvVarsExcludePatterns('*password*,*PASSWORD*,*secret*,*MAVEN_CMD_LINE_ARGS*,sun.java.command,*token*,*TOKEN*,*LOGIN*,*login*')
clientConfig.info.addEnvironmentProperty('ARTIFACTS_TO_DOWNLOAD', 'org.sonarsource.sonarlint.intellij:sonarlint-intellij:zip')
contextUrl = System.getenv('ARTIFACTORY_URL')
publish {
repository {
repoKey = System.getenv('ARTIFACTORY_DEPLOY_REPO')
username = System.getenv('ARTIFACTORY_DEPLOY_USERNAME')
password = System.getenv('ARTIFACTORY_DEPLOY_PASSWORD')
}
defaults {
properties = [
'vcs.revision': System.getenv('BUILD_SOURCEVERSION'),
'vcs.branch': (System.getenv('SYSTEM_PULLREQUEST_TARGETBRANCH') ?: System.getenv('BUILD_SOURCEBRANCHNAME')),
'build.name': 'sonarlint-intellij',
'build.number': System.getenv('BUILD_BUILDID')
]
publishConfigs('archives')
publishPom = true // Publish generated POM files to Artifactory (true by default)
publishIvy = false // Publish generated Ivy descriptor files to Artifactory (true by default)
}
}
}