|
1 | 1 | import org.apache.tools.ant.filters.ReplaceTokens |
2 | 2 |
|
3 | 3 | buildscript { |
4 | | - repositories { |
5 | | - maven { |
6 | | - url "https://plugins.gradle.org/m2/" |
7 | | - } |
8 | | - } |
9 | | - dependencies { |
10 | | - classpath "org.springframework.boot:spring-boot-gradle-plugin:2.2.0.RELEASE" |
| 4 | + repositories { |
| 5 | + maven { |
| 6 | + url "https://plugins.gradle.org/m2/" |
11 | 7 | } |
| 8 | + } |
| 9 | + dependencies { |
| 10 | + classpath "org.springframework.boot:spring-boot-gradle-plugin:4.0.0-M1" |
| 11 | + } |
12 | 12 | } |
13 | 13 |
|
14 | 14 | rootProject.version = "0.0.1" |
15 | 15 | group = "com.spaceshift" |
16 | 16 |
|
17 | 17 | allprojects { |
18 | 18 |
|
19 | | - apply plugin: "java" |
20 | | - apply plugin: "groovy" |
21 | | - apply plugin: "org.springframework.boot" |
| 19 | + apply plugin: "java" |
| 20 | + apply plugin: "groovy" |
| 21 | + apply plugin: "org.springframework.boot" |
22 | 22 |
|
23 | | - sourceCompatibility = JavaVersion.VERSION_14 |
24 | | - targetCompatibility = JavaVersion.VERSION_14 |
| 23 | + //sourceCompatibility = JavaVersion.VERSION_17 |
| 24 | + //targetCompatibility = JavaVersion.VERSION_17 |
25 | 25 |
|
26 | | - repositories { |
27 | | - jcenter() |
28 | | - mavenCentral() |
29 | | - mavenLocal() |
30 | | - maven { url "https://dl.bintray.com/javasabr/maven" } |
31 | | - } |
| 26 | + repositories { |
| 27 | + mavenCentral() |
| 28 | + mavenLocal() |
| 29 | + } |
32 | 30 |
|
33 | | - ext { |
34 | | - annotationVersion = "17.0.0" |
35 | | - rlibVersion = "9.9.0" |
36 | | - lombokVersion = '1.18.4' |
37 | | - springbootVersion = '2.2.0.RELEASE' |
38 | | - springVersion = '5.1.6.RELEASE' |
39 | | - junitJupiterVersion = "5.5.2" |
40 | | - testcontainersVersion = "1.12.1" |
41 | | - groovyVersion = "3.0.4" |
42 | | - spockVersion = "2.0-M3-groovy-3.0" |
43 | | - projectReactorVersion = "3.3.0.RELEASE" |
44 | | - byteBuddyVersion = "1.10.2" |
45 | | - objenesisVersion = "3.1" |
46 | | - gsonVersion = "2.8.6" |
47 | | - } |
| 31 | + dependencies { |
48 | 32 |
|
49 | | - dependencies { |
50 | | - |
51 | | - implementation "com.spaceshift:rlib.network:$rlibVersion" |
52 | | - implementation "com.spaceshift:rlib.logger.slf4j:$rlibVersion" |
53 | | - implementation "org.springframework.boot:spring-boot-starter:$springbootVersion" |
54 | | - implementation "org.springframework.boot:spring-boot-starter-log4j2:$springbootVersion" |
55 | | - implementation "io.projectreactor:reactor-core:$projectReactorVersion" |
56 | | - implementation "com.google.code.gson:gson:$gsonVersion" |
57 | | - |
58 | | - compileOnly "org.jetbrains:annotations:$annotationVersion" |
59 | | - compileOnly "org.projectlombok:lombok:$lombokVersion" |
60 | | - annotationProcessor "org.projectlombok:lombok:$lombokVersion" |
61 | | - |
62 | | - // FIXME to remove |
63 | | - testCompile "com.hivemq:hivemq-mqtt-client:1.1.2" |
64 | | - testCompile "io.moquette:moquette-broker:0.12.1" |
65 | | - |
66 | | - testCompileOnly "org.jetbrains:annotations:$annotationVersion" |
67 | | - testImplementation "org.springframework:spring-test:$springVersion" |
68 | | - testImplementation "org.spockframework:spock-core:$spockVersion" |
69 | | - testImplementation "org.spockframework:spock-spring:$spockVersion" |
70 | | - testImplementation "org.codehaus.groovy:groovy-all:$groovyVersion" |
71 | | - testImplementation "net.bytebuddy:byte-buddy-dep:$byteBuddyVersion" |
72 | | - testImplementation "org.objenesis:objenesis:$objenesisVersion" |
73 | | - } |
| 33 | + implementation libs.rlib.network |
| 34 | + implementation libs.rlib.logger.slf4j |
| 35 | + implementation libs.springboot.starter.core |
| 36 | + implementation libs.springboot.starter.log4j2 |
| 37 | + implementation libs.project.reactor.core |
| 38 | + implementation libs.gson |
74 | 39 |
|
75 | | - sourceSets { |
76 | | - main { |
77 | | - java { |
78 | | - srcDirs 'src/main/groovy' |
79 | | - } |
80 | | - } |
81 | | - test { |
82 | | - java { |
83 | | - srcDirs 'src/test/groovy' |
84 | | - } |
85 | | - } |
86 | | - } |
87 | | - |
88 | | - tasks.withType(Test) { |
89 | | - maxParallelForks = 2 |
90 | | - forkEvery = 100 |
91 | | - jvmArgs += "--enable-preview" |
92 | | - } |
93 | | - |
94 | | - tasks.withType(JavaCompile) { |
95 | | - options.compilerArgs += "--enable-preview" |
96 | | - } |
97 | | - |
98 | | - tasks.withType(GroovyCompile) { |
99 | | - options.forkOptions.jvmArgs += "--enable-preview" |
| 40 | + compileOnly libs.jetbrains.annotations |
| 41 | + compileOnly libs.jspecify |
| 42 | + compileOnly libs.lombok |
| 43 | + annotationProcessor libs.lombok |
| 44 | + |
| 45 | + // FIXME to remove |
| 46 | + testImplementation libs.hivemq.mqtt.client |
| 47 | + // FIXME to remove |
| 48 | + testImplementation libs.moquette.broker |
| 49 | + testImplementation libs.spring.test |
| 50 | + testImplementation libs.spock.core |
| 51 | + testImplementation libs.spock.spring |
| 52 | + testImplementation libs.groovy.all |
| 53 | + testImplementation libs.byte.buddy.dep |
| 54 | + testImplementation libs.objenesis |
| 55 | + testCompileOnly libs.jetbrains.annotations |
| 56 | + testCompileOnly libs.jspecify |
| 57 | + } |
| 58 | + |
| 59 | + test { |
| 60 | + useJUnitPlatform() |
| 61 | + failOnNoDiscoveredTests = false |
| 62 | + } |
| 63 | + |
| 64 | + sourceSets { |
| 65 | + main { |
| 66 | + java { |
| 67 | + srcDirs 'src/main/groovy' |
| 68 | + } |
100 | 69 | } |
101 | | - |
102 | | - processResources { |
103 | | - filter(ReplaceTokens, tokens: [ |
104 | | - ]) |
| 70 | + test { |
| 71 | + java { |
| 72 | + srcDirs 'src/test/groovy' |
| 73 | + } |
105 | 74 | } |
| 75 | + } |
| 76 | + |
| 77 | + tasks.withType(Test).configureEach { |
| 78 | + maxParallelForks = 2 |
| 79 | + forkEvery = 100 |
| 80 | + jvmArgs += "--enable-preview" |
| 81 | + } |
| 82 | + |
| 83 | + tasks.withType(JavaCompile).configureEach { |
| 84 | + options.compilerArgs += "--enable-preview" |
| 85 | + } |
| 86 | + |
| 87 | + tasks.withType(GroovyCompile).configureEach { |
| 88 | + options.forkOptions.jvmArgs += "--enable-preview" |
| 89 | + } |
| 90 | + |
| 91 | + processResources { |
| 92 | + filter(ReplaceTokens, tokens: [ |
| 93 | + ]) |
| 94 | + } |
106 | 95 | } |
107 | 96 |
|
108 | 97 | task buildSingleArtifact(type: GradleBuild) { |
109 | | - group = 'build' |
110 | | - description = 'Build all modules -> Build result artifact' |
111 | | - tasks = ['build', 'bootJar'] |
| 98 | + group = 'build' |
| 99 | + description = 'Build all modules -> Build result artifact' |
| 100 | + tasks = ['build', 'bootJar'] |
112 | 101 | } |
113 | 102 |
|
114 | 103 | task buildSingleArtifactWithoutTests(type: GradleBuild) { |
115 | | - group = 'build' |
116 | | - description = 'Build all modules without tests -> Build result artifact' |
117 | | - tasks = ['classes', 'bootJar'] |
| 104 | + group = 'build' |
| 105 | + description = 'Build all modules without tests -> Build result artifact' |
| 106 | + tasks = ['classes', 'bootJar'] |
118 | 107 | } |
119 | 108 |
|
120 | 109 | wrapper { |
121 | | - gradleVersion = '6.6-milestone-1' |
122 | | - distributionType = Wrapper.DistributionType.ALL |
| 110 | + gradleVersion = '6.6-milestone-1' |
| 111 | + distributionType = Wrapper.DistributionType.ALL |
123 | 112 | } |
124 | 113 |
|
125 | 114 | configurations.each { |
126 | | - it.exclude group: "org.slf4j", module: "slf4j-log4j12" |
127 | | - it.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging" |
| 115 | + it.exclude group: "org.slf4j", module: "slf4j-log4j12" |
| 116 | + it.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging" |
128 | 117 | } |
0 commit comments