Amper logo

Amper

The project configuration and build tool focused on user experience and IDE support.

Amper Update August 2024 – Standalone Projects, Settings Tracing, and More

The latest release of Amper, version 0.4.0, is now available! In this release, we’re introducing a clear definition for the project root and providing a first look at settings tracing in Amper, alongside bug fixes and other improvements.

To get support for Amper’s latest features, use Fleet 1.38 or IntelliJ IDEA 2024.2 (or later versions).

Project file in standalone projects

Until now, projects using the standalone version of Amper didn’t have a strong definition of what the project contains. In this release, we’re introducing a new project-level configuration file. This clarifies the root and contents of the project, and provides a consistent experience whether you’re working in the IDE or invoking Amper from the command line.

This is a significant design decision, and we’d like to know what you think of it. Please read the details below and share your thoughts on this approach for project definitions.

Single-module Amper projects can still be defined with just a module.yaml file, allowing you to start new projects quickly, with minimal configuration.

Multi-module projects must now contain a project.yaml file in their root directory, listing all included modules. This list can contain individual module paths or glob patterns, for example:

modules:
 - app
 - util
 - features/*

Establishing this project file also lays the groundwork for adding more features and possible improvements in later releases.

For example:

  • This file can serve as a location for project-wide configuration options.
  • Dependencies and versioning information could be stored in this file (similarly to version catalogs).
  • Path references could be relative to the project root instead of relative to each configuration file (as it is currently implemented).

For Gradle-based Amper projects, the settings.gradle.kts file continues to serve as the project definition file. However, starting in this version, it must now explicitly list all included Amper modules.

To learn more about configuring the project root, see the Basics section of the documentation.

Settings tracing

As your project grows, it becomes increasingly important to know what’s happening in its build configuration. To help you inspect and understand your build, Amper has facilities for settings tracing to keep track of how and where settings values are specified, and when they’re overridden. In this release, we are sharing a first preview of features built on settings tracing, with more to come later.

You can check the tooltip of the settings block (or its nested blocks) to see all effective values and where they’re defined:

When looking at an individual setting, you can see when it overrides a value that’s already set:

Inspections can warn you if a setting is redundant as it doesn’t actually change a value. This can happen when the same value has already been configured elsewhere or when you’re trying to set a value that’s identical to the default:

Platform-specific configuration

As Amper is built with Kotlin Multiplatform in mind, it understands multiplatform projects, and it can tailor your configuration experience to the set of platforms you’re actually using.

With the latest tooling, you will only receive completion for configuration options that are relevant to the set of platforms you’re working with in the given module:

You also get a warning if a setting you’ve specified is invalid given your current platform configuration, with a suggestion of which platform you’re missing:

Update your existing projects

Starting with this release, Amper builds are shipped in a new repository, which contains both public releases and dev builds. This makes it easier to switch between different versions. If you are using Amper in a Gradle-based project, make sure to update the old repository URL to the new one:

// Remove
maven("https://maven.pkg.jetbrains.space/public/p/amper/amper")

// Add
maven("https://packages.jetbrains.team/maven/p/amper/amper")

To use the latest version in an existing Gradle-based project, update your plugin version as follows:

plugins {
    id("org.jetbrains.amper.settings.plugin").version("0.4.0")
}

If you need to update a project using the standalone version of Amper, update your amper scripts by following the download instructions on the Usage page of the documentation.

Try Amper

To get started with Amper, check out the sample projects with standalone Amper and the samples with Gradle-based projects, which have all been updated to the new version. For the full list of changes and bug fixes in Amper 0.4.0, see the release notes.

For full support of the latest Amper features, use Fleet 1.38 or IntelliJ IDEA 2024.2 (or later versions).

Share your feedback

Amper is still experimental and under active development. You can provide feedback about your experience by joining the discussion in the Kotlinlang Slack’s #amper channel or sharing your suggestions and ideas in a YouTrack issue. Your input and your use cases help shape the future of Amper!