3
3
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4
4
*/
5
5
6
- import org.gradle.api.JavaVersion
7
6
import org.gradle.api.Project
8
7
import org.gradle.api.Task
9
8
import org.gradle.api.artifacts.dsl.DependencyHandler
@@ -14,20 +13,14 @@ import org.gradle.api.tasks.TaskContainer
14
13
import org.gradle.api.tasks.TaskProvider
15
14
import org.gradle.api.tasks.bundling.Jar
16
15
import org.gradle.api.tasks.testing.Test
17
- import org.gradle.jvm.toolchain.JavaLanguageVersion
18
- import org.gradle.jvm.toolchain.JavaToolchainService
19
16
import org.gradle.kotlin.dsl.dependencies
20
17
import org.gradle.kotlin.dsl.register
21
18
import org.gradle.kotlin.dsl.withType
22
- import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
23
- import java.io.File
24
19
25
20
inline fun <reified T > Project.configureIfExists (fn : T .() -> Unit ) {
26
21
extensions.findByType(T ::class .java)?.fn()
27
22
}
28
23
29
- val isWindows = DefaultNativePlatform .getCurrentOperatingSystem().isWindows
30
-
31
24
fun Project.configureAllTests (fn : Test .() -> Unit = {}) {
32
25
fun DependencyHandler.testImplementation (notation : Any ) =
33
26
add(JavaPlugin .TEST_IMPLEMENTATION_CONFIGURATION_NAME , notation)
@@ -47,12 +40,6 @@ fun Project.configureAllTests(fn: Test.() -> Unit = {}) {
47
40
}
48
41
}
49
42
50
- fun Test.systemProperties (map : Map <String , Any >) {
51
- for ((k, v) in map) {
52
- systemProperty(k, v)
53
- }
54
- }
55
-
56
43
fun TaskProvider <* >.dependsOn (vararg dependencies : Any ) {
57
44
configure {
58
45
dependsOn(dependencies)
@@ -71,4 +58,4 @@ inline fun <reified T : Task> TaskContainer.registerVerificationTask(
71
58
}
72
59
73
60
val Provider <out Jar >.archiveFile: Provider <RegularFile >
74
- get() = flatMap { it.archiveFile }
61
+ get() = flatMap { it.archiveFile }
0 commit comments