-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
138 lines (126 loc) · 4.45 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
plugins {
id "java-library"
id "maven-publish"
id "signing"
id "com.diffplug.spotless" version "6.25.0"
}
project.version = '1.4.0'
group = "org.komamitsu"
repositories {
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
integrationTestCompileOnly.extendsFrom testCompileOnly
}
dependencies {
implementation "org.slf4j:slf4j-api:2.0.11"
implementation "javax.annotation:javax.annotation-api:1.3.2"
implementation platform("org.springframework.boot:spring-boot-dependencies:3.3.5")
api "org.springframework.data:spring-data-jdbc"
implementation "org.xerial:sqlite-jdbc:3.45.1.0"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.1"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.2"
testImplementation "org.assertj:assertj-core:3.25.3"
testImplementation "org.mockito:mockito-core:5.11.0"
testImplementation "org.mockito:mockito-junit-jupiter:5.9.0"
testImplementation "org.springframework.boot:spring-boot-starter-test"
integrationTestImplementation "com.zaxxer:HikariCP:5.1.0"
}
tasks.withType(Test) {
useJUnitPlatform()
}
tasks.register('integrationTest', Test) {
description = 'Runs the integration tests'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false } // ensures integration tests are run every time when called
}
compileIntegrationTestJava {
options.compilerArgs << "-parameters"
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'spring-data-sqlite'
from components.java
pom {
name = 'Spring Data integration with SQLite'
description = 'Spring Data integration with SQLite'
url = 'https://github.com/komamitsu/spring-data-sqlite'
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = 'komamitsu'
name = 'Mitsunori Komatsu'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/komamitsu/spring-data-sqlite.git'
developerConnection = 'scm:git:https://github.com/komamitsu/spring-data-sqlite.git'
url = 'https://github.com/komamitsu/spring-data-sqlite'
}
}
}
}
repositories {
maven {
url = uri(project.version.toString().endsWith("-SNAPSHOT") ?
"https://oss.sonatype.org/content/repositories/snapshots/" :
"https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.hasProperty("ossrhUsername") ?
project.property("ossrhUsername").toString() : ""
password = project.hasProperty("ossrhPassword") ?
project.property("ossrhPassword").toString() : ""
}
}
}
}
signing {
if (project.hasProperty("signing.gnupg.keyName")) {
setRequired(true)
}
else if (project.hasProperty("signingKey")) {
// def signingKeyId = project.property("signingKeyId").toString()
def signingKey = project.property("signingKey").toString()
def signingPassword = project.property("signingPassword").toString()
// useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
useInMemoryPgpKeys(signingKey, signingPassword)
setRequired(true)
}
else {
setRequired(false)
}
sign publishing.publications.mavenJava
}
spotless {
java {
importOrder()
removeUnusedImports()
googleJavaFormat()
formatAnnotations()
}
}