forked from spring-projects-experimental/spring-fu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
169 lines (152 loc) · 4.85 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
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.jetbrains.kotlin.jvm") version "1.3.11" apply false
id("org.springframework.boot") version "2.1.1.RELEASE" apply false
id("org.jetbrains.dokka") version "0.9.17" apply false
id("io.spring.dependency-management") version "1.0.6.RELEASE"
id("maven-publish")
}
allprojects {
apply {
plugin("maven-publish")
plugin("io.spring.dependency-management")
}
version = "0.0.5-BUILD-SNAPSHOT"
group = "org.springframework.fu"
dependencyManagement {
val bootVersion: String by project
val coroutinesVersion: String by project
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:$bootVersion")
}
dependencies {
dependency("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
dependency("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$coroutinesVersion")
}
}
publishing {
repositories {
val repoUsername: String? by project
val repoPassword: String? by project
maven {
if (repoUsername != null && repoPassword != null) {
credentials {
username = repoUsername
password = repoPassword
}
url = uri(
if (version.toString().endsWith(".BUILD-SNAPSHOT")) "https://repo.spring.io/libs-snapshot-local/"
else "https://repo.spring.io/libs-milestone-local/"
)
} else {
url = uri("$buildDir/repo")
}
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjsr305=strict", "-Xjvm-default=enable")
}
}
repositories {
mavenCentral()
maven("https://repo.spring.io/milestone")
}
}
publishing {
publications {
create<MavenPublication>("jafu-reactive-minimal") {
groupId = "org.springframework.fu"
artifactId = "spring-fu-samples-jafu-reactive-minimal"
artifact(task<Zip>("jafuReactiveMinimalSampleZip") {
from("samples/jafu-reactive-minimal") {
exclude("build", "com.sample.application", "target", ".gradle", ".idea", "out", "*.iml")
}
destinationDir = file("$buildDir/dist")
into("jafu-reactive-minimal")
setExecutablePermissions()
})
}
create<MavenPublication>("jafu-reactive-r2dbc") {
groupId = "org.springframework.fu"
artifactId = "spring-fu-samples-jafu-reactive-r2dbc"
artifact(task<Zip>("jafuReactiveR2dbcSampleZip") {
from("samples/jafu-reactive-r2dbc") {
exclude("build", "target", ".gradle", ".idea", "out", "*.iml")
}
destinationDir = file("$buildDir/dist")
into("jafu-reactive-r2dbc")
setExecutablePermissions()
})
}
create<MavenPublication>("kofu-coroutines-mongodb") {
groupId = "org.springframework.fu"
artifactId = "spring-fu-samples-kofu-coroutines-mongodb"
artifact(task<Zip>("kofuCoroutinesMongodbSample") {
from("samples/kofu-coroutines-mongodb") {
exclude("build", ".gradle", ".idea", "out", "*.iml")
}
destinationDir = file("$buildDir/dist")
into("kofu-coroutines-mongodb")
setExecutablePermissions()
})
}
create<MavenPublication>("kofu-coroutines-r2dbc") {
groupId = "org.springframework.fu"
artifactId = "spring-fu-samples-kofu-coroutines-r2dbc"
artifact(task<Zip>("kofuCoroutinesR2dbcSample") {
from("samples/kofu-coroutines-r2dbc") {
exclude("build", ".gradle", ".idea", "out", "*.iml")
}
destinationDir = file("$buildDir/dist")
into("kofu-coroutines-r2dbc")
setExecutablePermissions()
})
}
create<MavenPublication>("kofu-reactive-minimal") {
groupId = "org.springframework.fu"
artifactId = "spring-fu-samples-kofu-reactive-minimal"
artifact(task<Zip>("kofuReactiveMinimalSampleZip") {
from("samples/kofu-reactive-minimal") {
exclude("build", "com.sample.applicationkt", ".gradle", ".idea", "out", "*.iml")
}
destinationDir = file("$buildDir/dist")
into("kofu-reactive-minimal")
setExecutablePermissions()
})
}
create<MavenPublication>("kofu-reactive-mongodb") {
groupId = "org.springframework.fu"
artifactId = "spring-fu-samples-kofu-reactive-mongodb"
artifact(task<Zip>("kofuReactiveMongodbSampleZip") {
from("samples/kofu-reactive-mongodb") {
exclude("build", ".gradle", ".idea", "out", "*.iml")
}
destinationDir = file("$buildDir/dist")
into("kofu-reactive-mongodb")
setExecutablePermissions()
})
}
create<MavenPublication>("kofu-reactive-r2dbc") {
groupId = "org.springframework.fu"
artifactId = "spring-fu-samples-kofu-reactive-r2dbc"
artifact(task<Zip>("kofuReactiveR2dbcSampleZip") {
from("samples/kofu-reactive-r2dbc") {
exclude("build", ".gradle", ".idea", "out", "*.iml")
}
destinationDir = file("$buildDir/dist")
into("kofu-reactive-r2dbc")
setExecutablePermissions()
})
}
}
}
fun CopySpec.setExecutablePermissions() {
filesMatching("gradlew") { mode = 0b111101101 }
filesMatching("gradlew.bat") { mode = 0b110100100 }
}