build.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. plugins {
  2. id 'com.android.library'
  3. }
  4. android {
  5. compileSdk 31
  6. defaultConfig {
  7. minSdk 21
  8. targetSdk 26
  9. consumerProguardFiles "consumer-rules.pro"
  10. }
  11. buildTypes {
  12. release {
  13. minifyEnabled rootProject.ext.module.minifyEnabled
  14. proguardFiles 'proguard-rules.pro'
  15. }
  16. debug {
  17. minifyEnabled rootProject.ext.module.minifyEnabled
  18. proguardFiles 'proguard-rules.pro'
  19. }
  20. }
  21. buildFeatures {
  22. buildConfig false
  23. }
  24. lintOptions {
  25. abortOnError false
  26. }
  27. dexOptions {
  28. preDexLibraries false
  29. }
  30. compileOptions {
  31. sourceCompatibility JavaVersion.VERSION_1_7
  32. targetCompatibility JavaVersion.VERSION_1_7
  33. }
  34. }
  35. /**
  36. task modify_properties() {
  37. android.libraryVariants.all { variant ->
  38. String YYXX_ONLINE_ENV = ''
  39. if (variant.buildType.name == 'release'){
  40. YYXX_ONLINE_ENV = "YYXX_ONLINE_ENV=https://sdkapi.yyxxgame.com"
  41. }else if(variant.buildType.name == 'debug'){
  42. YYXX_ONLINE_ENV = "YYXX_ONLINE_ENV=http://testsdkapi.yyxxgame.com"
  43. }else{
  44. YYXX_ONLINE_ENV = "YYXX_ONLINE_ENV=https://sdkapi.yyxxgame.com"
  45. }
  46. def list = []
  47. def path = "${getRootDir()}/library_platform/hnyy/src/main/assets/yyxx_game/yyxx_cfg.properties"
  48. new File(path).withReader('UTF-8') { reader ->
  49. reader.eachLine {
  50. if (it.contains('YYXX_ONLINE_ENV')){
  51. it = YYXX_ONLINE_ENV
  52. }
  53. list.add(it + "\n")
  54. }
  55. }
  56. new File(path).withWriter('UTF-8') { writer ->
  57. list.each {
  58. writer.write(it)
  59. }
  60. }
  61. }
  62. }
  63. **/
  64. android.libraryVariants.all { variant ->
  65. if (variant.buildType.name == 'release'){
  66. variant.outputs.all {
  67. outputFileName = "$PUBLISH_ARTIFACT_ID"+ "-" + "$PUBLISH_VERSION" + ".aar"
  68. }
  69. }else{
  70. variant.outputs.all {
  71. outputFileName = "$PUBLISH_ARTIFACT_ID" + "_"+ variant.buildType.name + "$PUBLISH_VERSION" + ".aar"
  72. }
  73. }
  74. }
  75. dependencies {
  76. compileOnly project(':library_base')
  77. compileOnly project(':library_core')
  78. compileOnly project(':library_channel')
  79. compileOnly files('../hnyy/libs/oaid_sdk_1.0.25.aar')
  80. }
  81. apply from: 'publish.gradle'