New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add common lombok config #44
Conversation
7ccd96b
to
7141308
Compare
powsybl-build-tools/src/main/resources/powsybl-build-tools/lombok.config
Outdated
Show resolved
Hide resolved
powsybl-build-tools/src/main/resources/powsybl-build-tools/lombok.config
Outdated
Show resolved
Hide resolved
powsybl-build-tools/src/main/resources/powsybl-build-tools/lombok.config
Outdated
Show resolved
Hide resolved
Due to limitation in Maven profiles activation system, like in #2, we use a system of file markers to activate a profile from child projects. Another note is during my tests, it seems we can't have multiple conditions like PR description updated |
@jonenst I found this other method to copy/extract only the <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>lombok-unpack-config</id>
<phase>initialize</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-build-tools</artifactId>
<version>${powsybl-build-tools.version}</version>
<type>jar</type>
<outputDirectory>${project.build.directory}/configs</outputDirectory>
<includes>powsybl-build-tools/lombok.config</includes>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin> |
68b6c83
to
ce24afa
Compare
powsybl-parent/pom.xml
Outdated
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<showWarnings>true</showWarnings><!--show lombok warning during compile--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate PR
843d4c1
to
8bc6017
Compare
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Because of limitation of Maven profiles activation, we decides to switch to files marker instead of property. Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Please check if the PR fulfills these requirements
Tests for the changes have been added (for bug fixes / features)Does this PR already have an issue describing the problem?
No.
What kind of change does this PR introduce?
Add a profile (inactive by default) to be use by children projects by activating the correct profile.
It consist of:
/lombok.config
to be reuse by childrenWhat is the current behavior?
Each projects have their own
lombok.config
with duplication and often incomplete.What is the new behavior (if this is a feature change)?
Each children project can have a common base and update can be centralized.
Does this PR introduce a breaking change or deprecate an API?
No.
Other information:
The idea is to use lombok's
import
feature to have a common base for GridSuite projects.Projects that want to use this project will need to:
-Plombok-config-copy
and-Plombok-config-check
.mvn/lombok-config-copy
in the project to activate the copy of the file to be used.mvn/lombok-config-check
in the project to activate the check thatlombok.config
contains the import/lombok.config
This profiles will, when activate:
initialize
phase: copy the powsybl-build-tools jar intarget/configs/
(to be found and use by lombok)validate
phase: check that thelombok.config
file have the correct import at the start of the fileThis has been tested with Maven, JetBrains IDEA IntelliJ and Eclipse (with m2e + lombok plugin).
The
initialize
has been use because of its early position in (Maven lifecycle)[https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html], as IDEs seems to run this phase when reloading/refreshing the project and we need the jar to be present for IDE to parse the configuration (when editing files).Side note:
No better way found, mainly because of limitation in the way lombok manage internally the import path (ConfigurationFile and FileSystemSourceCache).
And that will not change in near future.