代码拉取完成,页面将自动刷新
import com.diffplug.spotless.LineEnding
import com.vanniktech.maven.publish.MavenPublishPlugin
import com.vanniktech.maven.publish.MavenPublishPluginExtension
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
`java-library`
id(Config.QualityPlugins.spotless) version Config.QualityPlugins.spotlessVersion apply true
jacoco
id(Config.QualityPlugins.detekt) version Config.QualityPlugins.detektVersion
`maven-publish`
id(Config.QualityPlugins.binaryCompatibilityValidator) version Config.QualityPlugins.binaryCompatibilityValidatorVersion
}
buildscript {
repositories {
google()
}
dependencies {
classpath(Config.BuildPlugins.androidGradle)
classpath(kotlin(Config.BuildPlugins.kotlinGradlePlugin, version = Config.kotlinVersion))
classpath(Config.BuildPlugins.gradleMavenPublishPlugin)
// dokka is required by gradle-maven-publish-plugin.
classpath(Config.BuildPlugins.dokkaPlugin)
classpath(Config.QualityPlugins.errorpronePlugin)
classpath(Config.QualityPlugins.gradleVersionsPlugin)
// add classpath of androidNativeBundle
// com.ydq.android.gradle.build.tool:nativeBundle:{version}}
classpath(Config.NativePlugins.nativeBundlePlugin)
// add classpath of sentry android gradle plugin
// classpath("io.sentry:sentry-android-gradle-plugin:{version}")
classpath(Config.QualityPlugins.binaryCompatibilityValidatorPlugin)
classpath(Config.BuildPlugins.composeGradlePlugin)
}
}
apiValidation {
ignoredPackages.addAll(
setOf(
"io.sentry.android.core.internal"
)
)
ignoredProjects.addAll(
listOf(
"sentry-samples-android",
"sentry-samples-console",
"sentry-samples-jul",
"sentry-samples-log4j2",
"sentry-samples-logback",
"sentry-samples-openfeign",
"sentry-samples-servlet",
"sentry-samples-spring",
"sentry-samples-spring-boot",
"sentry-samples-spring-boot-webflux",
"sentry-samples-netflix-dgs",
"sentry-uitest-android",
"sentry-uitest-android-benchmark",
"test-app-plain",
"test-app-sentry",
)
)
}
allprojects {
repositories {
google()
mavenCentral()
}
group = Config.Sentry.group
version = properties[Config.Sentry.versionNameProp].toString()
description = Config.Sentry.description
tasks {
withType<Test> {
testLogging.showStandardStreams = true
testLogging.exceptionFormat = TestExceptionFormat.FULL
testLogging.events = setOf(
TestLogEvent.SKIPPED,
TestLogEvent.PASSED,
TestLogEvent.FAILED
)
dependsOn("cleanTest")
}
withType<JavaCompile> {
options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Werror", "-Xlint:-classfile", "-Xlint:-processing"))
}
}
}
subprojects {
plugins.withId(Config.QualityPlugins.detektPlugin) {
configure<DetektExtension> {
buildUponDefaultConfig = true
allRules = true
config.setFrom("${rootProject.rootDir}/detekt.yml")
}
}
if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-test-support") {
apply<DistributionPlugin>()
val sep = File.separator
configure<DistributionContainer> {
if (this@subprojects.name.contains("-compose")) {
this.configureForMultiplatform(this@subprojects)
} else {
this.getByName("main").contents {
// non android modules
from("build${sep}libs")
from("build${sep}publications${sep}maven")
// android modules
from("build${sep}outputs${sep}aar")
from("build${sep}publications${sep}release")
}
}
}
tasks.named("distZip").configure {
this.dependsOn("publishToMavenLocal")
this.doLast {
val distributionFilePath = "${this.project.buildDir}${sep}distributions${sep}${this.project.name}-${this.project.version}.zip"
val file = File(distributionFilePath)
if (!file.exists()) throw IllegalStateException("Distribution file: $distributionFilePath does not exist")
if (file.length() == 0L) throw IllegalStateException("Distribution file: $distributionFilePath is empty")
}
}
afterEvaluate {
apply<MavenPublishPlugin>()
configure<MavenPublishPluginExtension> {
// signing is done when uploading files to MC
// via gpg:sign-and-deploy-file (release.kts)
releaseSigningEnabled = false
}
// maven central info go to:
// ~/.gradle/gradle.properties
// maven central info:
// mavenCentralUsername=user name
// mavenCentralPassword=password
}
}
}
spotless {
lineEndings = LineEnding.UNIX
java {
target("**/*.java")
removeUnusedImports()
googleJavaFormat()
targetExclude("**/generated/**", "**/vendor/**")
}
kotlin {
target("**/*.kt")
ktlint()
}
kotlinGradle {
target("**/*.kts")
ktlint()
}
}
gradle.projectsEvaluated {
tasks.create("aggregateJavadocs", Javadoc::class.java) {
setDestinationDir(file("$buildDir/docs/javadoc"))
title = "${project.name} $version API"
val opts = options as StandardJavadocDocletOptions
opts.quiet()
opts.encoding = "UTF-8"
opts.memberLevel = JavadocMemberLevel.PROTECTED
opts.stylesheetFile(file("$projectDir/docs/stylesheet.css"))
opts.links = listOf(
"https://docs.oracle.com/javase/8/docs/api/",
"https://docs.spring.io/spring-framework/docs/current/javadoc-api/",
"https://docs.spring.io/spring-boot/docs/current/api/"
)
subprojects
.filter { !it.name.contains("sample") && !it.name.contains("integration-tests") }
.forEach { proj ->
proj.tasks.withType<Javadoc>().forEach { javadocTask ->
source += javadocTask.source
classpath += javadocTask.classpath
excludes += javadocTask.excludes
includes += javadocTask.includes
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。