steffenschaefer/gwt-gradle-plugin

gwt + gradle + lombok issues resolved

Opened this issue · 0 comments

A known problem (from reading this list), I found a refinement to the solution proposed.
The issue is if you are resolving lombok.jar you cant just use -javaagent:lombok.jar=ECJ
You need the full path

This works ... maybe it can be built into gwt-gradle-plugin ?


configurations { 
 lombok
}
dependencies {
  lombok 'org.projectlombok:lombok+'
} 
ext {
   lombok = configurations.lombok.asPath
}

compileGwt {
  jvmArgs "-javaagent:${lombok}=ECJ"
}

draftCompileGwt {
  jvmArgs "-javaagent:${lombok}=ECJ"
}

One Caveot -- you cannot use some class level annotations like @DaTa or @NoArgsConstructor,
but you can use

@Getter @Setter
class MyClass {
  int field ;
...
}