Skip to content

Commit 560af02

Browse files
Update config
1 parent 0466e33 commit 560af02

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

buildSrc/build.gradle.kts

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023, TeamDev. All rights reserved.
2+
* Copyright 2024, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -195,6 +195,25 @@ dependencies {
195195
}
196196
}
197197

198+
dependOnBuildSrcJar()
199+
200+
/**
201+
* Adds a dependency on a `buildSrc.jar`, iff `src` folder is missing,
202+
* and `buildSrc.jar` is present in `buildSrc/` folder instead.
203+
*
204+
* This approach is used in the scope of integration testing.
205+
*/
206+
fun Project.dependOnBuildSrcJar() {
207+
val srcFolder = this.rootDir.resolve("src")
208+
val buildSrcJar = rootDir.resolve("buildSrc.jar")
209+
if(!srcFolder.exists() && buildSrcJar.exists()) {
210+
logger.info("Adding the pre-compiled 'buildSrc.jar' to 'implementation' dependencies.")
211+
dependencies {
212+
implementation(files("buildSrc.jar"))
213+
}
214+
}
215+
}
216+
198217
/**
199218
* Includes the `implementation` dependency on `artifactregistry-auth-common`,
200219
* with the version defined in [googleAuthToolVersion].

buildSrc/src/main/kotlin/DokkaExts.kt

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ fun Project.dokkaJavaJar(): TaskProvider<Jar> = tasks.getOrCreate("dokkaJavaJar"
189189
* This function could be useful to improve build speed when building subprojects containing
190190
* test environments or integration test projects.
191191
*/
192+
@Suppress("unused")
192193
fun Project.disableDocumentationTasks() {
193194
gradle.taskGraph.whenReady {
194195
tasks.forEach { task ->

config

0 commit comments

Comments
 (0)