-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle.kts
208 lines (175 loc) · 6.92 KB
/
build.gradle.kts
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
import me.qoomon.gradle.gitversioning.GitVersioningPluginConfig
import me.qoomon.gradle.gitversioning.GitVersioningPluginConfig.CommitVersionDescription
import me.qoomon.gradle.gitversioning.GitVersioningPluginConfig.VersionDescription
import org.apache.tools.ant.filters.EscapeUnicode
import java.util.*
plugins {
java
`maven-publish`
jacoco
id("org.cadixdev.licenser") version "0.6.1"
id("org.sonarqube") version "4.0.0.2929"
id("me.qoomon.git-versioning") version "3.0.0"
id("com.github.ben-manes.versions") version "0.28.0"
}
repositories {
mavenCentral()
}
group = "com.github.1c-syntax"
description = "Translate SonarQube web application in Russian"
gitVersioning.apply(closureOf<GitVersioningPluginConfig> {
preferTags = true
branch(closureOf<VersionDescription> {
pattern = "^(?!v[0-9]+).*"
versionFormat = "\${branch}-\${commit.short}\${dirty}"
})
tag(closureOf<VersionDescription> {
pattern = "v(?<tagVersion>[0-9].*)"
versionFormat = "\${tagVersion}\${dirty}"
})
commit(closureOf<CommitVersionDescription> {
versionFormat = "\${commit.short}\${dirty}"
})
})
val sonarQubeVersion = "10.6.0.92116"
val sonarQubeAPIPluginVersion = "10.6.0.2114" // https://github.com/SonarSource/sonar-plugin-api#compatibility
val junitVersion = "5.6.1"
dependencies {
compileOnly("org.sonarsource.api.plugin", "sonar-plugin-api", sonarQubeAPIPluginVersion)
testImplementation("org.junit.jupiter", "junit-jupiter-api", junitVersion)
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", junitVersion)
testImplementation("org.sonarsource.api.plugin", "sonar-plugin-api", sonarQubeAPIPluginVersion)
testImplementation("org.sonarsource.sonarqube", "sonar-testing-harness", sonarQubeVersion)
testImplementation("org.sonarsource.sonarqube", "sonar-core", sonarQubeVersion)
testImplementation("org.assertj", "assertj-core", "3.16.1")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-Xlint:unchecked")
options.compilerArgs.add("-Xlint:deprecation")
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
reports {
html.required.set(true)
}
}
tasks.check {
dependsOn(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
xml.outputLocation.set(File("$buildDir/reports/jacoco/test/jacoco.xml"))
}
}
tasks.processResources {
filteringCharset = "UTF-8"
// native2ascii gradle replacement
filesMatching("**/*.properties") {
filter<EscapeUnicode>()
}
}
tasks.jar {
manifest {
attributes["Plugin-Key"] = "l10nru"
attributes["Plugin-Description"] = "${project.description}"
attributes["Plugin-Class"] = "org.silverbulleters.sonar.plugins.l10n.RussianPackPlugin"
attributes["Plugin-Name"] = "Russian Pack"
attributes["Plugin-Version"] = "${project.version}"
attributes["Plugin-License"] = "GNU LGPL v3"
attributes["Plugin-Homepage"] = "https://github.com/1c-syntax/sonar-l10n-ru"
attributes["Plugin-IssueTrackerUrl"] = "https://github.com/1c-syntax/sonar-l10n-ru/issues"
attributes["Plugin-SourcesUrl"] = "https://github.com/1c-syntax/sonar-l10n-ru"
attributes["Plugin-Developers"] = "Alexey Lustin, Nikita Gryzlov"
attributes["Plugin-Organization"] = "SilverBulleters, 1c-syntax and contributors"
attributes["Plugin-OrganizationUrl"] = "https://github.com/1c-syntax"
}
exclude("**/core.properties")
}
publishing {
publications {
create<MavenPublication>("maven") {
artifact(tasks["jar"])
pom {
name.set("Russian Pack for SonarQube")
url.set("https://github.com/1c-syntax/sonar-l10n-ru")
inceptionYear.set("2016")
organization {
name.set("1c-syntax")
url.set("https://github.com/1c-syntax")
}
licenses {
license {
name.set("GNU LGPL v3")
url.set("http://www.gnu.org/licenses/lgpl.txt")
distribution.set("repo")
}
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/1c-syntax/sonar-l10n-ru/issues")
}
ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/1c-syntax/sonar-l10n-ru/actions")
}
scm {
connection.set("scm:git:https://github.com/1c-syntax/sonar-l10n-ru.git")
url.set("https://github.com/1c-syntax/sonar-l10n-ru")
}
developers {
developer {
id.set("allustin")
name.set("Alexey Lustin")
organization.set("SilverBulleters, LLC")
organizationUrl.set("https://www.silverbulleters.org")
}
developer {
id.set("nixel2007")
name.set("Nikita Gryzlov")
organization.set("1c-syntax")
email.set("[email protected]")
}
}
contributors {
contributor {
name.set("Evgeniy Sosna")
organization.set("SomeWhere")
organizationUrl.set("https://github.com/pumbaEO")
}
contributor {
name.set("Andrei Ovsiankin")
organization.set("Evil Beaver Soft")
email.set("https://github.com/EvilBeaver")
}
}
}
}
}
}
license {
header(rootProject.file("license/HEADER.txt"))
newLine(false)
ext["year"] = "2020-" + Calendar.getInstance().get(Calendar.YEAR)
ext["name"] = "1c-syntax"
ext["project"] = "Russian Pack for SonarQube"
exclude("**/*.properties")
}
sonarqube {
properties {
property("sonar.sourceEncoding", "UTF-8")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.organization", "1c-syntax")
property("sonar.projectKey", "1c-syntax_sonar-l10n-ru")
property("sonar.projectName", "Russian Pack for SonarQube")
property("sonar.coverage.jacoco.xmlReportPaths", "$buildDir/reports/jacoco/test/jacoco.xml")
}
}