Closed7

Amper を見てみる

maxfie1dmaxfie1d

What is Amper?

Amper is a tool for project configuration. Its goal is to improve the project configuration user experience and toolability, that is, the support inside the IDE, while also providing a smooth out-of-the box experience.
We’re currently looking at various aspects, including the configuration of projects for the purpose of building, packaging, publishing, and more. At its current stage, however, the focus is primarily on configuring projects for the purpose of building.
While the current use case is Kotlin and Kotlin Multiplatform, Amper also supports Java and Swift (as a requirement for multiplatform). However, the same approach to configuration could work for other languages and technology stacks in the future.
Amper is implemented as a Gradle plugin and uses YAML for its project configuration format. The goal right now is to validate the user experience, which is why we have chosen to build on a well-tested build tool like Gradle, providing a configuration layer on top of it.
In regards to using YAML, some of you may be wondering, why not Kotlin? While the decision on this markup language is not final, we do want to take a declarative approach. We believe that this not only allows for a more simplified configuration that is less error-prone, but it also helps us in terms of providing better tooling. And again, for the sake of sharing this experiment with you and validating ideas behind it, we’ve taken the simplest approach. Whether or not we’ll end up with a restrictive subset of Kotlin as the frontend language is yet to be decided. For now, our focus is on validating our ideas.

Google 翻訳

Amper はプロジェクトを構成するためのツールです。

その目標は、プロジェクト構成のユーザー エクスペリエンスとツールの容易性、つまり IDE 内のサポートを向上させると同時に、すぐに使用できるスムーズなエクスペリエンスを提供することです。

現在、ビルド、パッケージ化、公開などを目的としたプロジェクトの構成を含め、さまざまな側面を検討しています。ただし、現在の段階では、主に構築を目的としたプロジェクトの構成に重点が置かれています。

現在のユースケースは Kotlin と Kotlin マルチプラットフォーム ですが、 Amper は Java と Swift (マルチプラットフォームの要件として) もサポートしています。 ただし、同じ構成アプローチが将来、他の言語やテクノロジー スタックでも機能する可能性があります。

Amper は Gradle プラグインとして実装 されており、プロジェクト構成形式に YAML を使用します。 現時点での目標は、ユーザー エクスペリエンスを検証することです。そのため、Gradle のような十分にテストされたビルド ツール上に構築することを選択し、その上に構成レイヤーを提供します。

YAML の使用に関して、なぜ Kotlin を使用しないのかと疑問に思う方もいるかもしれません。
このマークアップ言語に関する決定は最終的なものではありませんが、 私たちは宣言的なアプローチを採用したいと考えています。 これにより、構成がより単純化され、エラーが発生しにくくなるだけでなく、より優れたツールを提供するという点でも役立つと考えています。繰り返しになりますが、この実験を皆さんと共有し、その背後にあるアイデアを検証するために、私たちは最も単純なアプローチを採用しました。最終的にフロントエンド言語として Kotlin の制限的なサブセットを使用するかどうかはまだ決まっていません。今のところ、私たちはアイデアを検証することに重点を置いています。

maxfie1dmaxfie1d

JVM の Console application でHello World!するプログラムの場合

たったこれだけ!

# module.yml
product: jvm/app
maxfie1dmaxfie1d

Android (Jetpack Compose) アプリの場合

これだけ...!

# Have feedback? Share it here https://surveys.jetbrains.com/s3/Amper-feedback-form

product: android/app

dependencies:
  - $compose.foundation
  - $compose.material3
  - androidx.activity:activity-compose:1.7.2 # integration compose with activities
  - androidx.appcompat:appcompat:1.6.1 # we need special type of activity

settings:
  compose: enabled

ちなみに settings.gradle.kts は以下のようになっている。
plugins で amper が使用されているくらいでかなり記述が短い。

pluginManagement {
    repositories {
        mavenCentral()
        google()
        gradlePluginPortal()
        maven("https://maven.pkg.jetbrains.space/public/p/amper/amper")
    }
}

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

サンプルはこちら

https://github.com/JetBrains/amper/tree/main/examples/compose-android

このスクラップは2023/11/17にクローズされました