Skip to content

Commit

Permalink
feat: configure ecj to use .settings/org.eclipse.jdt.core.prefs
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Sep 10, 2024
1 parent ba5a061 commit fdf6fb4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]


### Change
- configure ecj to use .settings/org.eclipse.jdt.core.prefs when present


## [6.0.0] - 2024-09-10

### Fix
Expand Down
14 changes: 13 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
setProjectProp("maven.javadoc.skip", "true");
}
/*
* loading/locating eclipse Java compiler artifact
*/
Expand All @@ -298,6 +299,16 @@
setProjectProp("custom.ecjJarPath", ecjArtifact.file.absolutePath);
/*
* check if .settings/org.eclipse.jdt.core.prefs is present
*/
jdtCorePrefsFile = new File(project.basedir, ".settings/org.eclipse.jdt.core.prefs");
if(jdtCorePrefsFile.exists()) {
setProjectProp("custom.ecjProperties", "-properties \"" + jdtCorePrefsFile + "\"");
} else {
setProjectProp("custom.ecjProperties", "-g"); /* using -g just as placeholder to prevent "Unrecognized option : ''"*/
}
/*
* determine bootclasspath for compilation of src/main/java
*/
Expand Down Expand Up @@ -347,7 +358,6 @@
} else {
setProjectProp("custom.noJavaTests", "true");
}
} else /* if(!isJavaCompilable)*/ {
setProjectProp("custom.noJavaTests", "true");
setProjectProp("maven.javadoc.skip", "true");
Expand Down Expand Up @@ -923,6 +933,7 @@
${custom.compileBootClasspathOption} "${custom.compileBootClasspath}"
-encoding ${project.build.sourceEncoding}
-g<!-- include debug info -->
${custom.ecjProperties}<!--load org.eclipse.jdt.core.prefs-->
-parameters<!-- generate method parameters attribute
TODO enabling this option breaks
1) maven-bundle-plugin with "java.lang.IllegalArgumentException: invalid signature: *"
Expand Down Expand Up @@ -954,6 +965,7 @@
${custom.compileBootClasspathOption} "${custom.compileBootClasspath}"
-encoding ${project.build.sourceEncoding}
-g<!-- include debug info -->
${custom.ecjProperties}<!--load org.eclipse.jdt.core.prefs-->
-parameters<!-- generate method parameters attribute -->
-genericsignature<!-- generate generic signature for lambda expressions -->
-maxProblems 10<!-- max. number of problems per compilation unit -->
Expand Down

0 comments on commit fdf6fb4

Please sign in to comment.