Skip to content

Commit

Permalink
Apply Lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
lmu committed Jul 22, 2022
1 parent 753c774 commit 1c96d30
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 23 deletions.
22 changes: 20 additions & 2 deletions IvyLombokExample/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>ivy.lombok.example</groupId>
<artifactId>ivy-lombok-example</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>iar</packaging>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.18</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>9.3.1</version>
<extensions>true</extensions>

<configuration>
<compilerOptions>
<compilerOption>-proc:none</compilerOption>
<!-- <compilerOption>-XprintProcessorInfo</compilerOption> <compilerOption>-XprintRounds</compilerOption> -->
<!-- Lombok annotationProcessing can't work with Eclipse JDT compiler https://github.com/projectlombok/lombok/blob/master/src/core/lombok/core/AnnotationProcessor.java#L199 -->
</compilerOptions>
</configuration>

</plugin>
</plugins>
</build>
Expand Down
16 changes: 16 additions & 0 deletions IvyLombokExample/src/ivy/lombok/example/User.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ivy.lombok.example;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Builder(toBuilder = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class User {
private String name;
private String email;
}
12 changes: 10 additions & 2 deletions IvyLombokExampleTest/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>ivy.lombok.example</groupId>
<artifactId>ivy-lombok-example-test</artifactId>
Expand Down Expand Up @@ -28,6 +27,15 @@
<artifactId>project-build-plugin</artifactId>
<version>9.3.1</version>
<extensions>true</extensions>

<configuration>
<compilerOptions>
<compilerOption>-proc:none</compilerOption>
<!-- <compilerOption>-XprintProcessorInfo</compilerOption> <compilerOption>-XprintRounds</compilerOption> -->
<!-- Lombok annotationProcessing can't work with Eclipse JDT compiler https://github.com/projectlombok/lombok/blob/master/src/core/lombok/core/AnnotationProcessor.java#L199 -->
</compilerOptions>
</configuration>

</plugin>
</plugins>
</build>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package ivy.lombok.example.test;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

import ch.ivyteam.ivy.environment.IvyTest;
import ivy.lombok.example.User;

@IvyTest
public class UserTest{

@Test
public void user(){
var user = User.builder()
.name("Trudy")
.email("[email protected]")
.build();
assertThat(user.getName()).isEqualTo("Trudy");
assertThat(user.getEmail()).isEqualTo("[email protected]");
}

}

0 comments on commit 1c96d30

Please sign in to comment.