mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
161 lines
4.3 KiB
Groovy
161 lines
4.3 KiB
Groovy
import com.yandex.div.gradle.FileExtensions
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
apply from: "$projectDir/version.gradle"
|
|
|
|
ext {
|
|
minSdkVersion = 21
|
|
compileSdkVersion = 34
|
|
targetSdkVersion = 34
|
|
buildToolsVersion = "35.0.0"
|
|
}
|
|
|
|
buildscript {
|
|
FileExtensions.ifExists("${project.projectDir}/bootstrap.internal.gradle") {
|
|
apply from: it
|
|
}
|
|
|
|
repositories {
|
|
gradlePluginPortal()
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath libs.agp.gradle
|
|
classpath libs.appmetrica.plugin
|
|
classpath libs.nexusPublishPlugin
|
|
classpath libs.dokka
|
|
classpath libs.kotlin.allopen
|
|
classpath libs.kotlin.gradle.plugin
|
|
classpath libs.kotlin.serialization.plugin
|
|
classpath libs.kotlin.binaryCompatibilityValidator
|
|
classpath libs.unmock.plugin
|
|
}
|
|
}
|
|
|
|
apply plugin: "org.jetbrains.kotlinx.binary-compatibility-validator"
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
|
|
configurations.configureEach {
|
|
resolutionStrategy {
|
|
eachDependency { details ->
|
|
if (details.requested.group == "com.christophsturm" && details.requested.name == "filepeek") {
|
|
details.useVersion "0.1.3"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(KotlinCompile).configureEach {
|
|
compilerOptions {
|
|
freeCompilerArgs = [
|
|
"-Xjvm-default=all",
|
|
"-opt-in=com.yandex.div.data.DivModelInternalApi",
|
|
"-opt-in=com.yandex.yatagan.ConditionsApi",
|
|
"-opt-in=com.yandex.div.core.annotations.InternalApi",
|
|
"-opt-in=com.yandex.div.core.annotations.ExperimentalApi"
|
|
]
|
|
languageVersion = KotlinVersion.KOTLIN_1_5
|
|
apiVersion = KotlinVersion.KOTLIN_1_5
|
|
jvmTarget = JvmTarget.JVM_1_8
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
tasks.withType(Test).configureEach {
|
|
// Do not use parallel forks, because profit from parallel execution is eaten by Robolectric initialization in every test process
|
|
maxParallelForks = 1
|
|
maxHeapSize = "4g"
|
|
}
|
|
|
|
configurations.configureEach {
|
|
exclude group: "com.intellij", module: "annotations"
|
|
}
|
|
|
|
afterEvaluate {
|
|
if (plugins.hasPlugin("jacoco")) {
|
|
project.tasks.named("jacocoTestReport").get().configure { task ->
|
|
unitTests.dependsOn(task)
|
|
}
|
|
}
|
|
|
|
project.tasks.withType(PublishToMavenRepository).configureEach { task ->
|
|
task.finalizedBy(reportBuildNumber)
|
|
}
|
|
|
|
project.tasks.withType(PublishToMavenLocal).configureEach { task ->
|
|
task.finalizedBy(reportVersion)
|
|
}
|
|
}
|
|
}
|
|
|
|
wrapper {
|
|
gradleVersion "8.10.2"
|
|
distributionType = Wrapper.DistributionType.ALL
|
|
distributionUrl "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
|
|
}
|
|
|
|
apiValidation {
|
|
ignoredProjects += [
|
|
"api-generator-test",
|
|
"divkit-demo-app",
|
|
"divkit-perftests",
|
|
"divkit-regression-testing",
|
|
"sample",
|
|
"screenshot-test-runtime",
|
|
"ui-test-common",
|
|
]
|
|
ignoredPackages += ["com.yandex.div.internal"]
|
|
nonPublicMarkers += [
|
|
"com.yandex.yatagan.internal.YataganGenerated",
|
|
"com.yandex.div.core.annotations.ExperimentalApi"
|
|
]
|
|
}
|
|
|
|
tasks.register('reportVersion') {
|
|
doLast {
|
|
println "DivKit version ${divkitVersion.releaseLibraryVersion}"
|
|
}
|
|
}
|
|
|
|
tasks.register('reportBuildNumber') {
|
|
doLast {
|
|
println "buildNumber ${divkitVersion.releaseLibraryVersion}"
|
|
}
|
|
}
|
|
|
|
tasks.register('assembleDemoDebug') {
|
|
dependsOn ":divkit-demo-app:assembleDebug"
|
|
}
|
|
|
|
tasks.register('assembleDemoDebugBundle') {
|
|
dependsOn ":divkit-demo-app:bundleDebug"
|
|
}
|
|
|
|
tasks.register('assembleDemoRelease') {
|
|
dependsOn ":divkit-demo-app:assembleRelease"
|
|
}
|
|
|
|
tasks.register('assembleDemoReleaseBundle') {
|
|
dependsOn ":divkit-demo-app:bundleRelease"
|
|
}
|
|
|
|
tasks.register('unitTests')
|
|
|
|
tasks.register('finalVerification') {
|
|
dependsOn unitTests
|
|
}
|
|
|
|
FileExtensions.ifExists("${project.projectDir}/build.internal.gradle") {
|
|
apply from: it
|
|
}
|