-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
158 lines (133 loc) · 5.62 KB
/
build.gradle.kts
File metadata and controls
158 lines (133 loc) · 5.62 KB
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
import java.util.*
plugins {
jacoco
java
`maven-publish`
id("org.sonarqube") version "7.2.2.6593"
id("cloud.rio.license") version "0.18.0"
id("com.gradleup.shadow") version "9.3.1"
id("com.github.ben-manes.versions") version "0.53.0"
id("com.github.gradle-git-version-calculator") version "1.1.0"
id("io.freefair.lombok") version "9.2.0"
}
group = "io.github.1c-syntax"
version = gitVersionCalculator.calculateVersion("v")
repositories {
mavenLocal()
mavenCentral()
maven("https://central.sonatype.com/repository/maven-snapshots")
}
val sonarQubeVersion = "25.4.0.105899"
val commonmarkVersion = "0.27.1"
dependencies {
compileOnly("org.sonarsource.api.plugin", "sonar-plugin-api", "11.3.0.2824")
implementation("io.github.1c-syntax", "bsl-language-server", "0.29.0-rc.1") {
exclude("com.contrastsecurity", "java-sarif")
exclude("io.sentry", "sentry-logback")
exclude("info.picocli", "picocli-spring-boot-starter")
exclude("me.tongfei", "progressbar")
}
implementation("org.sonarsource.analyzer-commons", "sonar-analyzer-commons", "2.21.0.4626")
// MD to HTML converter of BSL LS rule descriptions
implementation("org.commonmark", "commonmark", commonmarkVersion)
implementation("org.commonmark", "commonmark-ext-gfm-tables", commonmarkVersion)
implementation("org.commonmark", "commonmark-ext-autolink", commonmarkVersion)
implementation("org.commonmark", "commonmark-ext-heading-anchor", commonmarkVersion)
testImplementation("org.junit.jupiter", "junit-jupiter-api", "6.0.3")
testImplementation("org.assertj", "assertj-core", "3.27.7")
testImplementation("org.mockito", "mockito-core", "5.21.0")
testImplementation("org.sonarsource.sonarqube", "sonar-testing-harness", sonarQubeVersion) {
exclude("org.sonarsource.sonarqube", "sonar-sarif")
}
testImplementation("org.sonarsource.sonarqube", "sonar-core", sonarQubeVersion) {
exclude("org.sonarsource.sonarqube", "sonar-sarif")
}
testImplementation("org.reflections", "reflections", "0.10.2")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "6.0.3")
testRuntimeOnly("org.junit.platform", "junit-platform-launcher", "6.0.3")
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-Xlint:unchecked")
}
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("${layout.buildDirectory.get()}/reports/jacoco/test/jacoco.xml"))
}
}
license {
header = rootProject.file("license/HEADER.txt")
skipExistingHeaders = false
strictCheck = true
mapping("java", "SLASHSTAR_STYLE")
ext["year"] = Calendar.getInstance().get(Calendar.YEAR)
ext["name"] = "Alexey Sosnoviy <labotamy@gmail.com>, Nikita Fedkin <nixel2007@gmail.com>"
ext["project"] = "SonarQube 1C (BSL) Community Plugin"
include("**/*.java")
}
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-bsl-plugin-community")
property("sonar.projectName", "SonarQube 1C (BSL) Community Plugin")
property("sonar.exclusions", "**/gen/**/*.*")
property(
"sonar.coverage.jacoco.xmlReportPaths",
"${layout.buildDirectory.get()}/reports/jacoco/test/jacoco.xml"
)
}
}
tasks.jar {
manifest {
attributes["Plugin-Key"] = "communitybsl"
attributes["Plugin-Description"] = "Code Analyzer for 1C (BSL)"
attributes["Plugin-Class"] = "com.github._1c_syntax.bsl.sonar.BSLPlugin"
attributes["Plugin-Name"] = "1C (BSL) Community Plugin"
attributes["Plugin-Version"] = "${project.version}"
attributes["Plugin-RequiredForLanguages"] = "bsl"
attributes["Plugin-License"] = "GNU LGPL v3"
attributes["Plugin-Homepage"] = "https://1c-syntax.github.io/sonar-bsl-plugin-community"
attributes["Plugin-IssueTrackerUrl"] = "https://github.com/1c-syntax/sonar-bsl-plugin-community/issues"
attributes["Plugin-SourcesUrl"] = "https://github.com/1c-syntax/sonar-bsl-plugin-community"
attributes["Plugin-Developers"] = "Alexey Sosnoviy, Nikita Fedkin"
attributes["SonarLint-Supported"] = false
attributes["Plugin-Organization"] = "1c-syntax"
attributes["Plugin-OrganizationUrl"] = "https://github.com/1c-syntax"
}
enabled = false
dependsOn(tasks.shadowJar)
}
tasks.shadowJar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
mergeServiceFiles()
transform(com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer::class.java) {
resource.set("META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports")
separator.set("\n")
}
transform(com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer::class.java) {
paths.set(setOf("META-INF/org/languagetool/language-module.properties"))
mergeStrategy.set(com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer.MergeStrategy.Append)
mergeSeparator.set(",")
}
configurations = listOf(project.configurations["runtimeClasspath"])
archiveClassifier.set("")
}