Skip to content

Commit d6e10d6

Browse files
CristianGMSpace Team
authored andcommitted
Move SystemPropertyClasspathProvider to utilities
1 parent b7644dd commit d6e10d6

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

plugins/plugins-interactions-testing/build.gradle.kts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,3 @@ projectTests {
6666

6767
withJvmStdlibAndReflect()
6868
}
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-
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
}

0 commit comments

Comments
 (0)