Ver código fonte

1.添加游戏模块module

王鹏鹏 2 anos atrás
pai
commit
517fd56bdc
1 arquivos alterados com 19 adições e 33 exclusões
  1. 19 33
      game/build.gradle

+ 19 - 33
game/build.gradle

@@ -1,43 +1,29 @@
-plugins {
-    id 'com.android.application'
-    id 'org.jetbrains.kotlin.android'
-}
+apply from: "../module.build.gradle"
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-kapt'
 
 android {
-    compileSdkVersion 32
 
     defaultConfig {
-        applicationId "com.yingyangfly.game"
-        minSdkVersion 21
-        targetSdkVersion 32
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
-    }
-
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        // 如果是独立模块,则使用当前组件的包名
+        if (singleModule.toBoolean()) {
+            applicationId "com.yingyangfly.game"
         }
     }
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
-    kotlinOptions {
-        jvmTarget = '1.8'
-    }
+    // 统一资源前缀,规范资源引用
+    resourcePrefix "game_"
 }
 
 dependencies {
-
-    implementation 'androidx.core:core-ktx:1.7.0'
-    implementation 'androidx.appcompat:appcompat:1.3.0'
-    implementation 'com.google.android.material:material:1.4.0'
-    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
-    testImplementation 'junit:junit:4.13.2'
-    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
-    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+    implementation project(path: ':baselib')
+    api fileTree(exclude: '*.bak', dir: 'libs')
+    implementation(rootProject.ext.androidx.kotlin_lib)
+    implementation(rootProject.ext.androidx.kotlin_core)
+    implementation(rootProject.ext.androidx.appcompat)
+    implementation(rootProject.ext.androidx.material)
+    implementation(rootProject.ext.androidx.constraintlayout)
+    implementation(rootProject.ext.dependencies.rxjava)
+    implementation(rootProject.ext.dependencies.rxandroid)
+    implementation(rootProject.ext.dependencies.rxkotlin)
+    implementation(rootProject.ext.dependencies.Zxing)
 }