mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
3ffa561190
update gradle wrapper Был целый ряд проблем с конфигурацией Gradle. Обновил врапперы, заодно поднял версию до 7.6. Починил сломанный тест, который должен запускаться регулярно с помощью ya.make, но, судя по всему, и там не все в порядке.
172 lines
4.6 KiB
Groovy
172 lines
4.6 KiB
Groovy
import com.yandex.div.gradle.PublicationType
|
|
|
|
apply from: "$projectDir/version.gradle"
|
|
apply from: "$projectDir/dependencies.gradle"
|
|
|
|
def publicationType = PublicationType.fromString(project.findProperty("publicationType"))
|
|
|
|
ext {
|
|
minSdkVersion = 21
|
|
compileSdkVersion = 33
|
|
targetSdkVersion = 31
|
|
buildToolsVersion = "33.0.0"
|
|
|
|
divkitVersionName = "${divkitVersion.versionName}${publicationType.getVersionSuffix()}"
|
|
}
|
|
|
|
buildscript {
|
|
apply from: "$projectDir/dependencies.gradle"
|
|
|
|
def internalBuildScriptConfiguration = file("$projectDir/buildscript-internal.gradle")
|
|
if (internalBuildScriptConfiguration.exists()) {
|
|
apply from: internalBuildScriptConfiguration, to: buildscript
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath "com.android.tools.build:gradle:$versions.gradlePlugin"
|
|
classpath "com.yandex.android:appmetrica-build-plugin:$versions.metricaCrashPlugin"
|
|
classpath "com.yandex.test:screenshot-test-plugin:1.0.0"
|
|
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
|
|
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$versions.kotlin"
|
|
classpath "org.jetbrains.kotlin:kotlin-allopen:$versions.kotlin"
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
|
|
classpath "org.jetbrains.kotlinx:binary-compatibility-validator:0.11.1"
|
|
}
|
|
}
|
|
|
|
apply plugin: "org.jetbrains.kotlinx.binary-compatibility-validator"
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
|
kotlinOptions {
|
|
freeCompilerArgs = ['-Xjvm-default=all']
|
|
languageVersion = "1.5"
|
|
apiVersion = "1.5"
|
|
}
|
|
}
|
|
|
|
tasks.whenTaskAdded { task ->
|
|
if (task.name == "apiDump") {
|
|
afterEvaluate {
|
|
task.configure {
|
|
into "$rootProject.projectDir/../../../internal/android/api-dump"
|
|
preserve {
|
|
include "*.api"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (task.name == "apiCheck") {
|
|
afterEvaluate {
|
|
task.configure {
|
|
projectApiDir = file("$rootProject.projectDir/../../../internal/android/api-dump")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
tasks.withType(Test) {
|
|
// Do not use parallel forks, because profit from parallel execution is eaten by Robolectric initialization in every test process
|
|
maxParallelForks = 1
|
|
maxHeapSize = "4g"
|
|
}
|
|
|
|
configurations.all {
|
|
exclude group: 'com.intellij', module: 'annotations'
|
|
}
|
|
|
|
afterEvaluate {
|
|
if (plugins.hasPlugin("jacoco")) {
|
|
project.tasks.named("jacocoTestReport") { task ->
|
|
unitTests.dependsOn(task)
|
|
}
|
|
}
|
|
|
|
if (project.hasProperty("teamcity.version")) {
|
|
project.tasks.withType(PublishToMavenRepository) { task ->
|
|
task.finalizedBy(reportBuildNumberToTeamcity)
|
|
}
|
|
}
|
|
|
|
project.tasks.withType(PublishToMavenLocal) { task ->
|
|
task.finalizedBy(reportVersion)
|
|
}
|
|
}
|
|
}
|
|
|
|
wrapper {
|
|
gradleVersion "7.6"
|
|
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",
|
|
"unit-test-common"
|
|
]
|
|
ignoredPackages += ["com.yandex.div.internal"]
|
|
nonPublicMarkers += ["dagger.internal.DaggerGenerated"]
|
|
}
|
|
|
|
task reportVersion {
|
|
doLast {
|
|
println "DivKit version ${rootProject.property('divkitVersionName')}"
|
|
}
|
|
}
|
|
|
|
task reportBuildNumberToTeamcity {
|
|
doLast {
|
|
println "##teamcity[buildNumber \'${rootProject.property('divkitVersionName')}\']"
|
|
}
|
|
}
|
|
|
|
task assembleDemoDebug {
|
|
dependsOn ':divkit-demo-app:assembleDebug'
|
|
}
|
|
|
|
task assembleDemoDebugBundle {
|
|
dependsOn ':divkit-demo-app:bundleDebug'
|
|
}
|
|
|
|
task assembleDemoRelease {
|
|
dependsOn ':divkit-demo-app:assembleRelease'
|
|
}
|
|
|
|
task assembleDemoReleaseBundle {
|
|
dependsOn ':divkit-demo-app:bundleRelease'
|
|
}
|
|
|
|
task unitTests
|
|
|
|
task finalVerification {
|
|
dependsOn unitTests
|
|
}
|
|
|
|
ext.hasInternalConfiguration = false
|
|
|
|
def internalConfiguration = file("$projectDir/build-internal.gradle")
|
|
if (internalConfiguration.exists()) {
|
|
apply from: "$projectDir/build-internal.gradle"
|
|
ext.hasInternalConfiguration = true
|
|
}
|