Skip to content

Commit 9fc990d

Browse files
authored
Use standardized project names (#11354)
* Use standardized project names This will make it easier to use Micronaut Core as an included build. This also simplifies some dependency substitution rules which were a bit awkward. * Convert all build scripts to Kotlin DSL For consistency and better IDE support.
1 parent 672983c commit 9fc990d

File tree

128 files changed

+2101
-2050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+2101
-2050
lines changed

aop/build.gradle

-23
This file was deleted.

aop/build.gradle.kts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
plugins {
2+
id("io.micronaut.build.internal.convention-core-library")
3+
alias(libs.plugins.managed.kotlin.jvm)
4+
}
5+
6+
micronautBuild {
7+
core {
8+
documented = false
9+
}
10+
}
11+
12+
dependencies {
13+
api(projects.micronautInject)
14+
api(projects.micronautCore)
15+
compileOnly(projects.micronautCoreReactive)
16+
compileOnly(libs.managed.kotlinx.coroutines.core)
17+
compileOnly(libs.managed.reactor)
18+
}
19+
20+
tasks {
21+
compileKotlin {
22+
kotlinOptions.jvmTarget = "17"
23+
kotlinOptions.languageVersion = "1.7"
24+
}
25+
}

benchmarks/build.gradle

-83
This file was deleted.

benchmarks/build.gradle.kts

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
plugins {
2+
id("io.micronaut.build.internal.convention-base")
3+
id("me.champeau.jmh") version "0.7.2"
4+
}
5+
6+
val typeCheckTestSourceSet = sourceSets.create("typeCheckTest") {
7+
compileClasspath += sourceSets.get("jmh").output
8+
runtimeClasspath += sourceSets.get("jmh").output
9+
}
10+
11+
dependencies {
12+
annotationProcessor(projects.micronautInjectJava)
13+
jmhAnnotationProcessor(projects.micronautInjectJava)
14+
jmhAnnotationProcessor(libs.bundles.asm)
15+
jmhAnnotationProcessor(libs.jmh.generator.annprocess)
16+
17+
annotationProcessor(platform(libs.test.boms.micronaut.validation))
18+
annotationProcessor(libs.micronaut.validation.processor) {
19+
exclude(group = "io.micronaut")
20+
}
21+
22+
compileOnly(platform(libs.test.boms.micronaut.validation))
23+
compileOnly(libs.micronaut.validation) {
24+
exclude(group = "io.micronaut")
25+
}
26+
27+
api(projects.micronautInject)
28+
api(projects.micronautInjectJavaTest)
29+
api(projects.micronautHttpServer)
30+
api(projects.micronautHttpServerNetty)
31+
api(projects.micronautHttpClient)
32+
api(projects.micronautJacksonDatabind)
33+
api(projects.micronautRouter)
34+
api(projects.micronautRuntime)
35+
36+
api(platform(libs.test.boms.micronaut.validation))
37+
api(libs.managed.reactor)
38+
api(libs.micronaut.validation) {
39+
exclude(group = "io.micronaut")
40+
}
41+
42+
jmh(libs.jmh.core)
43+
44+
"typeCheckTestImplementation"(libs.junit.jupiter)
45+
"typeCheckTestImplementation"(libs.micronaut.test.type.pollution)
46+
"typeCheckTestImplementation"(libs.bytebuddy.agent)
47+
"typeCheckTestImplementation"(libs.bytebuddy)
48+
"typeCheckTestRuntimeOnly"(libs.junit.platform.engine)
49+
}
50+
51+
configurations {
52+
get("typeCheckTestImplementation").extendsFrom(jmhImplementation.get(), implementation.get())
53+
get("typeCheckTestRuntimeOnly").extendsFrom(jmhRuntimeOnly.get(), runtimeOnly.get())
54+
}
55+
56+
jmh {
57+
includes = listOf("io.micronaut.http.server.StartupBenchmark")
58+
duplicateClassesStrategy = DuplicatesStrategy.WARN
59+
}
60+
61+
tasks {
62+
processJmhResources {
63+
duplicatesStrategy = DuplicatesStrategy.WARN
64+
}
65+
}
66+
67+
val typeCheckTest = tasks.register<Test>("typeCheckTest") {
68+
description = "Runs type check tests."
69+
group = "verification"
70+
71+
testClassesDirs = typeCheckTestSourceSet.output.classesDirs
72+
classpath = typeCheckTestSourceSet.runtimeClasspath
73+
74+
useJUnitPlatform()
75+
}
76+
77+
tasks {
78+
check {
79+
dependsOn(typeCheckTest)
80+
}
81+
}
82+
83+
listOf("spotlessJavaCheck", "checkstyleMain", "checkstyleJmh").forEach {
84+
tasks.named(it) {
85+
enabled = false
86+
}
87+
}

buffer-netty/build.gradle

-12
This file was deleted.

buffer-netty/build.gradle.kts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
plugins {
2+
id("io.micronaut.build.internal.convention-library")
3+
}
4+
5+
dependencies {
6+
api(projects.micronautCore)
7+
api(projects.micronautInject)
8+
api(libs.managed.netty.buffer)
9+
compileOnly(libs.graal)
10+
11+
annotationProcessor(projects.micronautInjectJava)
12+
}

buildSrc/settings.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ dependencyResolutionManagement {
55
}
66
}
77
}
8+
9+
rootProject.name = "buildSrc"

buildSrc/src/main/groovy/io.micronaut.build.internal.convention-base.gradle

+5-11
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ configurations.all {
1919
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
2020
}
2121

22-
configurations {
23-
testRuntimeClasspath {
24-
// Use AOP from here, not from maven
25-
exclude group: 'io.micronaut', module: 'micronaut-aop'
26-
}
27-
}
28-
2922
group = projectGroupId
3023

3124
def micronautBuild = (ExtensionAware) project.extensions.getByName("micronautBuild")
@@ -63,11 +56,12 @@ tasks.withType(Jar).configureEach {
6356
configurations.all {
6457
resolutionStrategy.dependencySubstitution {
6558
rootProject.subprojects.each {
66-
if (!it.name.startsWith('test-')) {
59+
String targetName = ":${it.name}"
60+
if (it.name.startsWith('micronaut-')) {
6761
if (it.name.contains('bom')) {
68-
substitute platform(module("io.micronaut:micronaut-${it.name}")) using platform(project(":${it.name}")) because "we want to test with what we're building"
62+
substitute platform(module("io.micronaut:micronaut-${it.name}")) using platform(project(targetName)) because "we want to test with what we're building"
6963
} else {
70-
substitute module("io.micronaut:micronaut-${it.name}") using project(":${it.name}") because "we want to test with what we're building"
64+
substitute module("io.micronaut:${it.name}") using project(targetName) because "we want to test with what we're building"
7165
}
7266
}
7367
}
@@ -90,7 +84,7 @@ dependencies {
9084
compileOnly libs.caffeine
9185
compileOnly libs.bundles.asm
9286

93-
testAnnotationProcessor project(":http-validation")
87+
testAnnotationProcessor projects.micronautHttpValidation
9488
testAnnotationProcessor libs.bundles.asm
9589

9690
testImplementation libs.caffeine
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
plugins {
2-
id "io.micronaut.build.internal.convention-library"
2+
id("io.micronaut.build.internal.convention-library")
33
}

buildSrc/src/main/groovy/io/micronaut/build/internal/japicmp/RemovedPackages.groovy

+5-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import groovy.transform.CompileStatic
1010
class RemovedPackages implements ViolationTransformer {
1111
private final List<String> excludedPackagesPrefixes
1212
private final List<String> excludedPackages
13-
14-
public RemovedPackages(Map<String, List<String>> params) {
15-
this.excludedPackagesPrefixes = params.prefixes as List<String>
16-
this.excludedPackages = params.exact as List<String>
13+
14+
public RemovedPackages(Map<String, String> params) {
15+
this.excludedPackagesPrefixes = params.prefixes.split(',') as List<String>
16+
this.excludedPackages = params.exact.split(',') as List<String>
1717
}
18-
18+
1919
Optional<Violation> transform(String type, Violation v) {
2020
String pkg = type.substring(0, type.lastIndexOf('.'))
2121

@@ -27,4 +27,3 @@ class RemovedPackages implements ViolationTransformer {
2727
return Optional.of(v)
2828
}
2929
}
30-

0 commit comments

Comments
 (0)