mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27: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 sourceFiles = findSourceFiles(project.directory, project.sourceDirectories)
|
||||
val buildDir = File(projectDir, project.buildDirectory + File.separator + "classes")
|
||||
.apply { mkdirs() }
|
||||
return javaCompiler.compile(project, context, project.compileDependencies, sourceFiles,
|
||||
buildDir, compilerArgs)
|
||||
}
|
||||
|
||||
@Task(name = TASK_COMPILE_TEST, description = "Compile the tests", runAfter = arrayOf("compile"))
|
||||
fun taskCompileTest(project: Project): TaskResult {
|
||||
copyResources(project, JvmCompilerPlugin.SOURCE_SET_TEST)
|
||||
val sourceFiles = findSourceFiles(project.directory, project.sourceDirectoriesTest)
|
||||
|
||||
val result =
|
||||
if (sourceFiles.size > 0) {
|
||||
copyResources(project, JvmCompilerPlugin.SOURCE_SET_TEST)
|
||||
val buildDir = makeOutputTestDir(project)
|
||||
javaCompiler.compile(project, context, testDependencies(project), sourceFiles,
|
||||
makeOutputTestDir(project), compilerArgs)
|
||||
buildDir, compilerArgs)
|
||||
} else {
|
||||
// No files to compile
|
||||
TaskResult()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue