diff --git a/build.gradle.kts b/build.gradle.kts index 05f8eac..74257f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -96,13 +96,6 @@ subprojects { ErrorProne.apply { errorprone(core) } - - // Force versions for compilation/runtime as well. - // - // Maybe, not all of them are required in this scope. - // This is to investigate later. - // - doForceVersions(configurations) } protobuf { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index acc7982..4d4be39 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -92,16 +92,6 @@ val errorPronePluginVersion = "3.1.0" */ val protobufPluginVersion = "0.9.4" -/** - * The version of Dokka Gradle Plugins. - * - * Please keep in sync with [io.spine.internal.dependency.Dokka.version]. - * - * @see - * Dokka Releases - */ -val dokkaVersion = "1.8.20" - /** * The version of Detekt Gradle Plugin. * @@ -161,8 +151,6 @@ dependencies { implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion") implementation("com.google.protobuf:protobuf-gradle-plugin:$protobufPluginVersion") - implementation("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}") - implementation("org.jetbrains.dokka:dokka-base:${dokkaVersion}") // https://github.com/srikanth-lingala/zip4j implementation("net.lingala.zip4j:zip4j:2.10.0") @@ -170,3 +158,23 @@ dependencies { implementation("io.kotest:kotest-gradle-plugin:$kotestJvmPluginVersion") implementation("org.jetbrains.kotlinx:kover-gradle-plugin:$koverVersion") } + +dependOnBuildSrcJar() + +/** + * Adds a dependency on a `buildSrc.jar`, iff: + * 1) the `src` folder is missing, and + * 2) `buildSrc.jar` is present in `buildSrc/` folder instead. + * + * This approach is used in the scope of integration testing. + */ +fun Project.dependOnBuildSrcJar() { + val srcFolder = this.rootDir.resolve("src") + val buildSrcJar = rootDir.resolve("buildSrc.jar") + if (!srcFolder.exists() && buildSrcJar.exists()) { + logger.info("Adding the pre-compiled 'buildSrc.jar' to 'implementation' dependencies.") + dependencies { + implementation(files("buildSrc.jar")) + } + } +} diff --git a/integration-tests/src/test/kotlin/io/spine/examples/protodata/hello/test/ApplySizeOptionPluginTest.kt b/integration-tests/src/test/kotlin/io/spine/examples/protodata/hello/test/ApplySizeOptionPluginTest.kt index b3ca51b..caf4702 100644 --- a/integration-tests/src/test/kotlin/io/spine/examples/protodata/hello/test/ApplySizeOptionPluginTest.kt +++ b/integration-tests/src/test/kotlin/io/spine/examples/protodata/hello/test/ApplySizeOptionPluginTest.kt @@ -142,8 +142,7 @@ class `ApplySizeOptionPlugin should` { val project = GradleProject.setupAt(projectDir) .fromResources(TEST_PROJECT_DIR) - // `buildSrc` is not copied at all if caching is enabled. - .copyBuildSrc(false) + .copyBuildSrc() .create() val stderr = StringWriter() diff --git a/integration-tests/src/test/resources/test-project/build.gradle.kts b/integration-tests/src/test/resources/test-project/build.gradle.kts index 0964f26..725e0c5 100644 --- a/integration-tests/src/test/resources/test-project/build.gradle.kts +++ b/integration-tests/src/test/resources/test-project/build.gradle.kts @@ -82,13 +82,6 @@ subprojects { api(Spine.base) Protobuf.libs.forEach { implementation(it) } - - // Force versions for compilation/runtime as well. - // - // Maybe, not all of them are required in this scope. - // This is to investigate later. - // - doForceVersions(configurations) } protobuf {