Compilation fixed
This commit is contained in:
@@ -2,4 +2,4 @@ package kotlin
|
|||||||
|
|
||||||
public class EmptyIterableException(val it : Iterable<*>) : RuntimeException("$it is empty")
|
public class EmptyIterableException(val it : Iterable<*>) : RuntimeException("$it is empty")
|
||||||
|
|
||||||
public class DuplicateKeyException(val message : String = "Duplicate keys detected") : RuntimeException(message)
|
public class DuplicateKeyException(message : String = "Duplicate keys detected") : RuntimeException(message)
|
||||||
+10
-8
@@ -34,7 +34,9 @@ public open class KotlinCompile(): AbstractCompile() {
|
|||||||
|
|
||||||
val srcDirsRoots = HashSet<File>()
|
val srcDirsRoots = HashSet<File>()
|
||||||
val compiler = K2JVMCompiler()
|
val compiler = K2JVMCompiler()
|
||||||
val logger = Logging.getLogger(getClass())
|
|
||||||
|
private val _logger = Logging.getLogger(getClass())
|
||||||
|
override fun getLogger() = _logger
|
||||||
|
|
||||||
public var kotlinOptions: K2JVMCompilerArguments = K2JVMCompilerArguments();
|
public var kotlinOptions: K2JVMCompilerArguments = K2JVMCompilerArguments();
|
||||||
|
|
||||||
@@ -111,7 +113,7 @@ public open class KotlinCompile(): AbstractCompile() {
|
|||||||
|
|
||||||
args.outputDir = if (StringUtils.isEmpty(kotlinOptions.outputDir)) { kotlinDestinationDir?.getPath() } else { kotlinOptions.outputDir }
|
args.outputDir = if (StringUtils.isEmpty(kotlinOptions.outputDir)) { kotlinDestinationDir?.getPath() } else { kotlinOptions.outputDir }
|
||||||
|
|
||||||
val embeddedAnnotations = getAnnotations(getProject(), logger)
|
val embeddedAnnotations = getAnnotations(getProject(), getLogger())
|
||||||
val userAnnotations = (kotlinOptions.annotations ?: "").split(File.pathSeparatorChar).toList()
|
val userAnnotations = (kotlinOptions.annotations ?: "").split(File.pathSeparatorChar).toList()
|
||||||
val allAnnotations = if (kotlinOptions.noJdkAnnotations) userAnnotations else userAnnotations.plus(embeddedAnnotations.map {it.getPath()})
|
val allAnnotations = if (kotlinOptions.noJdkAnnotations) userAnnotations else userAnnotations.plus(embeddedAnnotations.map {it.getPath()})
|
||||||
args.annotations = allAnnotations.makeString(File.pathSeparator)
|
args.annotations = allAnnotations.makeString(File.pathSeparator)
|
||||||
@@ -124,7 +126,7 @@ public open class KotlinCompile(): AbstractCompile() {
|
|||||||
throw GradleException(CompilerArgumentsUtil.getWrongInlineOptionErrorMessage(args.inline))
|
throw GradleException(CompilerArgumentsUtil.getWrongInlineOptionErrorMessage(args.inline))
|
||||||
}
|
}
|
||||||
|
|
||||||
val messageCollector = GradleMessageCollector(logger)
|
val messageCollector = GradleMessageCollector(getLogger())
|
||||||
getLogger().debug("Calling compiler")
|
getLogger().debug("Calling compiler")
|
||||||
val exitCode = compiler.exec(messageCollector, args)
|
val exitCode = compiler.exec(messageCollector, args)
|
||||||
|
|
||||||
@@ -145,8 +147,8 @@ public open class KotlinCompile(): AbstractCompile() {
|
|||||||
|
|
||||||
public open class KDoc(): SourceTask() {
|
public open class KDoc(): SourceTask() {
|
||||||
|
|
||||||
|
private val _logger = Logging.getLogger(getClass())
|
||||||
val logger = Logging.getLogger(getClass())
|
override fun getLogger() = _logger
|
||||||
|
|
||||||
public var kdocArgs: KDocArguments = KDocArguments()
|
public var kdocArgs: KDocArguments = KDocArguments()
|
||||||
|
|
||||||
@@ -179,8 +181,8 @@ public open class KDoc(): SourceTask() {
|
|||||||
// Drop compiled sources to temp. Why KDoc compiles anything after all?!
|
// Drop compiled sources to temp. Why KDoc compiles anything after all?!
|
||||||
args.outputDir = getTemporaryDir()?.getAbsolutePath()
|
args.outputDir = getTemporaryDir()?.getAbsolutePath()
|
||||||
|
|
||||||
logger.warn(args.src)
|
getLogger().warn(args.src)
|
||||||
val embeddedAnnotations = getAnnotations(getProject(), logger)
|
val embeddedAnnotations = getAnnotations(getProject(), getLogger())
|
||||||
val userAnnotations = (kdocArgs.annotations ?: "").split(File.pathSeparatorChar).toList()
|
val userAnnotations = (kdocArgs.annotations ?: "").split(File.pathSeparatorChar).toList()
|
||||||
val allAnnotations = if (kdocArgs.noJdkAnnotations) userAnnotations else userAnnotations.plus(embeddedAnnotations.map {it.getPath()})
|
val allAnnotations = if (kdocArgs.noJdkAnnotations) userAnnotations else userAnnotations.plus(embeddedAnnotations.map {it.getPath()})
|
||||||
args.annotations = allAnnotations.makeString(File.pathSeparator)
|
args.annotations = allAnnotations.makeString(File.pathSeparator)
|
||||||
@@ -191,7 +193,7 @@ public open class KDoc(): SourceTask() {
|
|||||||
|
|
||||||
val compiler = KDocCompiler()
|
val compiler = KDocCompiler()
|
||||||
|
|
||||||
val messageCollector = GradleMessageCollector(logger)
|
val messageCollector = GradleMessageCollector(getLogger())
|
||||||
val exitCode = compiler.exec(messageCollector, args);
|
val exitCode = compiler.exec(messageCollector, args);
|
||||||
|
|
||||||
when (exitCode) {
|
when (exitCode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user