aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/qbs/modules/java/io/qt/qbs/tools/utils/JavaCompilerScanner.java13
-rw-r--r--share/qbs/modules/java/utils.js4
-rw-r--r--tests/auto/blackbox/testdata-java/java/inner-class/InnerClass.java6
-rw-r--r--tests/auto/blackbox/testdata-java/java/inner-class/inner-class.qbs5
-rw-r--r--tests/auto/blackbox/tst_blackboxjava.cpp10
-rw-r--r--tests/auto/blackbox/tst_blackboxjava.h1
6 files changed, 35 insertions, 4 deletions
diff --git a/share/qbs/modules/java/io/qt/qbs/tools/utils/JavaCompilerScanner.java b/share/qbs/modules/java/io/qt/qbs/tools/utils/JavaCompilerScanner.java
index 368f5519e..1be804ee5 100644
--- a/share/qbs/modules/java/io/qt/qbs/tools/utils/JavaCompilerScanner.java
+++ b/share/qbs/modules/java/io/qt/qbs/tools/utils/JavaCompilerScanner.java
@@ -156,11 +156,18 @@ public class JavaCompilerScanner {
Collections.sort(parsedOutputFilePathsArray);
ArrayList<String> compilationOutputFilePathsArray = new ArrayList<String>(compilationOutputFilePaths);
Collections.sort(compilationOutputFilePathsArray);
+ compilationOutputFilePaths.removeAll(parsedOutputFilePaths);
+ ArrayList<String> differenceArray = new ArrayList<String>(compilationOutputFilePaths);
+ Collections.sort(differenceArray);
- throw new RuntimeException("The set of output files determined by source code parsing:\n\n"
+ System.err.println("The set of output files determined by source code parsing:\n\n"
+ join("\n", parsedOutputFilePathsArray) + "\n\n"
- + "is missing some files that would be produced by the compiler:\n\n"
- + join("\n", compilationOutputFilePathsArray) + "\n");
+ + "is missing some files from the list that would be produced by the compiler:\n\n"
+ + join("\n", compilationOutputFilePathsArray) + "\n\n"
+ + "The missing files are:\n\n"
+ + join("\n", differenceArray) + "\n\n"
+ + "Compilation will still continue, though a build error *might* appear later;\n"
+ + "please check the bug report at https://bugreports.qt.io/browse/QBS-1069\n");
}
return !parsedOutputFilePaths.isEmpty() ? 0 : 1;
diff --git a/share/qbs/modules/java/utils.js b/share/qbs/modules/java/utils.js
index 7e3679a5e..632fc8102 100644
--- a/share/qbs/modules/java/utils.js
+++ b/share/qbs/modules/java/utils.js
@@ -303,7 +303,9 @@ function outputArtifacts(product, inputs) {
];
process.exec(ModUtils.moduleProperty(product, "interpreterFilePath"), javaArgs
.concat(javacArguments(product, inputs, helperOverrideArgs(product))), true);
- return JSON.parse(process.readStdOut());
+ var out = JSON.parse(process.readStdOut());
+ console.error(process.readStdErr());
+ return out;
} finally {
if (process)
process.close();
diff --git a/tests/auto/blackbox/testdata-java/java/inner-class/InnerClass.java b/tests/auto/blackbox/testdata-java/java/inner-class/InnerClass.java
new file mode 100644
index 000000000..3e0333ecb
--- /dev/null
+++ b/tests/auto/blackbox/testdata-java/java/inner-class/InnerClass.java
@@ -0,0 +1,6 @@
+public class InnerClass {
+ private final InnerInnerClass clazz = new InnerInnerClass();
+
+ private class InnerInnerClass {
+ }
+}
diff --git a/tests/auto/blackbox/testdata-java/java/inner-class/inner-class.qbs b/tests/auto/blackbox/testdata-java/java/inner-class/inner-class.qbs
new file mode 100644
index 000000000..5bc861f5d
--- /dev/null
+++ b/tests/auto/blackbox/testdata-java/java/inner-class/inner-class.qbs
@@ -0,0 +1,5 @@
+import qbs
+
+JavaJarFile {
+ files: ["**/*.java"]
+}
diff --git a/tests/auto/blackbox/tst_blackboxjava.cpp b/tests/auto/blackbox/tst_blackboxjava.cpp
index ba00de997..87cb92436 100644
--- a/tests/auto/blackbox/tst_blackboxjava.cpp
+++ b/tests/auto/blackbox/tst_blackboxjava.cpp
@@ -288,4 +288,14 @@ void TestBlackboxJava::javaDependencyTracking()
QSKIP("No JDKs installed");
}
+void TestBlackboxJava::javaDependencyTrackingInnerClass()
+{
+ QDir::setCurrent(testDataDir + "/java/inner-class");
+ QbsRunParameters params;
+ params.expectFailure = true;
+ QCOMPARE(runQbs(params), 0);
+ QEXPECT_FAIL(0, "QBS-1069", Abort);
+ QVERIFY(!m_qbsStderr.contains("QBS-1069"));
+}
+
QTEST_MAIN(TestBlackboxJava)
diff --git a/tests/auto/blackbox/tst_blackboxjava.h b/tests/auto/blackbox/tst_blackboxjava.h
index 124c992a6..40f1b1636 100644
--- a/tests/auto/blackbox/tst_blackboxjava.h
+++ b/tests/auto/blackbox/tst_blackboxjava.h
@@ -43,6 +43,7 @@ private slots:
void android_data();
void java();
void javaDependencyTracking();
+ void javaDependencyTrackingInnerClass();
private:
QMap<QString, QString> findAndroid(int *status);