diff --git a/annotation-processors/build.gradle.kts b/annotation-processors/build.gradle.kts index de7d778ddc..da709dc2ca 100644 --- a/annotation-processors/build.gradle.kts +++ b/annotation-processors/build.gradle.kts @@ -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 { @@ -45,5 +46,5 @@ dependencies { } tasks.withType { - kotlinOptions.jvmTarget = "17" + compilerOptions.jvmTarget.set(JvmTarget.JVM_17) } diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b37f62c183..60c0fc93c4 100755 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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 @@ -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) @@ -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) diff --git a/composite-builds/build-deps/java-compiler/build.gradle.kts b/composite-builds/build-deps/java-compiler/build.gradle.kts index 3a7714abdb..03743a2d50 100644 --- a/composite-builds/build-deps/java-compiler/build.gradle.kts +++ b/composite-builds/build-deps/java-compiler/build.gradle.kts @@ -16,10 +16,15 @@ */ plugins { - id("java-library") + id("java-library") } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} \ No newline at end of file + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + annotationProcessor(libs.google.auto.service) + implementation(libs.google.auto.service.annotations) +} diff --git a/composite-builds/build-deps/java-compiler/src/main/java/javac/internal/jrtfs/JrtFileSystemProvider.java b/composite-builds/build-deps/java-compiler/src/main/java/javac/internal/jrtfs/JrtFileSystemProvider.java index d122fbb0af..d48a738e5e 100644 --- a/composite-builds/build-deps/java-compiler/src/main/java/javac/internal/jrtfs/JrtFileSystemProvider.java +++ b/composite-builds/build-deps/java-compiler/src/main/java/javac/internal/jrtfs/JrtFileSystemProvider.java @@ -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; @@ -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; diff --git a/composite-builds/build-logic/desugaring/build.gradle.kts b/composite-builds/build-logic/desugaring/build.gradle.kts index bb17148415..1d5bf29482 100644 --- a/composite-builds/build-logic/desugaring/build.gradle.kts +++ b/composite-builds/build-logic/desugaring/build.gradle.kts @@ -1,3 +1,6 @@ +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + /* * This file is part of AndroidIDE. * @@ -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 { + compilerOptions { + apiVersion.set(KotlinVersion.KOTLIN_2_1) + languageVersion.set(KotlinVersion.KOTLIN_2_1) + } } + diff --git a/composite-builds/build-logic/desugaring/src/main/java/com/itsaky/androidide/desugaring/DesugarClassVisitor.kt b/composite-builds/build-logic/desugaring/src/main/java/com/itsaky/androidide/desugaring/DesugarClassVisitor.kt index 67737a2c46..62b157611c 100644 --- a/composite-builds/build-logic/desugaring/src/main/java/com/itsaky/androidide/desugaring/DesugarClassVisitor.kt +++ b/composite-builds/build-logic/desugaring/src/main/java/com/itsaky/androidide/desugaring/DesugarClassVisitor.kt @@ -14,8 +14,10 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ + package com.itsaky.androidide.desugaring +import DesugarParams import com.android.build.api.instrumentation.ClassContext import org.objectweb.asm.ClassVisitor import org.objectweb.asm.FieldVisitor @@ -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( diff --git a/composite-builds/build-logic/desugaring/src/main/java/com/itsaky/androidide/desugaring/dsl/ReplaceClassRef.kt b/composite-builds/build-logic/desugaring/src/main/java/com/itsaky/androidide/desugaring/dsl/ReplaceClassRef.kt new file mode 100644 index 0000000000..224ab00ebe --- /dev/null +++ b/composite-builds/build-logic/desugaring/src/main/java/com/itsaky/androidide/desugaring/dsl/ReplaceClassRef.kt @@ -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('.', '/') +} \ No newline at end of file diff --git a/composite-builds/build-logic/plugins/build.gradle.kts b/composite-builds/build-logic/plugins/build.gradle.kts index 409aac8403..f0a9d2e804 100644 --- a/composite-builds/build-logic/plugins/build.gradle.kts +++ b/composite-builds/build-logic/plugins/build.gradle.kts @@ -97,3 +97,12 @@ gradlePlugin { } } } + +tasks.withType { + 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") + } +} diff --git a/git-core/build.gradle.kts b/git-core/build.gradle.kts index a6b5136642..b24369091c 100644 --- a/git-core/build.gradle.kts +++ b/git-core/build.gradle.kts @@ -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 { @@ -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) } diff --git a/gradle.properties b/gradle.properties index 925c52d5d5..a398853a74 100755 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 30bb172a63..144a3736dd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" @@ -35,7 +35,7 @@ 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" @@ -43,7 +43,7 @@ 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" @@ -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" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c0cb293e89..692c2dc230 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/llama-impl/build.gradle.kts b/llama-impl/build.gradle.kts index 6a36589b76..0b1439bcc4 100644 --- a/llama-impl/build.gradle.kts +++ b/llama-impl/build.gradle.kts @@ -1,68 +1,58 @@ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") + id("com.android.library") + id("org.jetbrains.kotlin.android") } android { - namespace = "android.llama.cpp" - compileSdk = 35 + namespace = "android.llama.cpp" - defaultConfig { - minSdk = 33 - consumerProguardFiles("proguard-rules.pro") - ndk { - // Add NDK properties if wanted, e.g. - // abiFilters += listOf("arm64-v8a") - } - externalNativeBuild { - cmake { - arguments += "-DLLAMA_CURL=OFF" - arguments += "-DLLAMA_BUILD_COMMON=ON" - arguments += "-DGGML_LLAMAFILE=OFF" - arguments += "-DCMAKE_BUILD_TYPE=Release" - cppFlags += listOf() - arguments += listOf() + defaultConfig { + minSdk = 33 + consumerProguardFiles("proguard-rules.pro") + ndk { + // Add NDK properties if wanted, e.g. + // abiFilters += listOf("arm64-v8a") + } + externalNativeBuild { + cmake { + arguments += "-DLLAMA_CURL=OFF" + arguments += "-DLLAMA_BUILD_COMMON=ON" + arguments += "-DGGML_LLAMAFILE=OFF" + arguments += "-DCMAKE_BUILD_TYPE=Release" + cppFlags += listOf() + arguments += listOf() - cppFlags("") - } - } - } + cppFlags("") + } + } + } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - } - } - externalNativeBuild { - cmake { - path("src/main/cpp/CMakeLists.txt") - version = "3.22.1" - } - } - compileOptions { - // It's fine for the library to be compiled with modern features - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = "1.8" - } + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) + } + } + externalNativeBuild { + cmake { + path("src/main/cpp/CMakeLists.txt") + version = "3.22.1" + } + } - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } } dependencies { - implementation(project(":llama-api")) - implementation(libs.androidx.core.ktx.v1120) - implementation(libs.androidx.appcompat.v171) - implementation(libs.tooling.slf4j) - + implementation(project(":llama-api")) + implementation(libs.androidx.core.ktx.v1120) + implementation(libs.androidx.appcompat.v171) + implementation(libs.tooling.slf4j) } diff --git a/lsp/kotlin-core/build.gradle.kts b/lsp/kotlin-core/build.gradle.kts index df2bb81208..29489689fc 100644 --- a/lsp/kotlin-core/build.gradle.kts +++ b/lsp/kotlin-core/build.gradle.kts @@ -23,11 +23,11 @@ plugins { android { namespace = "org.appdevforall.codeonthego.lsp.kotlin" +} - kotlinOptions { - freeCompilerArgs += listOf( - "-opt-in=kotlin.contracts.ExperimentalContracts" - ) +kotlin { + compilerOptions { + freeCompilerArgs.add("-opt-in=kotlin.contracts.ExperimentalContracts") } } diff --git a/lsp/kotlin/build.gradle.kts b/lsp/kotlin/build.gradle.kts index 9de97e6c31..d111677334 100644 --- a/lsp/kotlin/build.gradle.kts +++ b/lsp/kotlin/build.gradle.kts @@ -55,6 +55,7 @@ dependencies { implementation(projects.lsp.api) implementation(projects.lsp.models) implementation(projects.eventbusEvents) + implementation(projects.subprojects.kotlinAnalysisApi) implementation(projects.shared) implementation(projects.subprojects.projects) implementation(projects.subprojects.projectModels) diff --git a/plugin-api/build.gradle.kts b/plugin-api/build.gradle.kts index 7adab325d9..878e7d7f44 100644 --- a/plugin-api/build.gradle.kts +++ b/plugin-api/build.gradle.kts @@ -1,39 +1,23 @@ - - plugins { - id("com.android.library") - id("kotlin-android") - id("kotlin-parcelize") + id("com.android.library") + id("kotlin-android") + id("kotlin-parcelize") } android { - namespace = "com.itsaky.androidide.plugins.api" - compileSdk = 35 - - defaultConfig { - minSdk = 28 - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = "17" - } + namespace = "com.itsaky.androidide.plugins.api" } dependencies { - // Only include Android context for basic Android functionality - compileOnly("androidx.appcompat:appcompat:1.6.1") - compileOnly("androidx.fragment:fragment-ktx:1.6.2") - compileOnly("com.google.android.material:material:1.11.0") + // Only include Android context for basic Android functionality + compileOnly("androidx.appcompat:appcompat:1.6.1") + compileOnly("androidx.fragment:fragment-ktx:1.6.2") + compileOnly("com.google.android.material:material:1.11.0") } tasks.register("createPluginApiJar") { - dependsOn("assembleRelease") - from(layout.buildDirectory.file("intermediates/aar_main_jar/release/syncReleaseLibJars/classes.jar")) - into(layout.buildDirectory.dir("libs")) - rename { "plugin-api-1.0.0.jar" } -} \ No newline at end of file + dependsOn("assembleRelease") + from(layout.buildDirectory.file("intermediates/aar_main_jar/release/syncReleaseLibJars/classes.jar")) + into(layout.buildDirectory.dir("libs")) + rename { "plugin-api-1.0.0.jar" } +} diff --git a/plugin-manager/build.gradle.kts b/plugin-manager/build.gradle.kts index 4def49e6da..278fd96d41 100644 --- a/plugin-manager/build.gradle.kts +++ b/plugin-manager/build.gradle.kts @@ -1,48 +1,31 @@ - - import com.itsaky.androidide.build.config.BuildConfig plugins { - id("com.android.library") - id("kotlin-android") + id("com.android.library") + id("kotlin-android") } android { - namespace = "${BuildConfig.PACKAGE_NAME}.plugins.manager" - - compileSdk = BuildConfig.COMPILE_SDK - - defaultConfig { - minSdk = BuildConfig.MIN_SDK - } - - compileOptions { - sourceCompatibility = BuildConfig.JAVA_VERSION - targetCompatibility = BuildConfig.JAVA_VERSION - } + namespace = "${BuildConfig.PACKAGE_NAME}.plugins.manager" - kotlinOptions { - jvmTarget = BuildConfig.JAVA_VERSION.toString() - } - - lint { - abortOnError = false - } + lint { + abortOnError = false + } } dependencies { - api(projects.pluginApi) - - implementation(projects.actions) - implementation(projects.common) - implementation(projects.logger) - implementation(projects.lookup) - implementation(projects.preferences) - implementation(projects.resources) - implementation(projects.idetooltips) - implementation(projects.shared) - implementation(projects.subprojects.projects) - - implementation(libs.androidx.appcompat) - implementation(libs.gson.v2101) -} \ No newline at end of file + api(projects.pluginApi) + + implementation(projects.actions) + implementation(projects.common) + implementation(projects.logger) + implementation(projects.lookup) + implementation(projects.preferences) + implementation(projects.resources) + implementation(projects.idetooltips) + implementation(projects.shared) + implementation(projects.subprojects.projects) + + implementation(libs.androidx.appcompat) + implementation(libs.gson.v2101) +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 247903307d..dfb9c6f997 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -38,25 +38,25 @@ dependencyResolutionManagement { val dependencySubstitutions = mapOf( "build-deps" to - arrayOf( - "appintro", - "fuzzysearch", - "google-java-format", - "java-compiler", - "javac", - "javapoet", - "jaxp", - "jdk-compiler", - "jdk-jdeps", - "jdt", - "layoutlib-api", - "treeview", - ), + arrayOf( + "appintro", + "fuzzysearch", + "google-java-format", + "java-compiler", + "javac", + "javapoet", + "jaxp", + "jdk-compiler", + "jdk-jdeps", + "jdt", + "layoutlib-api", + "treeview", + ), "build-deps-common" to - arrayOf( - "constants", - "desugaring-core", - ), + arrayOf( + "constants", + "desugaring-core", + ), ) for ((build, modules) in dependencySubstitutions) { @@ -123,7 +123,7 @@ include( ":eventbus", ":eventbus-android", ":eventbus-events", - ":git-core", + ":git-core", ":gradle-plugin", ":gradle-plugin-config", ":idetooltips", @@ -155,6 +155,7 @@ include( ":subprojects:flashbar", ":subprojects:framework-stubs", ":subprojects:javac-services", + ":subprojects:kotlin-analysis-api", ":subprojects:libjdwp", ":subprojects:projects", ":subprojects:project-models", @@ -185,12 +186,12 @@ include( ":plugin-api", ":plugin-api:plugin-builder", ":plugin-manager", - ":llama-api", - ":llama-impl", - ":cv-image-to-xml", - ":llama-api", - ":llama-impl", - ":compose-preview" + ":llama-api", + ":llama-impl", + ":cv-image-to-xml", + ":llama-api", + ":llama-impl", + ":compose-preview" ) object FDroidConfig { diff --git a/subprojects/kotlin-analysis-api/.gitignore b/subprojects/kotlin-analysis-api/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/subprojects/kotlin-analysis-api/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/subprojects/kotlin-analysis-api/build.gradle.kts b/subprojects/kotlin-analysis-api/build.gradle.kts new file mode 100644 index 0000000000..831315b588 --- /dev/null +++ b/subprojects/kotlin-analysis-api/build.gradle.kts @@ -0,0 +1,28 @@ +import com.itsaky.androidide.build.config.BuildConfig +import com.itsaky.androidide.plugins.extension.AssetSource + +plugins { + alias(libs.plugins.android.library) + id("com.itsaky.androidide.build.external-assets") +} + +android { + namespace = "${BuildConfig.PACKAGE_NAME}.kt.analysis" +} + +val ktAndroidRepo = "https://github.com/appdevforall/kotlin-android" +val ktAndroidVersion = "2.3.255" +val ktAndroidTag = "v${ktAndroidVersion}-f047b07" +val ktAndroidJarName = "analysis-api-standalone-embeddable-for-ide-${ktAndroidVersion}-SNAPSHOT.jar" + +externalAssets { + jarDependency("kt-android") { + configuration = "api" + source = + AssetSource.External( + url = uri("$ktAndroidRepo/releases/download/$ktAndroidTag/$ktAndroidJarName"), + sha256Checksum = "c9897c94ae1431fadeb4fa5b05dd4d478a60c4589f38f801e07c72405a7b34b1", + ) + } +} + diff --git a/subprojects/kotlin-analysis-api/consumer-rules.pro b/subprojects/kotlin-analysis-api/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/subprojects/kotlin-analysis-api/proguard-rules.pro b/subprojects/kotlin-analysis-api/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/subprojects/kotlin-analysis-api/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file