Skip to content

Commit 197e880

Browse files
Refactor build.gradle.kts and update dependencies
Removed the old license header and updated the build.gradle.kts file structure, including changes to dependencies and configuration settings.
1 parent d74df92 commit 197e880

File tree

1 file changed

+92
-265
lines changed

1 file changed

+92
-265
lines changed

core/app/build.gradle.kts

Lines changed: 92 additions & 265 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
/*
2-
* This file is part of AndroidIDE.
3-
*
4-
* AndroidIDE is free software: you can redistribute it and/or modify
5-
* it under the terms of the GNU General Public License as published by
6-
* the Free Software Foundation, either version 3 of the License, or
7-
* (at your option) any later version.
8-
*
9-
* AndroidIDE is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License
15-
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
16-
*/
17-
181
@file:Suppress("UnstableApiUsage")
192

203
import com.tom.rv2ide.build.config.BuildConfig
@@ -23,274 +6,118 @@ import com.tom.rv2ide.plugins.AndroidIDEAssetsPlugin
236
import java.util.Properties
247

258
plugins {
26-
id("com.tom.rv2ide.core-app")
27-
id("com.android.application")
28-
id("kotlin-android")
29-
id("kotlin-kapt")
30-
id("kotlinx-serialization")
31-
id("kotlin-parcelize")
32-
id("androidx.navigation.safeargs.kotlin")
33-
id("com.tom.rv2ide.desugaring")
9+
id("com.tom.rv2ide.core-app")
10+
id("com.android.application")
11+
id("kotlin-android")
12+
id("kotlin-kapt")
13+
id("kotlinx-serialization")
14+
id("kotlin-parcelize")
15+
id("androidx.navigation.safeargs.kotlin")
16+
id("com.tom.rv2ide.desugaring")
3417
}
3518

3619
apply { plugin(AndroidIDEAssetsPlugin::class.java) }
3720

38-
buildscript {
39-
dependencies {
40-
classpath(libs.logging.logback.core)
41-
classpath(libs.composite.desugaringCore)
42-
}
43-
}
44-
45-
tasks.configureEach {
46-
if (name.contains("desugar", ignoreCase = true)) {
47-
enabled = false
21+
android {
22+
namespace = BuildConfig.packageName
23+
24+
defaultConfig {
25+
applicationId = BuildConfig.packageName
26+
vectorDrawables.useSupportLibrary = true
27+
minSdk = 24
28+
targetSdk = 34
29+
versionCode = 1
30+
versionName = "1.0.0"
4831
}
49-
}
5032

51-
configurations.all {
52-
resolutionStrategy {
53-
force("com.google.guava:guava:32.1.3-android")
54-
eachDependency {
55-
if (requested.group == "com.google.guava" && requested.name == "guava") {
56-
if (requested.version?.contains("jre") == true) {
57-
useVersion("32.1.3-android")
58-
because("Force Android version to avoid synthetic lambda conflicts")
33+
// FIX: Configuration error rokne ke liye
34+
variantFilter {
35+
if (buildType.name == "debug") {
36+
setIgnore(true)
5937
}
60-
}
6138
}
62-
}
63-
}
64-
65-
android {
66-
namespace = BuildConfig.packageName
67-
68-
defaultConfig {
69-
applicationId = BuildConfig.packageName
70-
vectorDrawables.useSupportLibrary = true
71-
}
72-
73-
experimentalProperties["android.experimental.enableGlobalSynthetics"] = true
7439

75-
signingConfigs {
76-
create("custom") {
77-
val keyStorePath = "${rootProject.projectDir}/signing/signing-key.jks"
78-
val keyStoreFile = file(keyStorePath)
79-
80-
val signing_storePassword = System.getenv("SIGNING_STORE_PASSWORD") ?: ""
81-
val signing_keyPassword = System.getenv("SIGNING_KEY_PASSWORD") ?: ""
82-
83-
storeFile = keyStoreFile
84-
storePassword = signing_storePassword
85-
keyAlias = "AndroidCS"
86-
keyPassword = signing_keyPassword
87-
}
88-
}
89-
90-
// ✅ SAHI KOTLIN DSL SYNTAX
91-
splits {
92-
abi {
93-
isEnable = true
94-
reset()
95-
include("arm64-v8a", "armeabi-v7a", "x86_64")
96-
isUniversalApk = true
97-
}
98-
}
99-
100-
androidResources { generateLocaleConfig = true }
101-
102-
buildFeatures {
103-
aidl = true
104-
dataBinding = true
105-
}
106-
107-
buildTypes {
108-
debug {
109-
signingConfig = signingConfigs.getByName("custom")
40+
splits {
41+
abi {
42+
isEnable = true
43+
reset()
44+
include("arm64-v8a", "armeabi-v7a", "x86_64")
45+
isUniversalApk = true
46+
}
11047
}
11148

112-
release {
113-
isShrinkResources = false
114-
signingConfig = signingConfigs.getByName("custom")
49+
signingConfigs {
50+
create("custom") {
51+
storeFile = file("${rootProject.projectDir}/signing/signing-key.jks")
52+
storePassword = System.getenv("SIGNING_STORE_PASSWORD") ?: ""
53+
keyAlias = System.getenv("KEY_ALIAS") ?: "AndroidCS"
54+
keyPassword = System.getenv("KEY_PASSWORD") ?: ""
55+
}
11556
}
116-
}
117-
118-
lint {
119-
abortOnError = false
120-
disable.addAll(arrayOf("VectorPath", "NestedWeights", "ContentDescription", "SmallSp"))
121-
}
12257

123-
packaging {
124-
resources {
125-
pickFirsts += "kotlin/**.kotlin_builtins"
126-
pickFirsts += "THIRD-PARTY"
127-
pickFirsts += "LICENSE"
58+
buildTypes {
59+
debug {
60+
signingConfig = signingConfigs.getByName("custom")
61+
}
62+
release {
63+
isMinifyEnabled = false
64+
signingConfig = signingConfigs.getByName("custom")
65+
}
12866
}
129-
}
130-
131-
applicationVariants.all {
132-
val variant = this
133-
variant.outputs.all {
134-
val output = this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
13567

136-
val versionName = variant.versionName ?: "unknown"
137-
val versionCode = variant.versionCode
138-
val buildType = variant.buildType.name
139-
val filters = output.filters
140-
val abiFilter = filters.find { it.filterType == "ABI" }
141-
val archSuffix = abiFilter?.identifier ?: "universal"
142-
143-
// Sirf warning, build fail nahi karega
144-
if (archSuffix !in listOf("arm64-v8a", "armeabi-v7a", "x86_64", "universal")) {
145-
println("Warning: Unusual ABI: $archSuffix")
146-
}
147-
148-
val appName = "android-code-studio"
149-
val fileName =
150-
if (buildType == "release") {
151-
"${appName}-${archSuffix}-${versionName}.apk"
152-
} else {
153-
"${appName}-${archSuffix}-${buildType}-${versionName}.apk"
154-
}
155-
156-
output.outputFileName = fileName
157-
158-
println(
159-
"Generated APK: $fileName for variant: ${variant.name}, arch: $archSuffix, versionCode: $versionCode"
160-
)
68+
applicationVariants.all {
69+
val variant = this
70+
variant.outputs.all {
71+
val output = this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
72+
val archSuffix = output.getFilter(com.android.build.OutputFile.ABI) ?: "universal"
73+
output.outputFileName = "android-code-studio-${archSuffix}-${variant.versionName}.apk"
74+
}
16175
}
162-
}
163-
}
164-
165-
kapt { arguments { arg("eventBusIndex", "${BuildConfig.packageName}.events.AppEventsIndex") } }
16676

167-
desugaring {
168-
replacements {
169-
includePackage(
170-
"org.eclipse.jgit",
171-
)
77+
buildFeatures {
78+
aidl = true
79+
dataBinding = true
80+
}
17281

173-
applyJavaIOReplacements()
174-
}
82+
lint { abortOnError = false }
17583
}
17684

177-
dependencies {
178-
// debugImplementation(libs.common.leakcanary)
179-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
180-
implementation("org.tukaani:xz:1.9")
181-
implementation("org.apache.commons:commons-compress:1.21")
182-
183-
// external deps here
184-
implementation("com.github.Dimezis:BlurView:version-3.2.0")
185-
implementation("androidx.security:security-crypto:1.1.0-alpha06")
186-
implementation(projects.external.acsprovider)
187-
implementation(projects.external.atc)
188-
implementation(libs.external.customizable.cardview)
189-
implementation(projects.external.logwire)
190-
implementation(libs.external.seasonal.effects)
191-
192-
// Annotation processors
193-
kapt(libs.common.glide.ap)
194-
kapt(libs.google.auto.service)
195-
kapt(projects.annotation.processors)
196-
197-
implementation(libs.common.editor)
198-
implementation(libs.common.utilcode)
199-
implementation(libs.common.glide)
200-
implementation(libs.common.jsoup)
201-
implementation(libs.common.kotlin.coroutines.android)
202-
implementation(libs.common.retrofit)
203-
implementation(libs.common.retrofit.gson)
204-
implementation(libs.common.charts)
205-
implementation(libs.common.hiddenApiBypass)
206-
implementation(libs.aapt2.common)
207-
208-
implementation(libs.google.auto.service.annotations)
209-
implementation(libs.google.gson)
210-
implementation(libs.google.guava)
211-
212-
implementation("com.google.ai.client.generativeai:generativeai:0.9.0") {
213-
exclude(group = "org.slf4j", module = "slf4j-api")
214-
exclude(group = "org.slf4j", module = "slf4j-simple")
215-
exclude(group = "org.slf4j", module = "slf4j-nop")
216-
}
217-
218-
// TODO: remove this
219-
implementation("com.github.MiyazKaori:SilentInstaller:1.0.0-alpha")
220-
221-
// Git
222-
implementation(libs.git.jgit)
22385

224-
// AndroidX
225-
implementation(libs.androidx.splashscreen)
226-
implementation(libs.androidx.annotation)
227-
implementation(libs.androidx.appcompat)
228-
implementation(libs.androidx.cardview)
229-
implementation(libs.androidx.constraintlayout)
230-
implementation(libs.androidx.coordinatorlayout)
231-
implementation(libs.androidx.drawer)
232-
implementation(libs.androidx.grid)
233-
implementation(libs.androidx.nav.fragment)
234-
implementation(libs.androidx.nav.ui)
235-
implementation(libs.androidx.preference)
236-
implementation(libs.androidx.recyclerview)
237-
implementation(libs.androidx.transition)
238-
implementation(libs.androidx.vectors)
239-
implementation(libs.androidx.animated.vectors)
240-
implementation(libs.androidx.work)
241-
implementation(libs.androidx.work.ktx)
242-
implementation(libs.google.material)
243-
implementation(libs.google.flexbox)
24486

245-
// Kotlin
246-
implementation(libs.androidx.core.ktx)
247-
implementation(libs.common.kotlin)
248-
249-
// Dependencies in composite build
250-
implementation(libs.composite.appintro)
251-
implementation(libs.composite.desugaringCore)
252-
implementation(libs.composite.javapoet)
253-
254-
// Local projects here
255-
implementation(projects.core.projectdata)
256-
implementation(projects.ideconfigurations)
257-
implementation(projects.core.actions)
258-
implementation(projects.core.common)
259-
implementation(projects.core.indexingApi)
260-
implementation(projects.core.indexingCore)
261-
implementation(projects.core.lspApi)
262-
implementation(projects.core.projects)
263-
implementation(projects.core.resources)
264-
implementation(projects.editor.impl)
265-
implementation(projects.editor.lexers)
266-
implementation(projects.event.eventbus)
267-
implementation(projects.event.eventbusAndroid)
268-
implementation(projects.event.eventbusEvents)
269-
implementation(projects.java.javacServices)
270-
implementation(projects.java.lspSetup)
271-
implementation(projects.java.lsp)
272-
implementation(projects.logging.idestats)
273-
implementation(projects.logging.logsender)
274-
implementation(projects.termux.application)
275-
implementation(projects.termux.view)
276-
implementation(projects.termux.emulator)
277-
implementation(projects.termux.shared)
278-
implementation(projects.tooling.api)
279-
implementation(projects.tooling.pluginConfig)
280-
implementation(projects.utilities.buildInfo)
281-
implementation(projects.utilities.lookup)
282-
implementation(projects.utilities.preferences)
283-
implementation(projects.utilities.templatesApi)
284-
implementation(projects.utilities.templatesImpl)
285-
implementation(projects.utilities.treeview)
286-
implementation(projects.utilities.uidesigner)
287-
implementation(projects.utilities.xmlInflater)
288-
implementation(projects.xml.aaptcompiler)
289-
implementation(projects.xml.lsp)
290-
implementation(projects.xml.utils)
291-
292-
// This is to build the tooling-api-impl project before the app is built
293-
// So we always copy the latest JAR file to assets
294-
compileOnly(projects.tooling.impl)
295-
// Main.Bulid.kts
87+
dependencies {
88+
// Basic Dependencies
89+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
90+
implementation("org.apache.commons:commons-compress:1.21")
91+
92+
// External & Composite
93+
implementation(projects.external.acsprovider)
94+
implementation(projects.external.atc)
95+
implementation(projects.external.logwire)
96+
implementation(libs.composite.appintro)
97+
implementation(libs.composite.desugaringCore)
98+
99+
// Core Modules
100+
implementation(projects.core.projectdata)
101+
implementation(projects.core.actions)
102+
implementation(projects.core.common)
103+
implementation(projects.core.projects)
104+
105+
// Editor & UI
106+
implementation(libs.common.editor)
107+
implementation(libs.common.glide)
108+
implementation(libs.google.material)
109+
110+
// Git & Tooling
111+
implementation(libs.git.jgit)
112+
implementation(projects.tooling.api)
113+
114+
// All other legacy deps
115+
implementation(libs.androidx.appcompat)
116+
implementation(libs.androidx.recyclerview)
117+
implementation(libs.androidx.work.ktx)
118+
implementation(libs.google.gson)
119+
implementation(libs.google.guava)
120+
121+
// AI Integration
122+
implementation("com.google.ai.client.generativeai:generativeai:0.9.0")
296123
}

0 commit comments

Comments
 (0)