Files
WinBoLL/build.gradle
LaizyBoy 286f8513d4 refactor: 升级编译配置并调整最低API版本
- 升级 Gradle 编译版本为 Java 11
  根目录 build.gradle 中 JavaCompile 配置从 VERSION_1_7 改为 VERSION_11

- 调整 minSdkVersion 从 21 升级至 26
  适配 Android 8.0 (API 26) 及以上系统
  修改范围: aes/build.gradle, libaes/build.gradle

- 移除未使用的 XXPermissions 依赖
  该库使用 Java 8 字节码与 minSdkVersion 21 不兼容,项目中未引用此库
2026-05-10 04:48:29 +08:00

110 lines
4.3 KiB
Groovy
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
maven { url 'https://dl.bintray.com/ppartisan/maven/' }
maven { url "https://clojars.org/repo/" }
maven { url "https://jitpack.io" }
mavenCentral()
google()
mavenLocal {
// 设置本地Maven仓库路径
url 'file:///sdcard/.m2/repository/'
}
// Nexus Maven 库地址
// "WinBoLL Release"
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
// "WinBoLL Snapshot"
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
}
dependencies {
// 适配MIUI12
classpath 'com.android.tools.build:gradle:7.2.1' // 对应 compileSdkVersion 32
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
maven { url 'https://dl.bintray.com/ppartisan/maven/' }
maven { url "https://clojars.org/repo/" }
maven { url "https://jitpack.io" }
mavenCentral()
google()
mavenLocal {
// 设置本地Maven仓库路径
url 'file:///sdcard/.m2/repository/'
}
// Nexus Maven 库地址
// "WinBoLL Release"
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
// "WinBoLL Snapshot"
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
}
ext {
// 定义全局变量,常用于版本管理
// 变量在子模块的build.gradle中直接以 $NAME 的形式调用
// 定义版本管理文件
RootProjectDir = "${rootProject.projectDir}".replace("\\", "/")
bashCheckGitCommitStatusFilePath = ".winboll/bashCheckGitCommitStatus.sh"
bashCommitAppPublishBuildFlagInfoFilePath = ".winboll/bashCommitAppPublishBuildFlagInfo.sh"
winbollFilePath = "winboll.properties"
keyPropsFilePath = "appkey.keystore"
// 定义 lint 输出文件
lintXmlReportFilePath = "build/reports/lint-results.xml"
lintHTMLReportFilePath = "build/reports/lint-results.html"
// 检查编译配置文件
subProjectPath = "$RootProjectDir/$project.name"
println "Sub project path: $subProjectPath"
winbollBuildPropsDesc="Created by .winboll/winboll_app_build.gradle"
winbollBuildPropsFile = rootProject.file("$subProjectPath/build.properties")
winbollBuildPropsFilePath = winbollBuildPropsFile.getAbsolutePath();
assert(winbollBuildPropsFile.exists())
winbollBuildProps = new Properties()
// 读取编译标志位配置文件
winbollBuildProps.load(new FileInputStream(winbollBuildPropsFile))
// 读取编译标志位配置文件
assert (winbollBuildProps['stageCount'] != null)
assert (winbollBuildProps['baseVersion'] != null)
assert (winbollBuildProps['publishVersion'] != null)
assert (winbollBuildProps['buildCount'] != null)
}
afterEvaluate {
task cleanLintFile() {
dependsOn tasks.findAll { task -> task.name.startsWith('lint') }
doFirst {
// 这里是将在Lint任务开始前执行的代码
println "Lint task will run after this setup."
}
}
}
subprojects {
// 1. 对纯 Java 模块的 JavaCompile 任务配置(升级为 Java 11
tasks.withType(JavaCompile) {
options.compilerArgs << "-parameters"
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
// 可选:确保编码一致
options.encoding = "UTF-8"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}