mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Refactor.
This commit is contained in:
parent
894a63e7cf
commit
3bd81d7f90
1 changed files with 4 additions and 3 deletions
|
@ -70,19 +70,20 @@ public class JavaPlugin @Inject constructor(
|
||||||
val projectDir = File(project.directory)
|
val projectDir = File(project.directory)
|
||||||
val sourceFiles = findSourceFiles(project.directory, project.sourceDirectories)
|
val sourceFiles = findSourceFiles(project.directory, project.sourceDirectories)
|
||||||
val buildDir = File(projectDir, project.buildDirectory + File.separator + "classes")
|
val buildDir = File(projectDir, project.buildDirectory + File.separator + "classes")
|
||||||
|
.apply { mkdirs() }
|
||||||
return javaCompiler.compile(project, context, project.compileDependencies, sourceFiles,
|
return javaCompiler.compile(project, context, project.compileDependencies, sourceFiles,
|
||||||
buildDir, compilerArgs)
|
buildDir, compilerArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Task(name = TASK_COMPILE_TEST, description = "Compile the tests", runAfter = arrayOf("compile"))
|
@Task(name = TASK_COMPILE_TEST, description = "Compile the tests", runAfter = arrayOf("compile"))
|
||||||
fun taskCompileTest(project: Project): TaskResult {
|
fun taskCompileTest(project: Project): TaskResult {
|
||||||
copyResources(project, JvmCompilerPlugin.SOURCE_SET_TEST)
|
|
||||||
val sourceFiles = findSourceFiles(project.directory, project.sourceDirectoriesTest)
|
val sourceFiles = findSourceFiles(project.directory, project.sourceDirectoriesTest)
|
||||||
|
|
||||||
val result =
|
val result =
|
||||||
if (sourceFiles.size > 0) {
|
if (sourceFiles.size > 0) {
|
||||||
|
copyResources(project, JvmCompilerPlugin.SOURCE_SET_TEST)
|
||||||
|
val buildDir = makeOutputTestDir(project)
|
||||||
javaCompiler.compile(project, context, testDependencies(project), sourceFiles,
|
javaCompiler.compile(project, context, testDependencies(project), sourceFiles,
|
||||||
makeOutputTestDir(project), compilerArgs)
|
buildDir, compilerArgs)
|
||||||
} else {
|
} else {
|
||||||
// No files to compile
|
// No files to compile
|
||||||
TaskResult()
|
TaskResult()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue