Skip to content

Commit 1a62acc

Browse files
joffrey-bionklikh
authored andcommitted
[docs] plugins-configuration: improve wording
(cherry picked from commit f885a7b)
1 parent 40bd46f commit 1a62acc

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

docs/src/user-guide/plugins/topics/configuration.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ A configurable interface is a public Kotlin interface annotated with the `@Confi
4343
The following restrictions apply to this interface:
4444

4545
- methods, superinterfaces, generics are not allowed
46-
- it may only have immutable non-extension (`#!kotlin val`) properties of the _configurable types_.
47-
Such a property may have a default getter implementation, depending on a type.
48-
- See the [defaults](#default-values) section.
46+
- it may only have read-only non-extension (`#!kotlin val`) properties
47+
- all its properties must be of a _configurable type_ themselves
48+
- its properties may have a default getter implementation, depending on their type.
49+
See the [Default values](#default-values) section.
4950

5051
```kotlin title="Valid configurable declarations"
5152
@Configurable
@@ -139,8 +140,8 @@ Task parameters use the regular default value syntax:
139140
| `object T` | not supported (instantiated implicitly, see the note)|
140141

141142
!!! note
142-
Properties of `@Configurable` interface types can't have explicit default values.
143-
However, all objects are instantiated using their default values combined with the values
143+
Properties of object type can't have an explicit default value.
144+
Instead, all objects are instantiated using the default values of their properties combined with the values
144145
provided on the configuration (YAML) side. If any required properties (those with no default value) remain
145146
unconfigured, an error is reported and the configuration is rejected.
146147

@@ -179,14 +180,17 @@ For example, [plugin settings](#plugin-settings) have an implicit synthetic `ena
179180

180181
### Variant types
181182

182-
On the Kotlin side they are modeled as a `@Configurable` `sealed` interface.
183+
On the Kotlin side, they are modeled as a `@Configurable` `sealed` interface.
183184
When a variant type is expected, there is a need to express which exact variant is being provided in the configuration.
184-
This ability to express the exact type is not yet well-designed in Amper and generally looks unintuitive in YAML.
185+
This ability to express the exact type is not yet designed in Amper and generally looks unintuitive in YAML.
185186

186-
So for the built‑in `Dependency { Local, Maven }` variant type Amper infers the type based on the `@DependencyNotation` string contents:
187+
An example of variant type is the built‑in `Dependency` type, which can be a local module dependency (`Dependency.Local`)
188+
or an external Maven dependency (`Dependency.Maven`). Each of these subtypes has a `@DependencyNotation`-annotated property.
187189

188-
- if the dependency string starts with the `.` then it is a local dependency
189-
- otherwise it is a Maven dependency
190+
The discrimination between the subtypes is done based on the value of that property:
191+
192+
- if the value starts with a `.`, it is read as a local module dependency
193+
- otherwise, it is read as a Maven dependency
190194

191195
#### Task action types
192196

0 commit comments

Comments
 (0)