build.gradle 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'kotlin-android'
  3. android {
  4. compileSdkVersion 30
  5. defaultConfig {
  6. minSdkVersion 22
  7. targetSdkVersion 30
  8. versionCode 1
  9. versionName "1.0"
  10. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  11. consumerProguardFiles "consumer-rules.pro"
  12. externalNativeBuild {
  13. cmake {
  14. cppFlags ""
  15. }
  16. }
  17. }
  18. buildTypes {
  19. release {
  20. minifyEnabled false
  21. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  22. }
  23. }
  24. externalNativeBuild {
  25. cmake {
  26. path "src/main/cpp/CMakeLists.txt"
  27. version "3.10.2"
  28. }
  29. }
  30. compileOptions {
  31. sourceCompatibility JavaVersion.VERSION_1_8
  32. targetCompatibility JavaVersion.VERSION_1_8
  33. }
  34. kotlinOptions {
  35. jvmTarget = '1.8'
  36. }
  37. //
  38. // buildFeatures {
  39. // viewBinding true
  40. // }
  41. libraryVariants.all{variant ->
  42. String variantName = variant.name.capitalize()
  43. if(variantName == "Release"){
  44. String output = project.rootDir.absolutePath
  45. variant.outputs.all {
  46. copy {
  47. from "$output/sdklibrary/build/outputs/aar/sdklibrary-release.aar"
  48. into "E:\\AndroidStudioProjects\\game_android\\PaoKu\\launcher\\libs"
  49. }
  50. copy {
  51. from "$output/sdklibrary/build/outputs/aar/sdklibrary-release.aar"
  52. into "E:\\AndroidStudioProjects\\game_android\\KeepDancing\\libs"
  53. }
  54. }
  55. }
  56. }
  57. }
  58. dependencies {
  59. compileOnly fileTree(dir: "unity", include: ["*.jar"])
  60. // compileOnly project(':unityLibrary')
  61. implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  62. implementation "androidx.appcompat:appcompat:1.3.0"
  63. implementation 'androidx.core:core-ktx:1.6.0'
  64. implementation 'androidx.recyclerview:recyclerview:1.2.1'
  65. implementation "com.squareup.okhttp3:okhttp:4.9.0"
  66. implementation "io.coil-kt:coil:1.3.2"
  67. testImplementation 'junit:junit:4.+'
  68. androidTestImplementation 'androidx.test.ext:junit:1.1.2'
  69. androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
  70. }
  71. task deleteOldAarFile(type: Delete){
  72. delete "E:\\AndroidStudioProjects\\game_android\\PaoKu\\launcher\\libs\\sdklibrary-release.aar"
  73. }