This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 322
/
build.gradle.kts
executable file
·92 lines (79 loc) · 3.04 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
87
88
89
90
91
92
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@file:Suppress("UnstableApiUsage")
import com.itsaky.androidide.build.config.BuildConfig
import com.itsaky.androidide.build.config.FDroidConfig
import com.itsaky.androidide.build.config.publishingVersion
import com.itsaky.androidide.plugins.AndroidIDEPlugin
import com.itsaky.androidide.plugins.conf.configureAndroidModule
import com.itsaky.androidide.plugins.conf.configureJavaModule
import com.itsaky.androidide.plugins.conf.configureMavenPublish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("build-logic.root-project")
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.gradle.publish) apply false
alias(libs.plugins.protobuf) apply false
alias(libs.plugins.benchmark) apply false
}
buildscript {
dependencies {
classpath(libs.kotlin.gradle.plugin)
classpath(libs.nav.safe.args.gradle.plugin)
}
}
// Root project has 'com.itsaky.androidide' as the group ID
project.group = BuildConfig.packageName
subprojects {
if (project != rootProject) {
var group = project.parent!!.group
if (project.parent != rootProject) {
group = "${group}.${project.parent!!.name}"
}
project.group = group
}
// Always load the F-Droid config
FDroidConfig.load(project)
afterEvaluate {
apply { plugin(AndroidIDEPlugin::class.java) }
}
project.version = rootProject.version
plugins.withId("com.android.application") {
configureAndroidModule(libs.androidx.libDesugaring)
}
plugins.withId("com.android.library") {
configureAndroidModule(libs.androidx.libDesugaring)
}
plugins.withId("java-library") { configureJavaModule() }
plugins.withId("com.vanniktech.maven.publish.base") { configureMavenPublish() }
plugins.withId("com.gradle.plugin-publish") {
configure<GradlePluginDevelopmentExtension> {
version = project.publishingVersion
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = BuildConfig.javaVersion.toString()
freeCompilerArgs += "-Xstring-concat=inline"
}
}
}
tasks.register<Delete>("clean") { delete(rootProject.layout.buildDirectory) }