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