diff --git a/.idea/compiler.xml b/.idea/compiler.xml index ae6c97958..971287d58 100755 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -11,14 +11,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ebaaa959f..a3a75363f 100755 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -144,7 +144,6 @@ - diff --git a/CHANGELOG.md b/CHANGELOG.md index e04a8bed4..11725b7fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ This is the changelog of all the releases of AndroidIDE. ## **v2.0.2-beta** (in development) ### Important notes - +- The `HOME` and `SYSROOT` directories has been renamed to `home` and `usr` respectively. +- The packages for the AndroidIDE terminal has been updated. But, it requires you to reinstall the bootstrap packages. Please follow [this](https://t.me/androidide_discussions/30564) guide to install the new bootstrap packages. +- Android 12 devices no longer need to use 32-bit build tools. You can simply reinstall AndroidIDE with 64-bit build tools. +- You can now easily open/show the `ide-environment.properties` file using the `ideenv` command. Execute : + - `ideenv -e`: To edit the environments file. Uses `nano` editor to edit. + - `ideenv -s`: To print the contents of the file in the terminal. ### Additions - Warn about empty body for the following statements : @@ -21,13 +26,18 @@ This is the changelog of all the releases of AndroidIDE. - `Generate constructor`: Allows the user to select fields from the current class, then generates a constructor with those fields as parameters. - `Remove unused imports`: Removes imports that are not used in the source file. - `Import orderer`: Organizes the imports. Thanks to @MrIkso (#180). -- XML Code formatter. Thanks to @MrIkso (#180). +- XML Code formatter. Thanks to @MrIkso (#182). - New Gradle command line options: `--build-cache` and `--offline`. Thanks to @MrIkso (#180). - Highlight IDE logs based on the log line priority. +- Option to share Build Output, App log and IDE logs as text file. +- Syntax highlighting for Kotlin and C/C++ language. Thanks to @MrIkso (#196). +- Highlight hex color code in string literals. Thanks to @MrIkso (#209). +- Save all files before executing any build process. (#209). +- New Template: Jetpack Compose. Thanks to @BanDroid (#198). - Added Brazilian Portuguese translations. Thanks to @Hakaisu (#165). ### Removals - +- `$ANDROID_HOME/cmake/bin` is no longer prefixed to the `PATH` variable. You can install now install `cmake` using `pkg install cmake`. ### Fixes - Crash when performing 'Replace all' action in editor (#158). @@ -37,15 +47,25 @@ This is the changelog of all the releases of AndroidIDE. - Fixed: Invalid log line formatting when tag to too long. - Fixed: Application crashes when layout inflation fails (#168). - Fixed: Invalid syntax highlighting for text tags in XML files. Thanks to @MrIkso (#180). +- Memory leaks in some fragments. Thanks to @MrIkso (#209). - Fixed: Extra empty `new line` gets appendend to files while saving. ### Improvements - Do not show 'Cut' & 'Paste' action if editor is not editable. +- Include `aapt2` in IDE itself. The IDE now automatically specifies 'android.aapt2FromMavenOverride' property while building projects. - Use [ported version of NetBeans' `nb-javac`](https://github.com/itsaky/nb-javac-android) for Java language server. - Removed extra Maven repository URLs from project templates. Thanks to @MrIkso (#188). +- Show progress indicator when initializing project - Update dependency versions in project templates and update the Kotlin project template image. Thanks to @BanDroid (#191). +- Ability to cache completion results for faster completions on next completion request. +- Use Gradle v7.4.2 in template projects and updated template dependencies Thanks to @MrIkso (#209). +- The project creator UI and logic has been improved (#209). +- Use of `libhook.so` is now optional and is DISABLED by default. This hook is only required if you use JDK 11 and if you have an Android 11 or lower device. +- JDK 17 is now preferred by the IDE. It looks for JDK 11 only if JDK 17 is not found on path `$SYSROOT/opt/openjdk`. - Updated Hindi translations. Thanks to @Premjit-Chowdhury (#171). - Updated Russian translation. Thansk to @AndreyKozhev (#181). +- Updated Chinese translations. Thanks to @mikofe (#192). +- Added missing translations for PT-BR. Thanks to @Frederick'XS (#176). ## **v2.0.1-beta** AndroidIDE v2.0.1-beta is here with new features, improvements and bug fixes. diff --git a/actions/build.gradle b/actions/build.gradle index 6eac471ca..653185dbf 100644 --- a/actions/build.gradle +++ b/actions/build.gradle @@ -29,8 +29,8 @@ dependencies { implementation common.editor implementation common.utilcode - implementation "androidx.core:core-ktx:1.7.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation androidx.ktx + implementation common.kotlin } repositories { mavenCentral() diff --git a/app/build.gradle b/app/build.gradle index fcc3beb97..53f494848 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -115,8 +115,8 @@ dependencies { implementation google.material // Kotlin - implementation "androidx.core:core-ktx:1.7.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation androidx.ktx + implementation common.kotlin // Local projects here implementation project (':build-tools:tooling-api') diff --git a/app/src/main/assets/data/common/tooling-api-all.jar b/app/src/main/assets/data/common/tooling-api-all.jar index 231e1c9d8..73d4f7c4e 100644 Binary files a/app/src/main/assets/data/common/tooling-api-all.jar and b/app/src/main/assets/data/common/tooling-api-all.jar differ diff --git a/app/src/main/java/com/itsaky/androidide/handlers/EditorEventListener.kt b/app/src/main/java/com/itsaky/androidide/handlers/EditorEventListener.kt index c6ad33bce..8eb056d21 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/EditorEventListener.kt +++ b/app/src/main/java/com/itsaky/androidide/handlers/EditorEventListener.kt @@ -83,23 +83,6 @@ class EditorEventListener : GradleBuildService.EventListener { } else if (event is TaskProgressEvent) { activity() .setStatus(activity().getString(string.msg_running_task, event.descriptor.taskPath)) - } else if (event is StatusEvent && event.descriptor is FileDownloadOperationDescriptor) { - val total = StudioUtils.bytesToSizeString(event.total) - val progress = StudioUtils.bytesToSizeString(event.progress) - val fileName = - URLUtil.guessFileName( - (event.descriptor as FileDownloadOperationDescriptor).uri.path, null, null) - - val status = SpannableStringBuilder() - status.append( - "[$progress/$total]", - AlignmentSpan.Standard(ALIGN_NORMAL), - SpannableStringBuilder.SPAN_EXCLUSIVE_EXCLUSIVE) - status.append( - " Download $fileName", - AlignmentSpan.Standard(ALIGN_CENTER), - SpannableStringBuilder.SPAN_EXCLUSIVE_EXCLUSIVE) - activity().setStatus(status, GravityCompat.START) } } diff --git a/build-tools/builder-model-impl/build.gradle b/build-tools/builder-model-impl/build.gradle index 69954c2ba..0fe31ab58 100644 --- a/build-tools/builder-model-impl/build.gradle +++ b/build-tools/builder-model-impl/build.gradle @@ -26,6 +26,6 @@ java { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + implementation common.jkotlin api "com.android.tools.build:builder-model:${project.property ("androidide.tooling.supportedAgpVersion")}" } \ No newline at end of file diff --git a/build-tools/tooling-api-events/build.gradle b/build-tools/tooling-api-events/build.gradle index 85f7766d1..0e78cb307 100644 --- a/build-tools/tooling-api-events/build.gradle +++ b/build-tools/tooling-api-events/build.gradle @@ -26,5 +26,5 @@ java { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + implementation common.jkotlin } \ No newline at end of file diff --git a/build-tools/tooling-api-impl/build.gradle b/build-tools/tooling-api-impl/build.gradle index e071d8eb7..9af08be58 100644 --- a/build-tools/tooling-api-impl/build.gradle +++ b/build-tools/tooling-api-impl/build.gradle @@ -69,7 +69,7 @@ dependencies { implementation project (path: ':build-tools:logger') implementation project (path: ':build-tools:tooling-api') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + implementation common.jkotlin implementation 'org.gradle:gradle-tooling-api:7.4.2' testImplementation tests.junit diff --git a/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/EventTransformer.kt b/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/EventTransformer.kt index 1c77b12da..de6c15c26 100644 --- a/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/EventTransformer.kt +++ b/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/EventTransformer.kt @@ -236,6 +236,11 @@ class EventTransformer { result.isIncremental, result.executionReasons) } + + if (result is TaskFailureResult) { + return com.itsaky.androidide.tooling.events.task.TaskFailureResult( + result.startTime, result.endTime) + } if (result is TaskExecutionResult) { return com.itsaky.androidide.tooling.events.task.TaskExecutionResult( @@ -247,11 +252,6 @@ class EventTransformer { result.skipMessage, result.startTime, result.endTime) } - if (result is TaskFailureResult) { - return com.itsaky.androidide.tooling.events.task.TaskFailureResult( - result.startTime, result.endTime) - } - return com.itsaky.androidide.tooling.events.task.TaskOperationResult( startTime = result.startTime, endTime = result.endTime) } diff --git a/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/ForwardingProgressListener.kt b/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/ForwardingProgressListener.kt index 3aa3ffbeb..550dfed08 100644 --- a/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/ForwardingProgressListener.kt +++ b/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/ForwardingProgressListener.kt @@ -27,9 +27,7 @@ import org.gradle.tooling.events.StatusEvent import org.gradle.tooling.events.configuration.ProjectConfigurationFinishEvent import org.gradle.tooling.events.configuration.ProjectConfigurationProgressEvent import org.gradle.tooling.events.configuration.ProjectConfigurationStartEvent -import org.gradle.tooling.events.download.FileDownloadFinishEvent -import org.gradle.tooling.events.download.FileDownloadProgressEvent -import org.gradle.tooling.events.download.FileDownloadStartEvent +import org.gradle.tooling.events.download.FileDownloadOperationDescriptor import org.gradle.tooling.events.task.TaskFinishEvent import org.gradle.tooling.events.task.TaskProgressEvent import org.gradle.tooling.events.task.TaskStartEvent @@ -55,6 +53,11 @@ class ForwardingProgressListener : ProgressListener { return } + // File download progress event must not be sent + if (event.descriptor is FileDownloadOperationDescriptor) { + return + } + val ideEvent: com.itsaky.androidide.tooling.events.ProgressEvent = when (event) { is ProjectConfigurationProgressEvent -> @@ -65,12 +68,6 @@ class ForwardingProgressListener : ProgressListener { EventTransformer.projectConfigurationFinish(event) else -> EventTransformer.projectConfigurationProgress(event) } - is FileDownloadProgressEvent -> - when (event) { - is FileDownloadStartEvent -> EventTransformer.fileDownloadStart(event) - is FileDownloadFinishEvent -> EventTransformer.fileDownloadFinish(event) - else -> EventTransformer.fileDownloadProgress(event) - } is TaskProgressEvent -> when (event) { is TaskStartEvent -> EventTransformer.taskStart(event) diff --git a/build-tools/tooling-api-impl/src/test/test-home/.androidide/init/model.jar b/build-tools/tooling-api-impl/src/test/test-home/.androidide/init/model.jar index b0a539f80..fb63225aa 100644 Binary files a/build-tools/tooling-api-impl/src/test/test-home/.androidide/init/model.jar and b/build-tools/tooling-api-impl/src/test/test-home/.androidide/init/model.jar differ diff --git a/build-tools/tooling-api-model/build.gradle b/build-tools/tooling-api-model/build.gradle index 0c187d3d1..5ce97bec1 100644 --- a/build-tools/tooling-api-model/build.gradle +++ b/build-tools/tooling-api-model/build.gradle @@ -36,7 +36,7 @@ dependencies { implementation project (path: ':build-tools:xml-dom') api project (path: ':build-tools:builder-model-impl') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + implementation common.jkotlin } task copyToTestDir (type: Copy) { diff --git a/build-tools/tooling-api/build.gradle b/build-tools/tooling-api/build.gradle index 21b33e89e..2f2564ee9 100644 --- a/build-tools/tooling-api/build.gradle +++ b/build-tools/tooling-api/build.gradle @@ -31,7 +31,7 @@ dependencies { api project (path: ':build-tools:tooling-api-model') api project (path: ':build-tools:tooling-api-events') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + implementation common.jkotlin testImplementation tests.junit testImplementation tests.google_truth diff --git a/build-tools/xml-dom/build.gradle b/build-tools/xml-dom/build.gradle index d58eb4610..2caa9f5a2 100644 --- a/build-tools/xml-dom/build.gradle +++ b/build-tools/xml-dom/build.gradle @@ -17,7 +17,6 @@ plugins { id 'java-library' - id 'org.jetbrains.kotlin.jvm' } java { @@ -46,16 +45,4 @@ repositories { maven { url "https://repo.eclipse.org/content/repositories/lemminx-snapshots/" } -} - -compileKotlin { - kotlinOptions { - jvmTarget = "11" - } -} - -compileTestKotlin { - kotlinOptions { - jvmTarget = "11" - } } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 0962f0407..b7d9f3f00 100755 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ import java.nio.file.Paths import java.util.stream.Collectors buildscript { - ext.kotlin_version = '1.6.21' + ext.kotlin_version = '1.7.0' project.ext { compileSdk = 31 @@ -32,7 +32,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' + classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.googlejavaformat:google-java-format:1.15.0' } diff --git a/common/build.gradle b/common/build.gradle index 32bed52af..db0e22c3d 100755 --- a/common/build.gradle +++ b/common/build.gradle @@ -35,8 +35,8 @@ dependencies { implementation androidx.vectors implementation androidx.animated_vectors - implementation "androidx.core:core-ktx:1.7.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation androidx.ktx + implementation common.kotlin api androidx.multidex diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index c6332d841..54a8af558 100755 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -14,8 +14,10 @@ ext { jsoup: 'org.jsoup:jsoup:1.14.2', antlr4: 'org.antlr:antlr4-runtime:4.9.2', javaparser: 'com.github.javaparser:javaparser-symbol-solver-core:3.24.2', - jsonrpc: 'org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.12.0', - lang3:'org.apache.commons:commons-lang3:3.12.0' + jsonrpc: 'org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.12.0', + lang3:'org.apache.commons:commons-lang3:3.12.0', + kotlin: 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.0', + jkotlin: 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' ] androidx = [ @@ -30,7 +32,8 @@ ext { recyclerview: 'androidx.recyclerview:recyclerview:1.2.1', vectors: 'androidx.vectordrawable:vectordrawable:1.1.0', animated_vectors: 'androidx.vectordrawable:vectordrawable-animated:1.1.0', - multidex: 'androidx.multidex:multidex:2.0.1' + multidex: 'androidx.multidex:multidex:2.0.1', + ktx: 'androidx.core:core-ktx:1.8.0' ] google = [ diff --git a/lsp/api/build.gradle b/lsp/api/build.gradle index 18b69f298..3d97ed36b 100644 --- a/lsp/api/build.gradle +++ b/lsp/api/build.gradle @@ -42,8 +42,8 @@ dependencies { implementation common.editor implementation project (':build-tools:fuzzysearch') - implementation "androidx.core:core-ktx:1.7.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation androidx.ktx + implementation common.kotlin api project (':build-tools:tooling-api-model') diff --git a/lsp/java/build.gradle b/lsp/java/build.gradle index 1d2fb5703..74b8f511d 100644 --- a/lsp/java/build.gradle +++ b/lsp/java/build.gradle @@ -62,8 +62,8 @@ dependencies { implementation project (path: ':build-tools:javac') implementation project (path: ':build-tools:google-java-format') - implementation "androidx.core:core-ktx:1.7.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation androidx.ktx + implementation common.kotlin testImplementation project (':lsp:testing') testImplementation project (':common') diff --git a/lsp/testing/build.gradle b/lsp/testing/build.gradle index de2e4e1bf..ce640a1a3 100644 --- a/lsp/testing/build.gradle +++ b/lsp/testing/build.gradle @@ -40,8 +40,8 @@ android { } dependencies { - implementation "androidx.core:core-ktx:1.7.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation androidx.ktx + implementation common.kotlin implementation project(':lsp:api') implementation project(':actions') diff --git a/lsp/xml/build.gradle b/lsp/xml/build.gradle index a3c695d90..22ed2d806 100644 --- a/lsp/xml/build.gradle +++ b/lsp/xml/build.gradle @@ -58,8 +58,8 @@ dependencies { implementation project (':build-tools:xml-formatter') implementation project (':sdk-info') - implementation "androidx.core:core-ktx:1.7.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation androidx.ktx + implementation common.kotlin testImplementation project (':lsp:testing') testImplementation project (':common') diff --git a/xml-inflater/build.gradle b/xml-inflater/build.gradle index b8cb0446c..eef2c9d74 100644 --- a/xml-inflater/build.gradle +++ b/xml-inflater/build.gradle @@ -24,14 +24,14 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "androidx.core:core-ktx:1.7.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation androidx.ktx implementation androidx.annotation implementation androidx.appcompat implementation google.guava implementation common.utilcode implementation common.jsoup + implementation common.kotlin implementation project (":common") api project (':sdk-info')