1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00
anytype-kotlin/build.gradle
Mikhail 164e0eff61
DROID-515 Editor | Fix | Fix ff video buttons (#2769)
* DROID-515 App | Tech | Update dependencies

* DROID-515 Editor | Fix | Fix ff video buttons

* DROID-453 Editor | Fix | Unmerge
2022-12-19 20:14:51 +03:00

94 lines
No EOL
2.9 KiB
Groovy

import com.android.build.gradle.LibraryPlugin
apply from: './dependencies.gradle'
buildscript {
ext.nav_version = '2.5.3'
ext.dokka_version = '1.4.32'
ext.compile_sdk = 33
ext.target_sdk = 31
ext.min_sdk = 26
ext.application_id = 'com.anytypeio.anytype'
ext.version_name = '1.0'
ext.version_code = 1
ext.test_runner = 'androidx.test.runner.AndroidJUnitRunner'
repositories {
mavenLocal()
google()
mavenCentral()
}
dependencies {
def libs = project.extensions.getByName("libs") as org.gradle.accessors.dm.LibrariesForLibs
classpath(libs.agp)
classpath(libs.kgp)
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.3'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
classpath(libs.kserialization)
classpath(libs.wire)
}
}
def testDebugAll = tasks.create("testDebugAll")
//https://www.droidcon.com/2022/03/11/reducing-gradle-boilerplate-in-multi-module-android-projects/
subprojects {
project.plugins.whenPluginAdded { plugin ->
if (plugin instanceof LibraryPlugin) {
android {
def config = rootProject.extensions.getByName("ext")
compileSdkVersion config["compile_sdk"]
defaultConfig {
minSdkVersion config["min_sdk"]
targetSdkVersion config["target_sdk"]
testInstrumentationRunner config["test_runner"]
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
}
}
plugins.withId("kotlin") {
testDebugAll.dependsOn(tasks.named("test"))
}
plugins.withId("com.android.library") {
project.apply from: "$rootDir/lint.gradle"
afterEvaluate {
testDebugAll.dependsOn(tasks.named("testDebugUnitTest"))
}
}
plugins.withId("com.android.application") {
project.apply from: "$rootDir/lint.gradle"
afterEvaluate {
testDebugAll.dependsOn(tasks.named("testDebugUnitTest"))
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
tasks.register("installGitHooks") {
setGroup("Build Setup")
setDescription("Install local repository git hooks")
exec {
commandLine 'sh', '-c', 'git config core.hooksPath .githooks'
}
}
var initialTaskNames = getProject().getGradle().getStartParameter().getTaskNames()
getProject().getGradle().getStartParameter().setTaskNames(
initialTaskNames + Collections.singletonList("installGitHooks"))