build.gradle 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. buildscript {
  3. repositories {
  4. google()
  5. mavenCentral()
  6. }
  7. dependencies {
  8. classpath 'com.android.tools.build:gradle:8.7.2'
  9. classpath 'com.google.gms:google-services:4.4.2'
  10. // NOTE: Do not place your application dependencies here; they belong
  11. // in the individual module build.gradle files
  12. }
  13. }
  14. apply from: "variables.gradle"
  15. allprojects {
  16. repositories {
  17. google()
  18. mavenCentral()
  19. }
  20. }
  21. // 强制所有子项目使用 Java 17(包括 node_modules 中的模块)
  22. subprojects {
  23. afterEvaluate { project ->
  24. if (project.hasProperty('android')) {
  25. project.android {
  26. compileOptions {
  27. sourceCompatibility JavaVersion.VERSION_17
  28. targetCompatibility JavaVersion.VERSION_17
  29. }
  30. }
  31. }
  32. }
  33. // 排除旧版本的 Kotlin JDK7/JDK8 标准库
  34. configurations.all {
  35. exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
  36. exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
  37. }
  38. }
  39. task clean(type: Delete) {
  40. delete rootProject.buildDir
  41. }