Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress
This commit is contained in:
@@ -41,6 +41,7 @@ fun makeModuleFile(
|
||||
isTest: Boolean,
|
||||
outputDir: File,
|
||||
sourcesToCompile: Iterable<File>,
|
||||
commonSources: Iterable<File>,
|
||||
javaSourceRoots: Iterable<JvmSourceRoot>,
|
||||
classpath: Iterable<File>,
|
||||
friendDirs: Iterable<File>
|
||||
@@ -55,6 +56,7 @@ fun makeModuleFile(
|
||||
sourcesToCompile.map { it.absoluteFile },
|
||||
javaSourceRoots,
|
||||
classpath,
|
||||
commonSources.map { it.absoluteFile },
|
||||
null,
|
||||
"java-production",
|
||||
isTest,
|
||||
|
||||
@@ -34,16 +34,18 @@ class KotlinModuleXmlBuilder {
|
||||
}
|
||||
|
||||
fun addModule(
|
||||
moduleName: String,
|
||||
outputDir: String,
|
||||
sourceFiles: Iterable<File>,
|
||||
javaSourceRoots: Iterable<JvmSourceRoot>,
|
||||
classpathRoots: Iterable<File>,
|
||||
modularJdkRoot: File?,
|
||||
targetTypeId: String,
|
||||
isTests: Boolean,
|
||||
directoriesToFilterOut: Set<File>,
|
||||
friendDirs: Iterable<File>): KotlinModuleXmlBuilder {
|
||||
moduleName: String,
|
||||
outputDir: String,
|
||||
sourceFiles: Iterable<File>,
|
||||
javaSourceRoots: Iterable<JvmSourceRoot>,
|
||||
classpathRoots: Iterable<File>,
|
||||
commonSourceFiles: Iterable<File>,
|
||||
modularJdkRoot: File?,
|
||||
targetTypeId: String,
|
||||
isTests: Boolean,
|
||||
directoriesToFilterOut: Set<File>,
|
||||
friendDirs: Iterable<File>
|
||||
): KotlinModuleXmlBuilder {
|
||||
assert(!done) { "Already done" }
|
||||
|
||||
p.println("<!-- Module script for ${if (isTests) "tests" else "production"} -->")
|
||||
@@ -62,6 +64,10 @@ class KotlinModuleXmlBuilder {
|
||||
p.println("<", SOURCES, " ", PATH, "=\"", getEscapedPath(sourceFile), "\"/>")
|
||||
}
|
||||
|
||||
for (commonSourceFile in commonSourceFiles) {
|
||||
p.println("<", COMMON_SOURCES, " ", PATH, "=\"", getEscapedPath(commonSourceFile), "\"/>")
|
||||
}
|
||||
|
||||
processJavaSourceRoots(javaSourceRoots)
|
||||
processClasspath(classpathRoots, directoriesToFilterOut)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user