Escriu per cercar…

Project

Aquesta pàgina encara no s'ha traduït — es mostra en l'idioma original:English

Introduction

An Amper project is defined by a project.yaml file. This file contains the list of modules and the project-wide configuration. The folder with the project.yaml file is the project root. Modules can only be located under the project root (at any depth). If there is only one module in the project, the project.yaml file is not required.

Project layout

A single-module Amper project doesn’t need a project.yaml file. Just create a single valid module, and it is also a valid project.

If there are multiple modules, the project.yaml file specifies the list of modules:

yaml
project.yaml
modules:
  - android-app
  - ios-app
  - jvm-app
  - shared

Sources and resources can’t be defined as part of multiple modules — they must belong to a single module, which other modules can depend on. This ensures that the IDE always knows how to analyze and refactor the code, as it always has a single well-defined set of settings and dependencies.

Getting started

Create a new “Compose Multiplatform application” with Compose

Specific module to run (run the show modules command to get the modules list)

ps
.\amper run --module jvm-app

Dependencies

Module dependencies

To depend on another module of your project, use the path to that module, relative to the current module’s root directory. The path must start either with ./ or ../

For example, on the created project the jvm-app module declares a dependency on the shared module:

yaml
jvm-app/module.yaml
dependencies:
  - ../shared
Note

Dependencies between modules are only allowed within the project scope. That is, they must be listed in the project.yaml file and cannot be outside the project root directory.

Estàs llegint una vista prèvia.

Inicia sessió per llegir l'article complet. Qualsevol compte obre 4 articles gratuïts al mes; l'alumnat i el professorat llegeixen les pàgines del seu curs sense límit.

Inicia sessió