-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
108 lines (89 loc) · 3.1 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
import com.anatawa12.compileTimeConstant.CreateConstantsTask
import app.gaborbiro.flathunt.Dependencies
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version '2.0.21'
id("com.anatawa12.compile-time-constant") version "1.0.5"
id("com.google.devtools.ksp") version "2.0.21-1.0.28"
id("com.github.ben-manes.versions") version "0.51.0"
}
apply from: "$project.rootDir/services.gradle"
// KSP - To use generated sources
sourceSets.main {
java.srcDirs("build/generated/ksp/main/kotlin")
}
group 'app.gaborbiro'
version '1.0'
repositories {
mavenCentral()
}
dependencies {
implementation(project(":service"))
implementation(project(":service:domain"))
implementation(project(":usecase"))
implementation(project(":data"))
implementation(project(":data:domain"))
implementation(project(":repo"))
implementation(project(":repo:domain"))
implementation(project(":directions"))
implementation(project(":base"))
implementation(project(":criteria"))
implementation(project(":request"))
implementation(project(":request:domain"))
implementation(project(":console"))
implementation(project(":console:domain"))
implementation(Dependencies.Google.gson)
implementation(Dependencies.Jcabi.mainfests)
implementation(Dependencies.slf4j.api)
implementation(Dependencies.slf4j.jdk14)
implementation(Dependencies.OkHttp.okhttp)
implementation(Dependencies.Selenium.java)
implementation(Dependencies.Koin.core)
implementation(Dependencies.Koin.annotations)
ksp(Dependencies.Koin.ksp)
}
apply plugin: "com.anatawa12.compile-time-constant"
tasks.withType(CreateConstantsTask) {
constantsClass = "app.gaborbiro.flathunt.compileTimeConstant.Constants"
values(
SERVICE_CONSTANTS.collectEntries { [it, it] }
)
}
SERVICE_CONFIGS.forEach {
tasks.register(it, RunnableJar, it, project)
}
task allJars {
dependsOn(SERVICE_CONFIGS)
}
class RunnableJar extends org.gradle.jvm.tasks.Jar {
@javax.inject.Inject
RunnableJar(String serviceConfig, Project project) {
manifest {
attributes(
"Main-Class": "app.gaborbiro.flathunt.FlathuntKt",
"jar-build-timestamp": new Date().toString(),
"serviceConfig": serviceConfig,
)
}
project.properties["serviceConfig"] = "idealista-exp"
archiveFileName.set("Flathunt-${serviceConfig}.jar")
from {} with project.jar
destinationDirectory = project.file(project.rootDir)
duplicatesStrategy = DuplicatesStrategy.WARN
}
}
jar {
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
}
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)
}
tasks.named("dependencyUpdates").configure {
gradleReleaseChannel = "release"
rejectVersionIf {
isNonStable(it.candidate.version)
}
}