{"id":522950,"date":"2024-11-05T14:26:58","date_gmt":"2024-11-05T13:26:58","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=amper&#038;p=522950"},"modified":"2024-11-13T11:32:49","modified_gmt":"2024-11-13T10:32:49","slug":"amper-update-november-2024","status":"publish","type":"amper","link":"https:\/\/blog.jetbrains.com\/en\/amper\/2024\/11\/amper-update-november-2024","title":{"rendered":"Amper Update November 2024 \u2013 Project File Tooling, Compose Resources, KSP2, and Android Release Builds"},"content":{"rendered":"\n<p><a href=\"https:\/\/github.com\/JetBrains\/amper\/releases\/tag\/v0.5.0\" target=\"_blank\" rel=\"noopener\">Amper 0.5.0<\/a> is now available! With this release, we\u2019ve improved the IDE experience when working with multiple modules and <code>project.yaml<\/code> files, made nested completion in Amper configuration files more powerful, introduced support for Compose Resources and KSP2, improved Android release builds, and more!<\/p>\n\n\n\n<p>For the full list of changes and bug fixes in Amper 0.5.0, see <a href=\"https:\/\/github.com\/JetBrains\/amper\/releases\/tag\/v0.5.0\" target=\"_blank\" rel=\"noopener\">the release notes<\/a>.<\/p>\n\n\n\n<p><em>To get support for Amper\u2019s latest features, use <a href=\"https:\/\/www.jetbrains.com\/fleet\/\" target=\"_blank\" rel=\"noopener\">Fleet 1.42<\/a> or <a href=\"https:\/\/blog.jetbrains.com\/idea\/2024\/10\/intellij-idea-2024-3-beta\/\">IntelliJ IDEA 2024.3<\/a> (or later versions).<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Tooling support for working with modules and project files<\/h2>\n\n\n\n<p>In the <a href=\"https:\/\/blog.jetbrains.com\/amper\/2024\/08\/amper-update-august-2024\/\">previous update<\/a>, we introduced project files for standalone Amper projects. With this release, you\u2019ll now get additional tooling to work with these files.<\/p>\n\n\n\n<p>When working in the configuration file of a newly created module, you\u2019ll see a warning and a quick-fix that helps you add it to the list of modules:<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay controls loop muted src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/amper-050-reg-new-module.mov\"><\/video><\/figure>\n\n\n\n<p>When referencing a module that doesn\u2019t exist yet, you can use a quick-fix to create that new module:<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay controls loop muted src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/amper-050-create-new-module.mp4\"><\/video><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Improved nested completion<\/h2>\n\n\n\n<p>The settings block in Amper files offers nested completion for all of the available values you can configure, letting you easily search for values even if you don\u2019t know where in the structure they\u2019re nested.<\/p>\n\n\n\n<p>To make this even more convenient, you\u2019ll now get this completion support even when you\u2019re at the top level of a module file:<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay controls loop muted src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/amper-050-nested.mp4\"><\/video><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Compose resources<\/h2>\n\n\n\n<p>You can now use <a href=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/compose-multiplatform-resources.html\" target=\"_blank\" rel=\"noopener\">Compose Multiplatform resources<\/a> in standalone Amper projects, which allows you to easily access images, strings, fonts, and files in your Compose application.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay controls loop muted src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/amper-050-resources.mp4\"><\/video><\/figure>\n\n\n\n<p>You can configure resources under <code>settings.compose<\/code> to change the package name or the visibility of the generated <code>Res<\/code> class:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings:\n\u00a0\u00a0compose:\n\u00a0\u00a0\u00a0\u00a0enabled: true\n\u00a0\u00a0\u00a0\u00a0resources:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0packageName: com.example.app\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0exposedAccessors: true<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Kotlin Symbol Processing<\/h2>\n\n\n\n<p>The standalone version of Amper now has support for Kotlin Symbol Processing. <a href=\"https:\/\/kotlinlang.org\/docs\/ksp-overview.html#supported-libraries\" target=\"_blank\" rel=\"noopener\">Many third-party libraries<\/a> use KSP to generate code as part of the compilation process.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>Amper works with <a href=\"https:\/\/github.com\/google\/ksp\/blob\/main\/docs\/ksp2.md\" target=\"_blank\" rel=\"noopener\">KSP2<\/a>, so any processors used must be updated for KSP2 as well. We\u2019re expecting most processors to make this upgrade soon, as KSP1 is deprecated and will no longer be supported in Kotlin 2.1. However, at the time of this release, you might still see some gaps in support, such as issues with native targets.<\/p>\n<\/blockquote>\n\n\n\n<p>To add a processor to your module, use the <code>settings.kotlin.ksp<\/code> section. You can also specify the options that you want to pass to KSP here.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings:\n\u00a0\u00a0kotlin:\n\u00a0\u00a0\u00a0\u00a0ksp:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0processors:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0- androidx.room:room-compiler:2.7.0-alpha09\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0processorOptions:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0room.schemaLocation: .\/schema<\/pre>\n\n\n\n<p>In multiplatform modules, configuration in the settings block is applied to all platforms by default, including KSP processors. If you need to specify which platforms to run a KSP processor on, use a settings block with a <a href=\"https:\/\/github.com\/JetBrains\/amper\/blob\/HEAD\/docs\/Documentation.md#platform-qualifier\" target=\"_blank\" rel=\"noopener\">platform qualifier<\/a>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings@android:\n\u00a0\u00a0kotlin:\n\u00a0\u00a0\u00a0\u00a0ksp:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0processors:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0- androidx.room:room-compiler:2.7.0-alpha09<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Android release builds<\/h2>\n\n\n\n<p>Amper can now create signed release builds of Android apps in both Gradle-based and standalone Amper projects. These builds will use <a href=\"https:\/\/developer.android.com\/build\/shrink-code\" target=\"_blank\" rel=\"noopener\">R8<\/a> automatically, with minification and shrinking enabled.<\/p>\n\n\n\n<p>To enable signing for release builds, use the new <code>android.signing<\/code> option in the settings block:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings:\n\u00a0\u00a0android:\n\u00a0\u00a0\u00a0\u00a0signing: enabled<\/pre>\n\n\n\n<p>You can provide the signing details by creating a <code>keystore.properties<\/code> file in the module:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">storeFile=\/Users\/example\/.keystores\/release.keystore\nstorePassword=store_password\nkeyAlias=alias\nkeyPassword=key_password<\/pre>\n\n\n\n<p>There are options available to customize R8\u2019s obfuscation and to change the location of the properties file containing the signing details. Amper can also generate a new keystore for you if you don\u2019t have one already.<\/p>\n\n\n\n<p>You can refer to the <a href=\"https:\/\/github.com\/JetBrains\/amper\/blob\/HEAD\/docs\/Documentation.md#configuring-android\" target=\"_blank\" rel=\"noopener\">documentation about configuring Android builds<\/a> for more details, and you can also look at samples to see custom Proguard configuration in both <a href=\"https:\/\/github.com\/JetBrains\/amper\/tree\/HEAD\/examples-standalone\/compose-multiplatform\/android-app\" target=\"_blank\" rel=\"noopener\">standalone<\/a> and <a href=\"https:\/\/github.com\/JetBrains\/amper\/tree\/HEAD\/examples-gradle\/compose-multiplatform\/android-app\" target=\"_blank\" rel=\"noopener\">Gradle-based<\/a> Amper projects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Parcelize support for Android<\/h2>\n\n\n\n<p>In projects using the standalone version of Amper, you can now turn on the <a href=\"https:\/\/developer.android.com\/kotlin\/parcelize\" target=\"_blank\" rel=\"noopener\">Parcelize<\/a> plugin for Android, using the new settings entry:&nbsp;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings:\n\u00a0\u00a0android:\n\u00a0\u00a0\u00a0\u00a0parcelize: enabled<\/pre>\n\n\n\n<p>This lets you annotate <code>Parcelable<\/code> classes with <code>@Parcelize<\/code> to generate an implementation automatically:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import kotlinx.parcelize.Parcelize\n\n@Parcelize\nclass User(val firstName: String, val lastName: String, val age: Int): Parcelable<\/pre>\n\n\n\n<p>As Parcelize is an Android-specific feature, it requires some additional configuration in multiplatform projects, which is described in <a href=\"https:\/\/github.com\/JetBrains\/amper\/tree\/HEAD\/docs\/Documentation.md#parcelize\" target=\"_blank\" rel=\"noopener\">the documentation<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Updated dependencies and defaults<\/h2>\n\n\n\n<p>Amper now uses these new versions of dependencies and default values:<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/kotlinlang.org\/docs\/whatsnew2020.html\" target=\"_blank\" rel=\"noopener\">Kotlin 2.0.20<\/a><\/li>\n\n\n\n<li>Kotlin language version 2.0<\/li>\n\n\n\n<li>Android compile SDK and target SDK 35<\/li>\n<\/ul>\n\n\n\n<p>This release also uses <a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\" target=\"_blank\" rel=\"noopener\">kotlinx.serialization<\/a> 1.7.3 by default and allows you to customize this version if needed:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">settings:\n\u00a0\u00a0kotlin:\n\u00a0\u00a0\u00a0\u00a0serialization:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0enabled: true\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0version: 1.7.3<\/pre>\n\n\n\n<p>To make it easier to set up serialization for various formats, the required dependencies are available from the built-in version catalog:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dependencies:\n\u00a0\u00a0- $kotlin.serialization.json\n\u00a0\u00a0- $kotlin.serialization.protobuf<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">New, unified cache folder<\/h2>\n\n\n\n<p>There is now a unified location for caching downloaded dependencies, whether Amper is invoked from the command line or used in an IDE. The <code>~\/.amper<\/code> folder that was used in previous versions can be safely deleted.<\/p>\n\n\n\n<p>The new cache locations are as follows:<\/p>\n\n\n\n<ul>\n<li>On Windows: <code>~\/AppData\/Local\/Amper<\/code><\/li>\n\n\n\n<li>On macOS: <code>~\/Library\/Caches\/Amper<\/code><\/li>\n\n\n\n<li>On Linux: <code>~\/.cache\/Amper<\/code> (or if <a href=\"https:\/\/specifications.freedesktop.org\/basedir-spec\/latest\/\" target=\"_blank\" rel=\"noopener\"><code>XDG_CACHE_HOME<\/code><\/a> is defined, <code>$XDG_CACHE_HOME\/.cache\/Amper<\/code>)&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Update your existing projects<\/h2>\n\n\n\n<p>To update a project using the standalone version of Amper, update your <code>amper<\/code> scripts by following the download instructions on the <a href=\"https:\/\/github.com\/JetBrains\/amper\/blob\/HEAD\/docs\/Usage.md#using-the-standalone-amper-version-from-the-command-line\" target=\"_blank\" rel=\"noopener\">Usage page<\/a> of the documentation.<\/p>\n\n\n\n<p>If you\u2019re using a Gradle-based Amper project, update your plugin version to 0.5.0:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">plugins {\n\u00a0\u00a0\u00a0id(\"org.jetbrains.amper.settings.plugin\").version(\"0.5.0\")\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Try Amper<\/h2>\n\n\n\n<p>To get started with Amper, try the <a href=\"https:\/\/github.com\/JetBrains\/amper\/tree\/HEAD\/examples-standalone\" target=\"_blank\" rel=\"noopener\">sample projects with standalone Amper<\/a> or the <a href=\"https:\/\/github.com\/JetBrains\/amper\/tree\/HEAD\/examples-gradle\" target=\"_blank\" rel=\"noopener\">samples with Gradle-based projects<\/a>.<\/p>\n\n\n\n<p>For full support of the latest Amper features, use <a href=\"https:\/\/www.jetbrains.com\/fleet\/\" target=\"_blank\" rel=\"noopener\">Fleet 1.42<\/a> and <a href=\"https:\/\/blog.jetbrains.com\/idea\/2024\/10\/intellij-idea-2024-3-beta\/\">IntelliJ IDEA 2024.3<\/a> (or later versions).<\/p>\n\n\n    <div class=\"buttons\">\n        <div class=\"buttons__row\">\n                                                <a href=\"https:\/\/github.com\/JetBrains\/amper\" class=\"btn\" target=\"\" rel=\"noopener\">Try Amper<\/a>\n                                                    <\/div>\n    <\/div>\n\n\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Share your feedback<\/h2>\n\n\n\n<p>Amper is still experimental and under active development. You can provide feedback about your experience by joining the discussion in the <a href=\"https:\/\/slack-chats.kotlinlang.org\/c\/amper\" target=\"_blank\" rel=\"noopener\">Kotlinlang Slack\u2019s #amper channel<\/a> or sharing your suggestions and ideas in a <a href=\"https:\/\/youtrack.jetbrains.com\/issues\/AMPER\" target=\"_blank\" rel=\"noopener\">YouTrack issue<\/a>. Your input and your use cases help shape the future of Amper!<\/p>\n","protected":false},"author":1478,"featured_media":522998,"comment_status":"closed","ping_status":"closed","template":"","categories":[],"tags":[],"cross-post-tag":[6910,6355],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/amper\/522950"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/amper"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/types\/amper"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/users\/1478"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/comments?post=522950"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/amper\/522950\/revisions"}],"predecessor-version":[{"id":526596,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/amper\/522950\/revisions\/526596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/media\/522998"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/media?parent=522950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/categories?post=522950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/tags?post=522950"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/cross-post-tag?post=522950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}