1 Star 0 Fork 9

Asuna/glide

forked from Gitee 极速下载/glide 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 7.35 KB
一键复制 编辑 原始数据 按行查看 历史
Sam Judd 提交于 2023-09-19 12:09 . Update Checkstyle to 8.45.1
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import se.bjurr.violations.gradle.plugin.ViolationsTask
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath libs.android.gradle
if (!hasProperty('DISABLE_ERROR_PRONE')) {
classpath libs.errorprone.gradle
}
classpath libs.proguard.gradle
classpath libs.violations
classpath libs.androidx.benchmark.gradle
classpath libs.kotlin.gradle
classpath libs.ksp.gradle
classpath libs.coroutines.binarycompat.gradle
classpath libs.dokka.gradle
classpath 'com.guardsquare:proguard-gradle:' + (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11) ? '7.3.2' : '7.1.0')
}
}
repositories {
google()
mavenCentral()
}
apply plugin: 'binary-compatibility-validator'
apply plugin: 'org.jetbrains.dokka'
apiValidation {
ignoredProjects += ["ksp", "test", "gallery", "integrationtest", "sqljournaldiskcache"]
nonPublicMarkers += ["com.bumptech.glide.integration.ktx.InternalGlideApi"]
}
// See http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html.
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
dokkaHtmlMultiModule.configure {
moduleName.set("Glide")
}
afterEvaluate {
tasks.named("dokkaHtmlMultiModule") {
pluginsMapConfiguration.set(
[
"org.jetbrains.dokka.base.DokkaBase": """{
"customStyleSheets": ["${projectDir.toString()}/static/logo-styles.css"],
"customAssets" : ["${projectDir.toString()}/static/logo-icon.svg", "${projectDir.toString()}/static/glide_circle_logo.png"]
}"""
]
)
}
}
subprojects { project ->
repositories {
google()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
gradlePluginPortal()
}
// Exclude packages not intended for public use.
if ([
"testutil",
"flickr",
"giphy",
"imgur",
"svg",
"gallery",
"contacturi",
"test",
"gif_decoder",
"gifencoder",
"compiler",
"benchmark",
"integrationtest",
"instrumentation",
"glide-parent",
"integration",
"samples",
"third_party"
].contains(project.getName())) {
afterEvaluate {
project.apply plugin: 'org.jetbrains.dokka'
project.tasks.dokkaHtmlPartial.enabled = false
}
} else {
afterEvaluate {
project.apply plugin: 'org.jetbrains.dokka'
project.tasks.dokkaHtmlPartial.configure {
dokkaSourceSets {
// Kotlin works out of the box
if (!project.plugins.hasPlugin("kotlin-android") && project.plugins.hasPlugin("com.android.library")) {
// Java Android modules
register("main") {
sourceRoots.from(project.android.sourceSets.main.java.srcDirs)
}
} else if (project.plugins.hasPlugin("java") && "ksp" != project.getName()) {
// Java only modules (ksp is not useful and uses multiple plugins)
register("main") {
sourceRoots.from(sourceSets.main.java.srcDirs)
}
}
}
}
}
}
afterEvaluate {
if (project.plugins.hasPlugin("com.android.application")) {
project.dependencies {
// Hack around some version mismatches: https://stackoverflow.com/questions/75263047/duplicate-class-in-kotlin-android
implementation(platform(libs.kotlin.bom))
}
}
}
tasks.withType(JavaCompile) {
// gifencoder is a legacy project that has a ton of warnings and is basically never
// modified, so we're not going to worry about cleaning it up.
// Imgur uses generated code from dagger that has warnings.
if ("gifencoder" != project.getName() && "imgur" != project.getName()) {
options.compilerArgs.addAll([
//Treat all warnings as errors.
"-Werror",
//Enable all warnings.
"-Xlint:all",
// Disable warnings about source 7 being obsolete.
"-Xlint:-options",
// Java expects every annotation to have a processor, but we use
// javax.annotation.Nullable, which doesn't have one.
"-Xlint:-processing",
// See https://github.com/google/dagger/issues/945
// and https://bugs.openjdk.java.net/browse/JDK-8190452
"-Xlint:-classfile",
// Disable deprecation warnings for ViewTarget/BaseTarget for now.
"-Xlint:-deprecation",
])
}
}
tasks.withType(Test) {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
}
}
// Avoid issues like #2452.
tasks.withType(Jar) {
duplicatesStrategy = DuplicatesStrategy.FAIL
}
apply plugin: 'checkstyle'
checkstyle {
toolVersion = '8.45.1'
}
checkstyle {
configFile = rootProject.file('checkstyle.xml')
configProperties.checkStyleConfigDir = rootProject.rootDir
}
task checkstyle(type: Checkstyle) {
source 'src'
include '**/*.java'
exclude '**/gen/**'
// Caught by the violations plugin.
ignoreFailures = true
// empty classpath
classpath = files()
}
apply plugin: "se.bjurr.violations.violations-gradle-plugin"
task violations(type: ViolationsTask) {
minSeverity = 'INFO'
detailLevel = 'VERBOSE'
maxViolations = 0
diffMaxViolations = 0
// Formats are listed here: https://github.com/tomasbjerre/violations-lib
def dir = projectDir.absolutePath
violations = [
["PMD", dir, ".*/pmd/.*\\.xml\$", "PMD"],
["ANDROIDLINT", dir, ".*/lint-results\\.xml\$", "AndroidLint"],
["CHECKSTYLE", dir, ".*/checkstyle/.*\\.xml\$", "Checkstyle"],
]
}
afterEvaluate {
if (project.hasProperty("android")
&& project.name != 'pmd' ) {
android {
lint {
warningsAsErrors true
quiet true
// Caught by the violations plugin.
abortOnError false
}
// We don't need a BuildConfig constants class.
buildFeatures {
buildConfig = false
}
// Signing isn't relevant to a library. Our signing is done via
// a GPG key at upload time, there's no APK to sign.
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
}
if (project.tasks.findByName('check')) {
check.dependsOn('checkstyle')
check.finalizedBy violations
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/muxiaofufeng/glide.git
git@gitee.com:muxiaofufeng/glide.git
muxiaofufeng
glide
glide
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385