-
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathFlankJavaExec.kt
More file actions
27 lines (23 loc) · 899 Bytes
/
FlankJavaExec.kt
File metadata and controls
27 lines (23 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.osacky.flank.gradle
import org.gradle.api.file.ProjectLayout
import org.gradle.api.tasks.JavaExec
import org.gradle.work.DisableCachingByDefault
import javax.inject.Inject
@DisableCachingByDefault(
because = "Flank executions are dependent on resources such as network connection and server and therefore cannot be cached.",
)
abstract class FlankJavaExec
@Inject
constructor(
projectLayout: ProjectLayout,
) : JavaExec() {
// Store only the build directory Provider, not the whole ProjectLayout
// (ProjectLayout may hold a Project reference which is not CC-serializable)
private val buildDir = projectLayout.buildDirectory
init {
group = FladlePluginDelegate.TASK_GROUP
mainClass.set("ftl.Main")
workingDir(projectLayout.fladleDir)
}
fun setUpWorkingDir(configName: String) = workingDir(buildDir.dir("fladle/$configName"))
}