mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Fix the default directories bug.
This commit is contained in:
parent
faf2eeb1d8
commit
2214677d92
4 changed files with 47 additions and 16 deletions
|
@ -4,7 +4,6 @@ import com.beust.kobalt.IncrementalTaskInfo
|
|||
import com.beust.kobalt.KobaltException
|
||||
import com.beust.kobalt.TaskResult
|
||||
import com.beust.kobalt.api.*
|
||||
import com.beust.kobalt.api.annotation.Directive
|
||||
import com.beust.kobalt.api.annotation.ExportedProjectProperty
|
||||
import com.beust.kobalt.api.annotation.IncrementalTask
|
||||
import com.beust.kobalt.api.annotation.Task
|
||||
|
@ -173,11 +172,15 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
throw KobaltException("Couldn't find any compiler for project ${project.name}")
|
||||
} else {
|
||||
compilers.forEach { compiler ->
|
||||
val info = createCompilerActionInfo(project, context, isTest, sourceSuffixes = compiler.sourceSuffixes)
|
||||
val thisResult = compiler.compile(project, context, info)
|
||||
results.add(thisResult)
|
||||
if (! thisResult.success && failedResult == null) {
|
||||
failedResult = thisResult
|
||||
if (containsSourceFiles(project, compiler)) {
|
||||
val info = createCompilerActionInfo(project, context, isTest, sourceSuffixes = compiler.sourceSuffixes)
|
||||
val thisResult = compiler.compile(project, context, info)
|
||||
results.add(thisResult)
|
||||
if (!thisResult.success && failedResult == null) {
|
||||
failedResult = thisResult
|
||||
}
|
||||
} else {
|
||||
log(2, "Compiler $compiler not running on ${project.name} since no source files were found")
|
||||
}
|
||||
}
|
||||
return if (failedResult != null) failedResult!!
|
||||
|
@ -185,6 +188,13 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun containsSourceFiles(project: Project, compiler: ICompilerContributor): Boolean {
|
||||
project.projectExtra.suffixesFound.forEach {
|
||||
if (compiler.sourceSuffixes.contains(it)) return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
val allProjects = arrayListOf<ProjectDescription>()
|
||||
|
||||
override fun projects() = allProjects
|
||||
|
|
|
@ -11,10 +11,6 @@ val javaFirst = project {
|
|||
|
||||
assemble {
|
||||
jar {
|
||||
fatJar = true
|
||||
manifest {
|
||||
attributes("Main-Class", "example.KotlinMainKt")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,10 +24,6 @@ val kotlinFirst = project {
|
|||
|
||||
assemble {
|
||||
jar {
|
||||
fatJar = true
|
||||
manifest {
|
||||
attributes("Main-Class", "example.KotlinMainKt")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,8 +35,20 @@ val mixed1 = project {
|
|||
version = "0.1"
|
||||
directory = name
|
||||
|
||||
dependenciesTest {
|
||||
compile("org.testng:testng:6.9.5")
|
||||
assemble {
|
||||
jar {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val nonStandard = project {
|
||||
name = "nonStandard"
|
||||
group = "com.example"
|
||||
directory = name
|
||||
|
||||
sourceDirectories {
|
||||
path("src/generated/java")
|
||||
}
|
||||
|
||||
assemble {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package example
|
||||
|
||||
class KotlinClass {
|
||||
fun run() {
|
||||
println("KotlinClass run()")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package example;
|
||||
|
||||
public class JavaMain {
|
||||
public static void main(String[] argv) {
|
||||
System.out.println("JavaMain calling into Kotlin");
|
||||
new KotlinClass().run();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue