[lombok] Add integration test for gradle plugin
This commit is contained in:
committed by
TeamCityServer
parent
5a6819daa8
commit
c4147bc2fd
@@ -20,6 +20,7 @@ dependencies {
|
|||||||
testImplementation(project(":kotlin-gradle-subplugin-example"))
|
testImplementation(project(":kotlin-gradle-subplugin-example"))
|
||||||
testImplementation(project(":kotlin-allopen"))
|
testImplementation(project(":kotlin-allopen"))
|
||||||
testImplementation(project(":kotlin-noarg"))
|
testImplementation(project(":kotlin-noarg"))
|
||||||
|
testImplementation(project(":kotlin-lombok"))
|
||||||
testImplementation(project(":kotlin-sam-with-receiver"))
|
testImplementation(project(":kotlin-sam-with-receiver"))
|
||||||
testImplementation(project(":kotlin-test:kotlin-test-jvm"))
|
testImplementation(project(":kotlin-test:kotlin-test-jvm"))
|
||||||
testImplementation(project(":native:kotlin-native-utils"))
|
testImplementation(project(":native:kotlin-native-utils"))
|
||||||
|
|||||||
+8
@@ -263,4 +263,12 @@ class SubpluginsIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testLombokPlugin() {
|
||||||
|
Project("lombokProject").build("build") {
|
||||||
|
assertSuccessful()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-lombok:$kotlin_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
plugins {
|
||||||
|
id "java"
|
||||||
|
id "kotlin"
|
||||||
|
id "kotlin-lombok"
|
||||||
|
id "io.freefair.lombok" version "5.3.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package lab;
|
||||||
|
|
||||||
|
public class JavaUsage {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SomePojo obj = new SomePojo();
|
||||||
|
obj.setAge(12);
|
||||||
|
boolean v = obj.isHuman();
|
||||||
|
obj.setHuman(!v);
|
||||||
|
System.out.println(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package lab;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Getter @Setter @ToString
|
||||||
|
public class SomePojo {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private int age;
|
||||||
|
private boolean human;
|
||||||
|
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package lab
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
val obj = SomePojo()
|
||||||
|
obj.name = "test"
|
||||||
|
obj.age = 12
|
||||||
|
val v = obj.isHuman
|
||||||
|
obj.isHuman = !v
|
||||||
|
println(obj)
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
include ':nokapt', ':yeskapt', ":withconfig"
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
plugins {
|
||||||
|
id "java"
|
||||||
|
id "kotlin"
|
||||||
|
id "kotlin-kapt"
|
||||||
|
id "kotlin-lombok"
|
||||||
|
id "io.freefair.lombok" version "5.3.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
|
||||||
|
kapt "com.google.dagger:dagger-compiler:2.33"
|
||||||
|
}
|
||||||
|
|
||||||
|
kapt {
|
||||||
|
keepJavacAnnotationProcessors = true
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlinLombok {
|
||||||
|
lombokConfigurationFile file("lombok.config")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
config.stopBubbling = true
|
||||||
|
|
||||||
|
lombok.getter.noIsPrefix = true
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package lab2;
|
||||||
|
|
||||||
|
public class JavaUsage {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SomePojo obj = new SomePojo();
|
||||||
|
obj.setAge(12);
|
||||||
|
boolean v = obj.getHuman();
|
||||||
|
obj.setHuman(!v);
|
||||||
|
System.out.println(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package lab2;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
public class ManualPojo {
|
||||||
|
|
||||||
|
public String getFoo() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @NotNull
|
||||||
|
public String getBar() {
|
||||||
|
return "234";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public Object someMethod() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package lab2;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@Getter @Setter @ToString
|
||||||
|
public class SomePojo {
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
private String name;
|
||||||
|
private int age;
|
||||||
|
|
||||||
|
private boolean human;
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package lab2
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
val obj = SomePojo()
|
||||||
|
obj.name = "test"
|
||||||
|
val s: String = obj.name
|
||||||
|
obj.age = 12
|
||||||
|
val v = obj.human
|
||||||
|
obj.human = !v
|
||||||
|
println(obj)
|
||||||
|
|
||||||
|
val manualPojo = ManualPojo()
|
||||||
|
|
||||||
|
val foo: String? = manualPojo.getFoo()
|
||||||
|
val res: Any? = manualPojo.someMethod()
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
plugins {
|
||||||
|
id "java"
|
||||||
|
id "kotlin"
|
||||||
|
id "kotlin-kapt"
|
||||||
|
id "kotlin-lombok"
|
||||||
|
id "io.freefair.lombok" version "5.3.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
|
||||||
|
kapt "com.google.dagger:dagger-compiler:2.33"
|
||||||
|
}
|
||||||
|
|
||||||
|
kapt {
|
||||||
|
keepJavacAnnotationProcessors = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package lab;
|
||||||
|
|
||||||
|
public class JavaUsage {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SomePojo obj = new SomePojo();
|
||||||
|
obj.setAge(12);
|
||||||
|
System.out.println(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
package lab;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Getter @Setter @ToString
|
||||||
|
public class SomePojo {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private int age;
|
||||||
|
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package lab
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
val obj = SomePojo()
|
||||||
|
obj.name = "test"
|
||||||
|
obj.age = 12
|
||||||
|
println(obj.getName())
|
||||||
|
println(obj)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user