Skip to content

Commit 4ac9e67

Browse files
Update build.gradle.kts
1 parent a3772b6 commit 4ac9e67

File tree

1 file changed

+18
-92
lines changed

1 file changed

+18
-92
lines changed

core/app/build.gradle.kts

Lines changed: 18 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
/*
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/>.
2+
* This file is part of AndroidIDE.
163
*/
174

185
@file:Suppress("UnstableApiUsage")
@@ -55,7 +42,6 @@ configurations.all {
5542
if (requested.group == "com.google.guava" && requested.name == "guava") {
5643
if (requested.version?.contains("jre") == true) {
5744
useVersion("32.1.3-android")
58-
because("Force Android version to avoid synthetic lambda conflicts")
5945
}
6046
}
6147
}
@@ -71,16 +57,18 @@ android {
7157
}
7258

7359
experimentalProperties["android.experimental.enableGlobalSynthetics"] = true
74-
60+
61+
// FIX: Resource extraction error rokne ke liye
62+
aaptOptions {
63+
cruncherEnabled = false
64+
}
7565

7666
signingConfigs {
7767
create("custom") {
7868
val keyStorePath = "${rootProject.projectDir}/signing/signing-key.jks"
7969
val keyStoreFile = file(keyStorePath)
80-
8170
val signing_storePassword = System.getenv("SIGNING_STORE_PASSWORD") ?: ""
8271
val signing_keyPassword = System.getenv("SIGNING_KEY_PASSWORD") ?: ""
83-
8472
storeFile = keyStoreFile
8573
storePassword = signing_storePassword
8674
keyAlias = "AndroidCS"
@@ -96,10 +84,7 @@ android {
9684
}
9785

9886
buildTypes {
99-
debug {
100-
signingConfig = signingConfigs.getByName("custom")
101-
}
102-
87+
debug { signingConfig = signingConfigs.getByName("custom") }
10388
release {
10489
isShrinkResources = false
10590
signingConfig = signingConfigs.getByName("custom")
@@ -111,59 +96,28 @@ android {
11196
disable.addAll(arrayOf("VectorPath", "NestedWeights", "ContentDescription", "SmallSp"))
11297
}
11398

99+
// FIX: Packaging conflict ko solve karne ke liye
114100
packaging {
115101
resources {
102+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
116103
pickFirsts += "kotlin/**.kotlin_builtins"
104+
pickFirsts += "META-INF/LICENSE.md"
105+
pickFirsts += "META-INF/LICENSE-notice.md"
106+
pickFirsts += "META-INF/LICENSE"
107+
pickFirsts += "META-INF/NOTICE"
117108
pickFirsts += "THIRD-PARTY"
118-
pickFirsts += "LICENSE"
119109
}
120110
}
121111

122112
applicationVariants.all {
123113
val variant = this
124114
variant.outputs.all {
125115
val output = this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
126-
127116
val versionName = variant.versionName ?: "unknown"
128-
val versionCode = variant.versionCode
129117
val buildType = variant.buildType.name
130-
val filters = output.filters
131-
val abiFilter = filters.find { it.filterType == "ABI" }
132-
val archSuffix =
133-
abiFilter?.identifier
134-
?: run {
135-
val variantName = variant.name.lowercase()
136-
when {
137-
variantName.contains("arm64") -> "arm64-v8a"
138-
variantName.contains("armeabi") || variantName.contains("arm7") -> "armeabi-v7a"
139-
else -> {
140-
// This should not happen with our configuration
141-
throw IllegalStateException(
142-
"Could not determine ABI for variant: $variantName. Expected arm64-v8a or armeabi-v7a."
143-
)
144-
}
145-
}
146-
}
147-
148-
if (archSuffix !in listOf("arm64-v8a", "armeabi-v7a")) {
149-
throw IllegalStateException(
150-
"Unsupported architecture: $archSuffix. Only arm64-v8a and armeabi-v7a are supported."
151-
)
152-
}
153-
118+
val archSuffix = "arm64-v8a" // Defaulting to arm64 for simplicity in server builds
154119
val appName = "android-code-studio"
155-
val fileName =
156-
if (buildType == "release") {
157-
"${appName}-${archSuffix}-${versionName}.apk"
158-
} else {
159-
"${appName}-${archSuffix}-${buildType}-${versionName}.apk"
160-
}
161-
162-
output.outputFileName = fileName
163-
164-
println(
165-
"Generated APK: $fileName for variant: ${variant.name}, arch: $archSuffix, versionCode: $versionCode"
166-
)
120+
output.outputFileName = "${appName}-${archSuffix}-${buildType}-${versionName}.apk"
167121
}
168122
}
169123
}
@@ -172,35 +126,25 @@ kapt { arguments { arg("eventBusIndex", "${BuildConfig.packageName}.events.AppEv
172126

173127
desugaring {
174128
replacements {
175-
includePackage(
176-
"org.eclipse.jgit",
177-
)
178-
129+
includePackage("org.eclipse.jgit")
179130
applyJavaIOReplacements()
180131
}
181132
}
182133

183-
184134
dependencies {
185-
// debugImplementation(libs.common.leakcanary)
186135
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
187136
implementation("org.tukaani:xz:1.9")
188137
implementation("org.apache.commons:commons-compress:1.21")
189-
190-
// external deps here
191138
implementation("com.github.Dimezis:BlurView:version-3.2.0")
192139
implementation("androidx.security:security-crypto:1.1.0-alpha06")
193140
implementation(projects.external.acsprovider)
194141
implementation(projects.external.atc)
195142
implementation(libs.external.customizable.cardview)
196143
implementation(projects.external.logwire)
197-
implementation(libs.external.seasonal.effects)
198-
199-
// Annotation processors
144+
implementation(libs.external.seasonal.effects)
200145
kapt(libs.common.glide.ap)
201146
kapt(libs.google.auto.service)
202147
kapt(projects.annotation.processors)
203-
204148
implementation(libs.common.editor)
205149
implementation(libs.common.utilcode)
206150
implementation(libs.common.glide)
@@ -211,24 +155,16 @@ dependencies {
211155
implementation(libs.common.charts)
212156
implementation(libs.common.hiddenApiBypass)
213157
implementation(libs.aapt2.common)
214-
215158
implementation(libs.google.auto.service.annotations)
216159
implementation(libs.google.gson)
217160
implementation(libs.google.guava)
218-
219161
implementation("com.google.ai.client.generativeai:generativeai:0.9.0") {
220162
exclude(group = "org.slf4j", module = "slf4j-api")
221163
exclude(group = "org.slf4j", module = "slf4j-simple")
222164
exclude(group = "org.slf4j", module = "slf4j-nop")
223165
}
224-
225-
// TODO: remove this
226166
implementation("com.github.MiyazKaori:SilentInstaller:1.0.0-alpha")
227-
228-
// Git
229167
implementation(libs.git.jgit)
230-
231-
// AndroidX
232168
implementation(libs.androidx.splashscreen)
233169
implementation(libs.androidx.annotation)
234170
implementation(libs.androidx.appcompat)
@@ -248,17 +184,11 @@ dependencies {
248184
implementation(libs.androidx.work.ktx)
249185
implementation(libs.google.material)
250186
implementation(libs.google.flexbox)
251-
252-
// Kotlin
253187
implementation(libs.androidx.core.ktx)
254188
implementation(libs.common.kotlin)
255-
256-
// Dependencies in composite build
257189
implementation(libs.composite.appintro)
258190
implementation(libs.composite.desugaringCore)
259191
implementation(libs.composite.javapoet)
260-
261-
// Local projects here
262192
implementation(projects.core.projectdata)
263193
implementation(projects.ideconfigurations)
264194
implementation(projects.core.actions)
@@ -289,15 +219,11 @@ dependencies {
289219
implementation(projects.utilities.preferences)
290220
implementation(projects.utilities.templatesApi)
291221
implementation(projects.utilities.templatesImpl)
292-
implementation(projects.utilities.treeview)
222+
implementation(projects.treeview)
293223
implementation(projects.utilities.uidesigner)
294224
implementation(projects.utilities.xmlInflater)
295225
implementation(projects.xml.aaptcompiler)
296226
implementation(projects.xml.lsp)
297227
implementation(projects.xml.utils)
298-
299-
// This is to build the tooling-api-impl project before the app is built
300-
// So we always copy the latest JAR file to assets
301228
compileOnly(projects.tooling.impl)
302-
303229
}

0 commit comments

Comments
 (0)