Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion annotation-processors/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

import com.itsaky.androidide.build.config.BuildConfig
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -45,5 +46,5 @@ dependencies {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
}
24 changes: 22 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,29 @@ android {

packaging {
resources {
excludes.add("META-INF/DEPENDENCIES")
excludes.add("META-INF/gradle/incremental.annotation.processors")
excludes += "META-INF/DEPENDENCIES"
excludes += "META-INF/gradle/incremental.annotation.processors"

pickFirsts += "kotlin/internal/internal.kotlin_builtins"
pickFirsts += "kotlin/reflect/reflect.kotlin_builtins"
pickFirsts += "kotlin/kotlin.kotlin_builtins"
pickFirsts += "kotlin/coroutines/coroutines.kotlin_builtins"
pickFirsts += "kotlin/ranges/ranges.kotlin_builtins"
pickFirsts += "kotlin/concurrent/atomics/atomics.kotlin_builtins"
pickFirsts += "kotlin/collections/collections.kotlin_builtins"
pickFirsts += "kotlin/annotation/annotation.kotlin_builtins"

pickFirsts += "META-INF/FastDoubleParser-LICENSE"
pickFirsts += "META-INF/thirdparty-LICENSE"
pickFirsts += "META-INF/FastDoubleParser-NOTICE"
pickFirsts += "META-INF/thirdparty-NOTICE"
}

jniLibs {
useLegacyPackaging = false
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -197,6 +212,10 @@ configurations.matching { it.name.contains("AndroidTest") }.configureEach {
exclude(group = "com.google.protobuf", module = "protobuf-lite")
}

configurations.configureEach {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-android-extensions-runtime")
}

dependencies {
debugImplementation(libs.common.leakcanary)

Expand Down Expand Up @@ -278,6 +297,7 @@ dependencies {
implementation(projects.gradlePluginConfig)
implementation(projects.subprojects.aaptcompiler)
implementation(projects.subprojects.javacServices)
implementation(projects.subprojects.kotlinAnalysisApi)
implementation(projects.subprojects.shizukuApi)
implementation(projects.subprojects.shizukuManager)
implementation(projects.subprojects.shizukuProvider)
Expand Down
13 changes: 9 additions & 4 deletions composite-builds/build-deps/java-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
*/

plugins {
id("java-library")
id("java-library")
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
annotationProcessor(libs.google.auto.service)
implementation(libs.google.auto.service.annotations)
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

package javac.internal.jrtfs;

import com.google.auto.service.AutoService;

import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
Expand Down Expand Up @@ -53,6 +55,7 @@
* but also compiled and delivered as part of the jrtfs.jar to support access
* to the jimage file provided by the shipped JDK by tools running on JDK 8.
*/
@AutoService(FileSystemProvider.class)
public final class JrtFileSystemProvider extends FileSystemProvider {

private volatile FileSystem theFileSystem;
Expand Down
39 changes: 25 additions & 14 deletions composite-builds/build-logic/desugaring/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

/*
* This file is part of AndroidIDE.
*
Expand All @@ -16,26 +19,34 @@
*/

plugins {
`kotlin-dsl`
`kotlin-dsl`
}

dependencies {
implementation(gradleApi())
implementation(libs.composite.desugaringCore)
implementation(gradleApi())
implementation(libs.composite.desugaringCore)

compileOnly(libs.android.gradle.plugin)
compileOnly(libs.android.gradle.plugin)

testImplementation(libs.tests.junit)
testImplementation(libs.tests.google.truth)
testImplementation(libs.tests.junit)
testImplementation(libs.tests.google.truth)
}

gradlePlugin {
plugins {
create("desugaring") {
id = "com.itsaky.androidide.desugaring"
implementationClass = "com.itsaky.androidide.desugaring.DesugarGradlePlugin"
displayName = "AndroidIDE Method Desugaring Plugin"
description = "Gradle plugin for method desugaring in Android projects."
}
}
plugins {
create("desugaring") {
id = "com.itsaky.androidide.desugaring"
implementationClass = "com.itsaky.androidide.desugaring.DesugarGradlePlugin"
displayName = "AndroidIDE Method Desugaring Plugin"
description = "Gradle plugin for method desugaring in Android projects."
}
}
}

tasks.withType<KotlinCompile> {
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_2_1)
languageVersion.set(KotlinVersion.KOTLIN_2_1)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/

package com.itsaky.androidide.desugaring

import DesugarParams
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix unresolved DesugarParams import (build blocker).

Line 20 currently imports DesugarParams as an unqualified symbol, and the pipeline already fails with Unresolved reference 'DesugarParams'. This must reference the correct fully-qualified type (or be removed if same-package resolution is intended and valid).

🧰 Tools
🪛 GitHub Actions: Build and deploy to firebase app distribution

[error] 20-20: Kotlin compilation failed: Unresolved reference 'DesugarParams'.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composite-builds/build-logic/desugaring/src/main/java/com/itsaky/androidide/desugaring/DesugarClassVisitor.kt`
at line 20, The unresolved import for DesugarParams in DesugarClassVisitor.kt
means the import is unqualified; fix it by replacing the bare import with the
correct fully-qualified type import (or remove the import if DesugarParams is
defined in the same package as DesugarClassVisitor). Locate the DesugarParams
declaration and update the import statement in DesugarClassVisitor.kt to
reference that package (e.g., import <actual.package>.DesugarParams) so the
compiler can resolve the symbol.

import com.android.build.api.instrumentation.ClassContext
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.FieldVisitor
Expand All @@ -24,19 +26,6 @@ import org.objectweb.asm.MethodVisitor
/**
* [ClassVisitor] implementation for desugaring.
*
* Applies two transformations to every method body, in priority order:
*
* 1. **[DesugarMethodVisitor]** (outermost / highest priority) — fine-grained
* per-method-call replacement defined via [DesugarReplacementsContainer.replaceMethod].
* Its output flows into the next layer.
*
* 2. **[ClassRefReplacingMethodVisitor]** (innermost) — bulk class-reference
* replacement defined via [DesugarReplacementsContainer.replaceClass].
* Handles every site where a class name can appear in a method body.
*
* Class references that appear in field and method *declarations* (descriptors
* and generic signatures at the class-structure level) are also rewritten here.
*
* @author Akash Yadav
*/
class DesugarClassVisitor(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.itsaky.androidide.desugaring.dsl

import java.io.Serializable

/**
* Describes a full class-reference replacement: every bytecode reference to
* [fromClass] in any instrumented class will be rewritten to [toClass].
*
* Class names may be given in dot-notation (`com.example.Foo`) or
* slash-notation (`com/example/Foo`); both are normalised internally.
*
* @author Akash Yadav
*/
data class ReplaceClassRef(
/** The class whose references should be replaced (dot-notation). */
val fromClass: String,
/** The class that should replace all [fromClass] references (dot-notation). */
val toClass: String,
) : Serializable {

companion object {
@JvmField
val serialVersionUID = 1L
}

/** ASM internal name (slash-notation) for [fromClass]. */
val fromInternal: String get() = fromClass.replace('.', '/')

/** ASM internal name (slash-notation) for [toClass]. */
val toInternal: String get() = toClass.replace('.', '/')
}
9 changes: 9 additions & 0 deletions composite-builds/build-logic/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,12 @@ gradlePlugin {
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions {
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_1)
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_1)

compilerOptions.freeCompilerArgs.add("-Xuse-fir-lt=false")
}
}
38 changes: 6 additions & 32 deletions git-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}

android {
namespace = "com.itsaky.androidide.git.core"
compileSdk = 35

defaultConfig {
minSdk = 27

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
jvmTarget = "17"
}
namespace = "com.itsaky.androidide.git.core"
}

dependencies {
Expand All @@ -44,7 +18,7 @@ dependencies {
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.security.crypto)

testImplementation(libs.tests.junit)
androidTestImplementation(libs.tests.androidx.junit)
androidTestImplementation(libs.tests.androidx.espresso.core)
testImplementation(libs.tests.junit)
androidTestImplementation(libs.tests.androidx.junit)
androidTestImplementation(libs.tests.androidx.espresso.core)
}
55 changes: 24 additions & 31 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Wed Feb 02 13:50:55 IST 2022

org.gradle.jvmargs=-Xmx8G -Dkotlin.daemon.jvm.options="-Xmx4096M" -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED

# Increase memory for aapt2 to prevent Java heap space issues during asset compression
android.aapt2.daemonHeapSize=8192M
# For CI builds, set worker max to limit memory usage
org.gradle.workers.max=2
# Use less memory per worker during asset compression
org.gradle.vfs.watch=true
org.gradle.parallel=false
org.gradle.configureondemand=true
org.gradle.caching=true
android.useAndroidX=true
android.enableJetifier=false
android.jetifier.ignorelist=common-30.2.2.jar

# TODO : Migrate
android.nonTransitiveRClass=false
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# org.gradle.parallel=true
#Fri Mar 13 16:37:43 IST 2026
android.aapt2.daemonHeapSize=8192M
android.enableJetifier=false
android.jetifier.ignorelist=common-30.2.2.jar
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx8192M -Dkotlin.daemon.jvm.options\="-Xmx8192M" -XX\:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.lang\=ALL-UNNAMED --add-opens java.base/java.util\=ALL-UNNAMED --add-opens java.base/java.io\=ALL-UNNAMED
org.gradle.parallel=true
org.gradle.vfs.watch=true
org.gradle.workers.max=30
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ gson = "2.10.1"
junit-jupiter = "5.10.2"
anroidx-test-core = "2.2.0"
koinAndroid = "4.1.1"
kotlin = "2.1.21"
kotlin = "2.3.0"
kotlin-coroutines = "1.9.0"
kotlinxCoroutinesCore = "1.10.2"
kotlinxSerializationJson = "1.9.0"
Expand All @@ -35,15 +35,15 @@ editor = "0.23.6"
glide = "4.16.0"
androidx-vectordrawable = "1.2.0"
androidx-navigation = "2.7.7"
ksp = "2.1.21-2.0.2"
ksp = "2.3.6"
antlr4 = "4.13.1"
androidx-work = "2.10.0"
androidx-espresso = "3.5.1"
retrofit = "2.11.0"
markwon = "4.6.2"
maven-publish-plugin = "0.27.0"
logback = "1.5.3"
room = "2.7.2"
room = "2.8.4"
utilcodex = "1.31.1"
viewpager2 = "1.1.0-beta02"
zoomage = "1.3.1"
Expand Down Expand Up @@ -242,8 +242,8 @@ androidx-work-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "
google-material = { module = "com.google.android.material:material", version = "1.12.0" }
google-gson = { module = "com.google.code.gson:gson", version = "2.12.1" }
google-guava = { module = "com.google.guava:guava", version = "33.4.0-android" }
google-auto-value-annotations = { module = "com.google.auto.value:auto-value-annotations", version = "1.10.4" }
google-auto-value-ap = { module = "com.google.auto.value:auto-value", version = "1.10.4" }
google-auto-value-annotations = { module = "com.google.auto.value:auto-value-annotations", version = "1.11.0" }
google-auto-value-ap = { module = "com.google.auto.value:auto-value", version = "1.11.0" }
google-auto-service-annotations = { module = "com.google.auto.service:auto-service-annotations", version = "1.1.1" }
google-auto-service = { module = "com.google.auto.service:auto-service", version = "1.1.1" }
google-protobuf-java = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobuf" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading
Loading