Pass path to java source file as-is
Since Kotlin 1.7.0 plugin is tracking each java file individually in task, rather than java SourceSet root directories. Such approach removes requirement to pass them via `-Xjava-source-roots` compiler argument. ^KT-53390 Fixed
This commit is contained in:
-2
@@ -80,7 +80,6 @@ internal open class GradleCompilerRunner(
|
||||
fun runJvmCompilerAsync(
|
||||
sourcesToCompile: List<File>,
|
||||
commonSources: List<File>,
|
||||
javaSourceRoots: Iterable<File>,
|
||||
javaPackagePrefix: String?,
|
||||
args: K2JVMCompilerArguments,
|
||||
environment: GradleCompilerEnvironment,
|
||||
@@ -89,7 +88,6 @@ internal open class GradleCompilerRunner(
|
||||
): WorkQueue? {
|
||||
args.freeArgs += sourcesToCompile.map { it.absolutePath }
|
||||
args.commonSources = commonSources.map { it.absolutePath }.toTypedArray()
|
||||
args.javaSourceRoots = javaSourceRoots.map { it.absolutePath }.toTypedArray()
|
||||
args.javaPackagePrefix = javaPackagePrefix
|
||||
if (args.jdkHome == null && !args.noJdk) args.jdkHome = jdkHome.absolutePath
|
||||
loggerProvider.kotlinInfo("Kotlin compilation 'jdkHome' argument: ${args.jdkHome}")
|
||||
|
||||
+1
-2
@@ -122,9 +122,8 @@ abstract class KaptWithKotlincTask @Inject constructor(
|
||||
metrics.get(),
|
||||
)
|
||||
compilerRunner.runJvmCompilerAsync(
|
||||
sourcesToCompile = emptyList(),
|
||||
sourcesToCompile = source.files.toList(),
|
||||
commonSources = emptyList(),
|
||||
javaSourceRoots = source.files,
|
||||
javaPackagePrefix = javaPackagePrefix.orNull,
|
||||
args = args,
|
||||
environment = environment,
|
||||
|
||||
+1
-2
@@ -723,9 +723,8 @@ abstract class KotlinCompile @Inject constructor(
|
||||
logger.info("Script source files: ${scriptSources.joinToString()}")
|
||||
logger.info("Script file extensions: ${scriptExtensions.get().joinToString()}")
|
||||
compilerRunner.runJvmCompilerAsync(
|
||||
(kotlinSources + scriptSources).toList(),
|
||||
(kotlinSources + scriptSources + javaSources.files).toList(),
|
||||
commonSourceSet.toList(),
|
||||
javaSources.files, // we need here only directories where Java sources are located
|
||||
javaPackagePrefix,
|
||||
args,
|
||||
environment,
|
||||
|
||||
Reference in New Issue
Block a user