1plugins { 2 id 'com.android.library' 3 id 'org.jetbrains.kotlin.android' 4 id 'com.google.protobuf' 5} 6 7final String PROTOS_DIR = "${ANDROID_TOP}/frameworks/libs/systemui/viewcapturelib/src/com/android/app/viewcapture/proto" 8 9android { 10 namespace = "com.android.app.viewcapture" 11 testNamespace = "com.android.app.viewcapture.test" 12 defaultConfig { 13 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 } 15 16 sourceSets { 17 main { 18 java.srcDirs = ['src'] 19 manifest.srcFile 'AndroidManifest.xml' 20 proto.srcDirs = ["${PROTOS_DIR}"] 21 } 22 androidTest { 23 java.srcDirs = ["tests"] 24 manifest.srcFile "tests/AndroidManifest.xml" 25 } 26 } 27 lint { 28 abortOnError false 29 } 30 31} 32 33dependencies { 34 implementation "androidx.core:core:1.9.0" 35 implementation "com.google.protobuf:protobuf-lite:${protobuf_lite_version}" 36 androidTestImplementation project(':SharedTestLib') 37 androidTestImplementation 'androidx.test.ext:junit:1.1.3' 38 androidTestImplementation "androidx.test:rules:1.4.0" 39} 40 41protobuf { 42 // Configure the protoc executable 43 protoc { 44 artifact = "com.google.protobuf:protoc:${protobuf_version}${PROTO_ARCH_SUFFIX}" 45 } 46 plugins { 47 javalite { 48 // The codegen for lite comes as a separate artifact 49 artifact = "com.google.protobuf:protoc-gen-javalite:${protobuf_lite_version}${PROTO_ARCH_SUFFIX}" 50 } 51 } 52 generateProtoTasks { 53 all().each { task -> 54 task.builtins { 55 remove java 56 } 57 task.plugins { 58 javalite { } 59 } 60 } 61 } 62}