forked from divkit/divkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
157 lines (129 loc) · 4.2 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import com.yandex.div.gradle.FileExtensions
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 = 34
targetSdkVersion = 34
buildToolsVersion = "34.0.0"
divkitVersionName = "${divkitVersion.versionName}${publicationType.getVersionSuffix()}"
}
buildscript {
apply from: "$projectDir/dependencies.gradle"
FileExtensions.ifExists("${project.projectDir}/bootstrap.internal.gradle") {
apply from: it
}
repositories {
gradlePluginPortal()
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.dokka"
classpath "org.jetbrains.kotlin:kotlin-allopen:$versions.kotlin"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath "org.jetbrains.kotlin:kotlin-serialization:$versions.kotlin"
classpath "org.jetbrains.kotlinx:binary-compatibility-validator:0.11.1"
}
}
apply plugin: "org.jetbrains.kotlinx.binary-compatibility-validator"
allprojects {
repositories {
google()
mavenCentral()
}
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'com.christophsturm' && details.requested.name == 'filepeek') {
details.useVersion '0.1.3'
}
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
freeCompilerArgs = ['-Xjvm-default=all', '-opt-in=com.yandex.div.data.DivModelInternalApi']
languageVersion = "1.5"
apiVersion = "1.5"
jvmTarget = "1.8"
}
}
}
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)
}
}
project.tasks.withType(PublishToMavenRepository) { task ->
task.finalizedBy(reportBuildNumber)
}
project.tasks.withType(PublishToMavenLocal) { task ->
task.finalizedBy(reportVersion)
}
}
}
wrapper {
gradleVersion "8.3"
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 reportBuildNumber {
doLast {
println "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
}
FileExtensions.ifExists("${project.projectDir}/build.internal.gradle") {
apply from: it
}