build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. compileOptions {
  25. sourceCompatibility JavaVersion.VERSION_1_7
  26. targetCompatibility JavaVersion.VERSION_1_7
  27. }
  28. }
  29. /**
  30. task modify_properties() {
  31. android.libraryVariants.all { variant ->
  32. String YYXX_ONLINE_ENV = ''
  33. if (variant.buildType.name == 'release'){
  34. YYXX_ONLINE_ENV = "YYXX_ONLINE_ENV=https://sdkapi.yyxxgame.com"
  35. }else if(variant.buildType.name == 'debug'){
  36. YYXX_ONLINE_ENV = "YYXX_ONLINE_ENV=http://testsdkapi.yyxxgame.com"
  37. }else{
  38. YYXX_ONLINE_ENV = "YYXX_ONLINE_ENV=https://sdkapi.yyxxgame.com"
  39. }
  40. def list = []
  41. def path = "${getRootDir()}/library_platform/hnyy/src/main/assets/yyxx_game/yyxx_cfg.properties"
  42. new File(path).withReader('UTF-8') { reader ->
  43. reader.eachLine {
  44. if (it.contains('YYXX_ONLINE_ENV')){
  45. it = YYXX_ONLINE_ENV
  46. }
  47. list.add(it + "\n")
  48. }
  49. }
  50. new File(path).withWriter('UTF-8') { writer ->
  51. list.each {
  52. writer.write(it)
  53. }
  54. }
  55. }
  56. }
  57. **/
  58. android.libraryVariants.all { variant ->
  59. if (variant.buildType.name == 'release'){
  60. variant.outputs.all {
  61. outputFileName = "$PUBLISH_ARTIFACT_ID"+ "-" + "$PUBLISH_VERSION" + ".aar"
  62. }
  63. }else{
  64. variant.outputs.all {
  65. outputFileName = "$PUBLISH_ARTIFACT_ID" + "_"+ variant.buildType.name + "$PUBLISH_VERSION" + ".aar"
  66. }
  67. }
  68. }
  69. dependencies {
  70. compileOnly project(':library_base')
  71. compileOnly project(':library_core')
  72. compileOnly project(':library_channel')
  73. compileOnly files('../hnyy/libs/oaid_sdk_1.0.25.aar')
  74. }
  75. apply from: 'buildJar.gradle'
  76. apply from: 'publish.gradle'