-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
100 lines (86 loc) · 2.88 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
import com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep
import net.ltgt.gradle.errorprone.errorprone
import org.zaproxy.gradle.addon.AddOnStatus
import org.zaproxy.gradle.addon.internal.model.GitHubUser
import org.zaproxy.gradle.addon.internal.model.ProjectInfo
import org.zaproxy.gradle.addon.internal.model.ReleaseState
import org.zaproxy.gradle.addon.internal.tasks.GenerateReleaseStateLastCommit
import org.zaproxy.gradle.addon.misc.ConvertMarkdownToHtml
plugins {
id("com.diffplug.spotless") version "6.25.0"
id("com.github.ben-manes.versions") version "0.51.0"
id("net.ltgt.errorprone") version "4.0.0"
`java-library`
id("org.zaproxy.add-on") version "0.11.0"
id("org.zaproxy.common") version "0.3.0"
}
repositories {
mavenCentral()
}
java {
val javaVersion = JavaVersion.VERSION_11
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
dependencies {
"errorprone"("com.google.errorprone:error_prone_core:2.28.0")
}
spotless {
kotlinGradle {
ktlint()
}
java {
// Don't enforce the license, just the format.
clearSteps()
googleJavaFormat("1.17.0").aosp()
}
format("html", {
eclipseWtp(EclipseWtpFormatterStep.HTML)
target(
fileTree(projectDir) {
include("src/**/*.html")
},
)
})
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "utf-8"
options.errorprone {
error(
"MethodCanBeStatic",
"WildcardImport",
)
}
}
description = "Colors history table items based on tags"
zapAddOn {
addOnName.set("Neonmarker")
addOnStatus.set(AddOnStatus.ALPHA)
zapVersion.set("2.10.0")
releaseLink.set("https://github.com/kingthorin/neonmarker/compare/v@PREVIOUS_VERSION@...v@CURRENT_VERSION@")
unreleasedLink.set("https://github.com/kingthorin/neonmarker/compare/v@CURRENT_VERSION@...HEAD")
manifest {
author.set("Juha Kivekäs, Kingthorin")
url.set("https://www.zaproxy.org/docs/desktop/addons/neonmarker/")
repo.set("https://github.com/kingthorin/neonmarker")
changesFile.set(tasks.named<ConvertMarkdownToHtml>("generateManifestChanges").flatMap { it.html })
helpSet {
baseName.set("help%LC%.helpset")
localeToken.set("%LC%")
}
}
gitHubRelease {
user.set(GitHubUser("kingthorin", "kingthorin@users.noreply.github.com", System.getenv("AUTH_TOKEN")))
}
}
val projectInfo = ProjectInfo.from(project)
val generateReleaseStateLastCommit by tasks.registering(GenerateReleaseStateLastCommit::class) {
projects.set(listOf(projectInfo))
}
val releaseAddOn by tasks.registering {
if (ReleaseState.read(projectInfo).isNewRelease()) {
dependsOn(tasks.createRelease)
dependsOn(tasks.handleRelease)
dependsOn(tasks.createPullRequestNextDevIter)
}
}