build.gradle 1.8 KB

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