build.gradle 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. plugins {
  2. id 'com.android.library'
  3. id 'org.jetbrains.kotlin.android'
  4. }
  5. def version = '1.0.1'
  6. def releaseTime() {
  7. return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
  8. }
  9. android {
  10. compileSdk = rootProject.ext.compileSdkVersion
  11. buildToolsVersion rootProject.ext.buildToolsVersion
  12. defaultConfig {
  13. minSdkVersion rootProject.ext.minSdkVersion
  14. targetSdkVersion rootProject.ext.targetSdkVersion
  15. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  16. consumerProguardFiles "proguard-rules.pro"
  17. }
  18. buildTypes {
  19. debug{
  20. libraryVariants.all { variant->
  21. variant.outputs.all { output ->
  22. if (outputFile != null && outputFileName.endsWith('.aar')) {
  23. outputFileName = "ad_admob_${version}_${releaseTime()}_release.aar"
  24. }
  25. }
  26. }
  27. }
  28. release {
  29. minifyEnabled true
  30. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  31. libraryVariants.all { variant->
  32. variant.outputs.all { output ->
  33. if (outputFile != null && outputFileName.endsWith('.aar')) {
  34. outputFileName = "ad_admob_${version}_${releaseTime()}_release.aar"
  35. }
  36. }
  37. }
  38. }
  39. }
  40. compileOptions {
  41. sourceCompatibility JavaVersion.VERSION_1_8
  42. targetCompatibility JavaVersion.VERSION_1_8
  43. }
  44. kotlinOptions {
  45. jvmTarget = '1.8'
  46. }
  47. }
  48. dependencies {
  49. implementation project(':lib_ad_core')
  50. api 'com.google.android.gms:play-services-ads:21.5.0'
  51. }