All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.psxpaul.task.JavaExecFork.kt Maven / Gradle / Ivy

There is a newer version: 0.1.4
Show newest version
package com.github.psxpaul.task

import org.gradle.api.file.FileCollection
import org.gradle.internal.jvm.Jvm

open class JavaExecFork : AbstractExecFork() {
    var classpath: FileCollection? = null
    var main:String? = null
    var jvmArgs:List = listOf()

    override fun getProcessArgs(): List? {
        val processArgs:MutableList = mutableListOf()
        processArgs.add(Jvm.current().javaExecutable.absoluteFile.absolutePath)
        processArgs.add("-cp")
        processArgs.add(classpath!!.asPath)
        processArgs.addAll(jvmArgs.map { s -> if (s.startsWith("-D")) return@map s else "-D" + s })
        processArgs.add(main!!)
        processArgs.addAll(args)
        return processArgs
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy