File tree Expand file tree Collapse file tree 2 files changed +35
-22
lines changed
plugins/plugins-interactions-testing
repo/gradle-build-conventions/utilities/src/main/kotlin Expand file tree Collapse file tree 2 files changed +35
-22
lines changed Original file line number Diff line number Diff line change @@ -66,25 +66,3 @@ projectTests {
66
66
67
67
withJvmStdlibAndReflect()
68
68
}
69
-
70
- fun Test.addClasspathProperty (configuration : Configuration , property : String ) {
71
- val classpathProvider = objects.newInstance<SystemPropertyClasspathProvider >()
72
- classpathProvider.classpath.from(configuration)
73
- classpathProvider.property.set(property)
74
- jvmArgumentProviders.add(classpathProvider)
75
- }
76
-
77
- abstract class SystemPropertyClasspathProvider : CommandLineArgumentProvider {
78
- @get:InputFiles
79
- @get:Classpath
80
- abstract val classpath: ConfigurableFileCollection
81
-
82
- @get:Input
83
- abstract val property: Property <String >
84
-
85
- override fun asArguments (): Iterable <String > {
86
- return listOf (
87
- " -D${property.get()} =${classpath.asPath} "
88
- )
89
- }
90
- }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
3
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
4
+ */
5
+
6
+ import org.gradle.api.artifacts.Configuration
7
+ import org.gradle.api.file.ConfigurableFileCollection
8
+ import org.gradle.api.provider.Property
9
+ import org.gradle.api.tasks.Classpath
10
+ import org.gradle.api.tasks.Input
11
+ import org.gradle.api.tasks.InputFiles
12
+ import org.gradle.api.tasks.testing.Test
13
+ import org.gradle.process.CommandLineArgumentProvider
14
+
15
+ abstract class SystemPropertyClasspathProvider : CommandLineArgumentProvider {
16
+ @get:InputFiles
17
+ @get:Classpath
18
+ abstract val classpath: ConfigurableFileCollection
19
+
20
+ @get:Input
21
+ abstract val property: Property <String >
22
+
23
+ override fun asArguments (): Iterable <String > {
24
+ return listOf (
25
+ " -D${property.get()} =${classpath.asPath} "
26
+ )
27
+ }
28
+ }
29
+
30
+ fun Test.addClasspathProperty (configuration : Configuration , property : String ) {
31
+ val classpathProvider = project.objects.newInstance(SystemPropertyClasspathProvider ::class .java)
32
+ classpathProvider.classpath.from(configuration)
33
+ classpathProvider.property.set(property)
34
+ jvmArgumentProviders.add(classpathProvider)
35
+ }
You can’t perform that action at this time.
0 commit comments