Skip to content

Commit

Permalink
dbeaver/dbeaver-infra#178 use language level (#33)
Browse files Browse the repository at this point in the history
* dbeaver/dbeaver-infra#178 add language level from manifest

* dbeaver/dbeaver-infra#178 fix build
  • Loading branch information
Destrolaric authored Dec 10, 2024
1 parent 335c118 commit 81a9d3b
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@


public class IMLConfigurationProducer implements IImportListener {
public static final Logger log = LoggerFactory.getLogger(IMLConfigurationProducer.class);

public static final IMLConfigurationProducer INSTANCE = new IMLConfigurationProducer();
public static final String TEST_FOLDER = "src/test/java";

private static final Logger log = LoggerFactory.getLogger(IMLConfigurationProducer.class);
private static final String TEST_FOLDER = "src/test/java";

private static final Map<String, String> eclipseToIdeaJavaMappings = Map.of(
"JavaSE-11", "JDK_11",
"JavaSE-17", "JDK_17",
"JavaSE-8", "JDK_8"
);
private final Map<Pair<String, VersionRange>, Set<Pair<BundleInfo, Version>>> bundlePackageImports = new ConcurrentHashMap<>();

private final Set<String> generatedLibraries = new LinkedHashSet<>();
Expand Down Expand Up @@ -460,7 +467,15 @@ private String generateIMLBundleConfig(@NotNull BundleInfo bundleInfo, @NotNull
}
StringBuilder builder = new StringBuilder();
builder.append("<module type=\"JAVA_MODULE\" version=\"4\">\n");
builder.append(" <component name=\"NewModuleRootManager\">\n");
String requiredJava = null;
if (bundleInfo.getRequiredJava() != null) {
requiredJava = eclipseToIdeaJavaMappings.get(bundleInfo.getRequiredJava());
}
builder.append(" <component name=\"NewModuleRootManager\"");
if (requiredJava != null) {
builder.append(" LANGUAGE_LEVEL=\"").append(requiredJava).append("\"");
}
builder.append(">\n");
Properties properties = readBuildConfiguration(bundleInfo.getPath());
List<String> outputs = properties.get("output..") != null ? List.of(((String) properties.get("output..")).split(",")) : List.of();
if (!outputs.isEmpty()) {
Expand Down

0 comments on commit 81a9d3b

Please sign in to comment.