android studio use lombok

gradle 配置lombok

1
2
3
// https://mvnrepository.com/artifact/org.projectlombok/lombok
implementation 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'

完整配置文件 build.gradle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
plugins {
id 'com.android.application'
}

android {
compileSdk 32

defaultConfig {
applicationId "com.example.listviewchat"
minSdk 22
targetSdk 32
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
// https://mvnrepository.com/artifact/org.projectlombok/lombok
implementation 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

lombok 插件下载

ide 插件下载地址 https://plugins.jetbrains.com/

lombok 插件下载地址 https://plugins.jetbrains.com/plugin/6317-lombok

use

  • download .zip file
  • unpack to android-studio/plugins/
  • restart IDE

解压出来放到 android studio 根目录的 plugins

D:\Program Files\Android\Android Studio\plugins


android studio use lombok
https://zhaops-hub.github.io/2022/02/21/android/android studio use lombok/
作者
赵培胜
发布于
2022年2月21日
许可协议