Skip to content

Commit 77c8585

Browse files
author
yevhenii.nadtochii
committed
Update modules structure in README
1 parent 391abf9 commit 77c8585

2 files changed

Lines changed: 10 additions & 25 deletions

File tree

version-catalog/README.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,17 @@ Within this PR, `spine-version-catalog` is a resident of `time` repository, but
191191
it is a standalone project. Meaning, it has its own Gradle's `settings` file,
192192
and doesn't relate anyhow to `time`.
193193

194-
`spine-version-catalog` consists of several modules:
194+
`spine-version-catalog` consists of two modules:
195195

196-
1. `api` – represents a facade upon Gradle's provided `VersionCatalogBuilder`.
197-
This module hides an imperative nature of the builder, and, instead, provides
198-
a declarative API to declare dependencies using Kotlin objects.
196+
1. `catalog` – provides a facade upon Gradle's provided `VersionCatalogBuilder`
197+
and assembles `SpineVersionCatalog`, using that facade.
199198

200-
2. `catalog` – contains all dependencies, declared using the declarative `api`.
201-
The module publishes `SpineVersionCatalog`.
202-
203-
3. `func-test` – performs testing of `api` with a real `VersionCatalogBuilder`.
199+
2. `func-test` – performs testing of the facade with a real instance of `VersionCatalogBuilder`.
204200
To do that, the module does the following:
205201

206202
1. Assembles a `dummy-catalog` with a single `Dummy` dependency and publishes
207-
it to Maven local.
203+
it to Maven local. In order to declare `Dummy`, the module depends on `:catalog`,
204+
which exposes the declarative facade.
208205
2. Makes `dummy-project` use `dummy-catalog` from Maven local.
209206
3. Builds `dummy-project`. It has assertions in its build file. Those assertions verify
210207
the generated type-safe accessors to `Dummy` dependency. When any of assertions
@@ -213,20 +210,6 @@ To do that, the module does the following:
213210

214211
## Details about Functional Testing
215212

216-
`func-test` module sets the next dependencies for `test` task:
217-
218-
```kotlin
219-
test {
220-
dependsOn(
221-
":api:publishToMavenLocal",
222-
":func-test:dummy-catalog:publishToMavenLocal"
223-
)
224-
}
225-
```
226-
227-
It is so, because `dummy-project` (which the test builds), fetches `dummy-catalog`
228-
from Maven local. Which, in turn, depends on `api` module. Thus, we need them both in Maven local.
229-
230213
We have to do a true functional testing here, because Gradle does not provide
231214
a test fixture for `Settings`, as it does for `Project`. For this reason, we test
232215
it on a real Gradle project, with assertions right in a build file.

version-catalog/func-test/dummy-catalog/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ plugins {
2929
}
3030

3131
dependencies {
32-
// Defines declarative API for dependencies.
32+
// Provides declarative API for dependencies.
33+
// It is a facade upon Gradle's provided `VersionCatalogBuilder`.
3334
implementation(project(":catalog"))
3435
}
3536

@@ -45,8 +46,9 @@ publishing {
4546
}
4647

4748
tasks {
49+
// It will be impossible to use this module from Maven local without `:catalog`.
50+
// As this module depends on it.
4851
named("publishToMavenLocal") {
49-
// We can't use this module from Maven local without `:catalog`.
5052
dependsOn(":catalog:publishToMavenLocal")
5153
}
5254
}

0 commit comments

Comments
 (0)