-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
172 lines (146 loc) · 5.13 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
buildscript {
ext.kotlin_version = kotlin_version
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("com.cinnober.gradle:semver-git:2.3.1")
classpath("org.owasp:dependency-check-gradle:6.5.0.1")
}
}
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.5.31'
id 'maven-publish'
id 'signing'
id "org.owasp.dependencycheck" version "6.5.0.1"
}
group group_id
version "$base_version$version_suffix"
archivesBaseName = "kestrel"
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
sourceSets {
main.kotlin.srcDirs = main.java.srcDirs = ["src/main/kotlin"]
test.kotlin.srcDirs = test.java.srcDirs = ["src/test/java", "src/test/kotlin"]
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
dependencyCheck {
// anything over a 5.0 is above a 'warning'
failBuildOnCVSS = 2.0F
// this is the default, added here for clarity
failOnError = true
// if needed, a supression file can be added
suppressionFile = file("$rootDir/owasp-suppression.xml").toString()
analyzers.assemblyEnabled = false
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
maven {
def releasesUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsUrl : releasesUrl
credentials {
username = System.getenv('SONATYPE_USERNAME')
password = System.getenv('SONATYPE_PASSWORD')
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = "kestrel"
from components.java
pom {
name = "Kestrel"
description = "Kotlin Framework for running event-sourced services"
packaging = 'jar'
url = 'https://github.com/cultureamp/kestrel'
scm {
connection = 'scm:git@github.com:cultureamp/kestrel.git'
developerConnection = 'scm:git@github.com:cultureamp/kestrel.git'
url = 'https://github.com/cultureamp/kestrel'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'williamboxhall'
name = 'William Boxhall'
email = 'william.boxhall@cultureamp.com'
}
}
}
}
}
}
signing {
def skipSigning = Boolean.valueOf(System.getenv("SKIP_SIGNING"))
if (!skipSigning)
{
useGpgCmd()
sign publishing.publications.mavenJava
}
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
repositories {
mavenCentral()
mavenLocal()
}
test {
useJUnitPlatform()
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
testLogging {
events "PASSED", "FAILED", "SKIPPED", "STANDARD_OUT", "STANDARD_ERROR"
}
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-XXLanguage:+InlineClasses"]
jvmTarget = project.targetJvmVersion
}
}
compileTestKotlin {
kotlinOptions.jvmTarget = project.targetJvmVersion
}
dependencies {
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testImplementation "io.kotest:kotest-runner-junit5-jvm:4.6.2" // for kotest framework
testImplementation "io.kotest:kotest-assertions-core-jvm:4.6.2" // for kotest core jvm assertions
testImplementation "com.h2database:h2:1.4.200"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
implementation "joda-time:joda-time:2.10.10"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.exposed:exposed-core:$exposed_version"
implementation "org.jetbrains.exposed:exposed-jdbc:$exposed_version"
implementation "org.jetbrains.exposed:exposed-jodatime:$exposed_version"
implementation "org.jetbrains.exposed:exposed-json:$exposed_version"
implementation "io.github.microutils:kotlin-logging:2.0.11"
implementation "org.postgresql:postgresql:42.7.3" // needed for driver in DemonstrateEventSequenceIdGaps.kt
testImplementation 'org.testcontainers:postgresql:1.19.4'
testRuntimeOnly("org.slf4j:slf4j-simple:2.0.9") // so the tests print out logs
}