1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Put the javac command in a file.

Also introduce fixSlashes().
This commit is contained in:
Cedric Beust 2017-03-24 23:42:41 -07:00
parent 771f90332c
commit 4e4c5a7d9e
5 changed files with 15 additions and 8 deletions

View file

@ -7,6 +7,7 @@ import com.beust.kobalt.internal.JvmCompilerPlugin
import com.beust.kobalt.internal.KobaltPluginXml
import com.beust.kobalt.internal.PluginInfo
import com.beust.kobalt.internal.build.BuildFile
import com.beust.kobalt.misc.KFiles
import com.beust.kobalt.misc.log
import org.testng.annotations.BeforeClass
import java.io.File
@ -27,7 +28,7 @@ open class BaseTest(val compilerFactory: BuildFileCompiler.IFactory? = null) {
*/
fun compileSingleProject(projectText: String, args: Args = Args()) : Project {
val projectName = "p" + Math.abs(Random().nextInt())
val projectDirectory = Files.createTempDirectory("kobaltTest").toFile().path.replace("\\", "/")
val projectDirectory = KFiles.fixSlashes(Files.createTempDirectory("kobaltTest").toFile())
val buildFileText= """
import com.beust.kobalt.*
import com.beust.kobalt.api.*
@ -87,7 +88,6 @@ open class BaseTest(val compilerFactory: BuildFileCompiler.IFactory? = null) {
forceRecompile = true)
}
fun createTemporaryProjectDirectory() = Files.createTempDirectory("kobaltTest").toFile().path
.replace("\\", "/")
fun createTemporaryProjectDirectory() = KFiles.fixSlashes(Files.createTempDirectory("kobaltTest").toFile())
}