forked from jakepurple13/OtakuWorld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
86 lines (76 loc) · 2.83 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
gradlePluginPortal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
classpath(libs.google.services)
classpath(libs.firebase.crashlytics.gradle)
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${libs.versions.latestAboutLibsRelease.get()}")
classpath("org.jetbrains.kotlin:kotlin-serialization:${libs.versions.kotlin.get()}")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath(libs.navigation.safe.args.gradle.plugin)
}
}
subprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
compilerOptions {
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.layout.buildDirectory.get().asFile.absolutePath + "/compose_metrics"
)
}
}
afterEvaluate {
when {
plugins.hasPlugin("otaku-library") -> {
println("Otaku Library")
}
plugins.hasPlugin("otaku-application") -> configureAndroidBasePlugin()
plugins.hasPlugin("otaku-multiplatform") -> {
println("Otaku Multiplatform Library")
}
}
}
}
fun Project.configureAndroidBasePlugin() {
composeFeatureFlags()
extensions.findByType<com.android.build.gradle.BaseExtension>()?.apply {
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
dependencies {
val coreLibraryDesugaring by configurations
coreLibraryDesugaring(libs.coreLibraryDesugaring)
}
}
}
fun Project.composeFeatureFlags() {
extensions.findByType(ComposeCompilerGradlePluginExtension::class.java)?.apply {
featureFlags.add(ComposeFeatureFlag.StrongSkipping)
}
}
tasks.register("clean").configure {
delete("build")
}
plugins {
id("io.github.jakepurple13.ProjectInfo") version "1.1.1"
//id("org.jetbrains.compose") version libs.versions.jetbrainsCompiler apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.google.android.libraries.mapsplatform.secrets.gradle.plugin) apply false
alias(libs.plugins.google.firebase.performance) apply false
}
projectInfo {
filter {
exclude("otakumanager/**")
excludeFileTypes("png", "webp", "ttf", "json")
}
showTopCount = 3
}