-
Notifications
You must be signed in to change notification settings - Fork 78
/
build.gradle
97 lines (81 loc) · 3.43 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
ext.buildTime = new Date().toInstant()
buildscript {
ext.springBootVersion = 'latest.release'
ext.springCloudVersion = 'latest.release'
ext.springDataVersion = 'latest.release'
configurations.classpath {
resolutionStrategy.activateDependencyLocking()
}
repositories {
gradlePluginPortal()
}
dependencies {
classpath 'org.ajoberstar.grgit:grgit-gradle:latest.release'
classpath 'com.gorylenko.gradle-git-properties:gradle-git-properties:latest.release'
classpath 'org.cyclonedx:cyclonedx-gradle-plugin:latest.release'
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
}
}
task clean
apply plugin: 'org.ajoberstar.grgit'
apply from: "$rootDir/gradle/idea.gradle"
allprojects {
task cleanAll {
description = 'Deletes the build directory and the IDE files and directories'
group = 'build'
dependsOn clean, cleanIdea, cleanIdeaWorkspace
doLast {
delete 'out', '.idea'
}
}
}
subprojects {
repositories {
mavenCentral()
}
if (project.name != 'load-gen') {
apply plugin: 'java'
apply from: "$rootDir/gradle/dependency-locking.gradle"
group = 'org.example.teahouse'
version = "${grgit.head().abbreviatedId}.${buildTime.toEpochMilli()}"
dependencies {
['annotationProcessor', 'compileOnly', 'implementation', 'runtimeOnly', 'testImplementation'].each { conf ->
dependencies.add(conf, platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion"))
dependencies.add(conf, platform("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"))
dependencies.add(conf, platform("org.springframework.data:spring-data-bom:$springDataVersion"))
}
testImplementation platform('org.junit:junit-bom:latest.release')
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testImplementation 'io.rest-assured:rest-assured'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
java {
toolchain { languageVersion = JavaLanguageVersion.of(23) }
}
jar.manifest.attributes(
'Name': project.name,
'Implementation-Build-Date': buildTime,
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': project.group,
'Commit-AbbreviatedId': grgit.head().abbreviatedId,
'Commit-Id': grgit.head().id,
'Commit-Date': grgit.head().getDateTime().toInstant(),
'Source-Path': grgit.remote.list().findResult { it.name == 'origin' ? it.url : null },
'Created-By': "Gradle ${gradle.gradleVersion}",
'Built-By': System.properties['user.name'],
'JDK': org.gradle.internal.jvm.Jvm.current(),
'OS': org.gradle.internal.os.OperatingSystem.current()
)
test {
useJUnitPlatform()
}
}
}
wrapper {
distributionType = Wrapper.DistributionType.BIN
// gradleVersion = new groovy.json.JsonSlurper().parseText('https://services.gradle.org/versions/current'.toURL().text).version
}