Partial compilation of package (only functions supported).
Original commit: d62bc07437
This commit is contained in:
@@ -191,6 +191,10 @@ public class KotlinBuilder extends ModuleLevelBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (SimpleOutputItem outputItem : outputItemCollector.getOutputs()) {
|
for (SimpleOutputItem outputItem : outputItemCollector.getOutputs()) {
|
||||||
|
// TODO this is a hack: we don't remove
|
||||||
|
if (outputItem.getOutputFile().getName().endsWith("Package.class")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
BuildTarget<?> target = null;
|
BuildTarget<?> target = null;
|
||||||
Collection<File> sourceFiles = outputItem.getSourceFiles();
|
Collection<File> sourceFiles = outputItem.getSourceFiles();
|
||||||
if (sourceFiles != null && !sourceFiles.isEmpty()) {
|
if (sourceFiles != null && !sourceFiles.isEmpty()) {
|
||||||
@@ -200,7 +204,8 @@ public class KotlinBuilder extends ModuleLevelBuilder {
|
|||||||
messageCollector.report(EXCEPTION, "KotlinBuilder: outputItem.sourceFiles is null or empty, outputItem = " + outputItem, NO_LOCATION);
|
messageCollector.report(EXCEPTION, "KotlinBuilder: outputItem.sourceFiles is null or empty, outputItem = " + outputItem, NO_LOCATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
outputConsumer.registerOutputFile(target != null ? target : representativeTarget, outputItem.getOutputFile(), paths(sourceFiles));
|
outputConsumer.registerOutputFile(target != null ? target : representativeTarget, outputItem.getOutputFile(),
|
||||||
|
paths(sourceFiles));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO should mark dependencies as dirty, as well
|
// TODO should mark dependencies as dirty, as well
|
||||||
|
|||||||
@@ -98,6 +98,10 @@ public class IncrementalJpsTest : JpsBuildTestCase() {
|
|||||||
doTest()
|
doTest()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun testTopLevelMembersInTwoPackages() {
|
||||||
|
doTest()
|
||||||
|
}
|
||||||
|
|
||||||
private class MyLogger(val rootPath: String) : ProjectBuilderLoggerBase() {
|
private class MyLogger(val rootPath: String) : ProjectBuilderLoggerBase() {
|
||||||
private val logBuf = StringBuilder()
|
private val logBuf = StringBuilder()
|
||||||
public val log: String
|
public val log: String
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
bar(5)
|
||||||
|
baz()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun baz() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
bar(4)
|
||||||
|
baz()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun baz() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun bar(i: Int): String {
|
||||||
|
return "$i ${quux()} $i"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun quux(): String {
|
||||||
|
return "quux"
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/test/TestPackage-a-*.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/test/TestPackage-b-*.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/b.kt
|
||||||
|
End of files
|
||||||
Reference in New Issue
Block a user