Debugging broken build

This commit is contained in:
BoykoAlex
2018-11-07 18:10:04 -05:00
parent e3901c1435
commit 28793153e1
2 changed files with 11 additions and 12 deletions

View File

@@ -11,7 +11,6 @@
package org.springframework.ide.vscode.commons.java;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -42,21 +41,10 @@ public class BootProjectUtil {
public static Path javaHomeFromLibJar(Path libJar) {
for (Path home = libJar; home.getParent() != null; home = home.getParent()) {
System.out.println("Trying Java home folder: " + home);
if (Files.isDirectory(home)) {
System.out.println("Folder contents: ");
try {
Files.list(home).forEach(System.out::println);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Path bin = home.resolve("bin");
Path lib = home.resolve("lib");
Path include = home.resolve("include");
Path man = home.resolve("man");
if (Files.isDirectory(bin) && Files.isDirectory(lib) && Files.isDirectory(include) && Files.isDirectory(man)) {
return home;
}
@@ -69,10 +57,12 @@ public class BootProjectUtil {
if (home != null) {
Path sources = home.resolve("src.zip");
if (Files.exists(sources)) {
System.out.println("Found " + sources);
return sources;
}
sources = home.resolve("lib/src.zip");
if (Files.exists(sources)) {
System.out.println("Found " + sources);
return sources;
}
}

View File

@@ -67,6 +67,9 @@ public class JavaIndexTest {
.collectSortedList((o1, o2) -> o2.getT2().compareTo(o1.getT2()))
.block();
assertTrue(results.size() > 10);
results.forEach(res -> {
System.out.println("Found type: " + res.getT1());
});
IType type = results.get(0).getT1();
System.out.println(type.getFullyQualifiedName() + ": " + type.getBindingKey());
assertEquals("java.util.Map", type.getFullyQualifiedName());
@@ -80,6 +83,9 @@ public class JavaIndexTest {
.collectSortedList((o1, o2) -> o2.getT2().compareTo(o1.getT2()))
.block();
assertTrue(results.size() > 10);
results.forEach(res -> {
System.out.println("Found type: " + res.getT1());
});
IType type = results.get(0).getT1();
System.out.println(type.getFullyQualifiedName() + ": " + type.getBindingKey());
assertEquals("java.util.EnumMap$KeySet", type.getFullyQualifiedName());
@@ -93,6 +99,9 @@ public class JavaIndexTest {
.collectSortedList((o1, o2) -> o2.getT2().compareTo(o1.getT2()))
.block();
assertTrue(results.size() > 10);
results.forEach(res -> {
System.out.println("Found result: " + res.getT1());
});
assertEquals("java.util", results.get(0).getT1());
}