mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
bdb85d5093
'div-core' and 'utils' internal api 'div-lottie' and 'div-pinch-to-zoom' internal api 'assertion' and 'logging' internal api 'div-json' internal api
50 lines
1.4 KiB
Groovy
50 lines
1.4 KiB
Groovy
apply from: "${project.projectDir}/../div-library.gradle"
|
|
apply from: "${project.projectDir}/../div-tests.gradle"
|
|
apply from: "${project.projectDir}/../publish-android.gradle"
|
|
|
|
def generatedSrcDir = new File(buildDir, "generated/source/api")
|
|
|
|
allOpen {
|
|
annotation("com.yandex.div.core.annotations.Mockable")
|
|
}
|
|
|
|
android {
|
|
|
|
sourceSets {
|
|
main {
|
|
java.srcDirs += generatedSrcDir
|
|
}
|
|
}
|
|
|
|
libraryVariants.all { variant ->
|
|
variant.preBuildProvider.configure { dependsOn "generateDivModel" }
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation project(path: ':assertion')
|
|
implementation project(path: ':div-core')
|
|
implementation project(path: ':div-evaluable')
|
|
implementation project(path: ':div-json')
|
|
implementation project(path: ':utils')
|
|
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$versions.kotlin"
|
|
}
|
|
|
|
task generateDivModel(type: Exec) {
|
|
def execPath = new File(projectDir, '../../../api_generator/api_generator.sh').absolutePath
|
|
def configPath = new File(projectDir, 'div2-generator-config.json').absolutePath
|
|
def schemaPath = new File(projectDir, "../../../schema").absolutePath
|
|
def modelPath = new File(generatedSrcDir, "com/yandex/div2")
|
|
|
|
doFirst {
|
|
println "Process schema: $schemaPath"
|
|
println commandLine
|
|
}
|
|
|
|
commandLine execPath, configPath, schemaPath, modelPath
|
|
|
|
inputs.file configPath
|
|
inputs.dir schemaPath
|
|
outputs.dir modelPath
|
|
}
|