-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
147 lines (131 loc) · 4.24 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
145
146
147
import kotlinx.kover.gradle.plugin.dsl.CoverageUnit
plugins {
id "java-library"
id "signing"
id "maven-publish"
id "org.jetbrains.kotlin.jvm" version "${kotlinVersion}"
id "io.gitlab.arturbosch.detekt" version "${detektVersion}"
id "org.jetbrains.kotlinx.kover" version "${koverVersion}"
id "io.github.gradle-nexus.publish-plugin" version "${publishPluginVersion}"
id "com.github.ben-manes.versions" version "${benManerVersionsVersion}"
}
kover {
reports {
total {
verify {
rule {
bound {
coverageUnits = CoverageUnit.BRANCH
it.minValue = 90
}
bound {
coverageUnits = CoverageUnit.INSTRUCTION
it.minValue = 90
}
bound {
coverageUnits = CoverageUnit.BRANCH
it.minValue = 90
}
}
}
it.html {
onCheck = true
}
}
}
}
dependencies {
kover(project(":core"))
kover(project(":graaljs-evaluator"))
kover(project(":kotlin-evaluator"))
kover(project(":rhino-evaluator"))
kover(project(":jackson"))
}
allprojects {
apply plugin: "java-library"
apply plugin: "signing"
apply plugin: "maven-publish"
apply plugin: "org.jetbrains.kotlin.jvm"
apply plugin: "io.gitlab.arturbosch.detekt"
apply plugin: "org.jetbrains.kotlinx.kover"
apply plugin: "com.github.ben-manes.versions"
group "com.rapatao.ruleset"
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
}
test {
useJUnitPlatform()
}
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
detekt {
buildUponDefaultConfig = true
allRules = false
}
signing {
useGpgCmd()
sign publishing.publications
}
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = "RuleSet Engine"
description = "Simple yet powerful rules engine that offers the flexibility of using the built-in engine and creating a custom one."
url = "https://github.com/rapatao/ruleset-engine"
packaging = "jar"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "rapatao"
name = "Luiz Henrique Rapatao"
email = "rapatao@rapatao.com"
}
}
scm {
connection = "scm:git:git://github.com/rapatao/ruleset-engine.git"
developerConnection = "scm:git:ssh://github.com/rapatao/ruleset-engine.git"
url = "https://github.com/rapatao/ruleset-engine"
}
issueManagement {
system = "GitHub"
url = "https://github.com/rapatao/ruleset-engine/issues"
}
}
}
}
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
}
nexusPublishing {
repositories {
sonatype {
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
}
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}