Skip to content

Commit

Permalink
Merge pull request #1146 from robstoll/migrate-to-new-mpp
Browse files Browse the repository at this point in the history
further migration to new mpp
  • Loading branch information
robstoll authored Jun 1, 2022
2 parents 1e94af0 + 9103eb7 commit 4a415bd
Show file tree
Hide file tree
Showing 62 changed files with 395 additions and 549 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/good_first_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Following the things you need to do:
- [ ] provide a val which returns `Expect<T>` in xYExpectations.kt (see yzExpectations.kt as a guideline)
- [ ] provide a fun which expects an `assertionCreator`-lambda and returns `Expect<AB>` in xyExpectations.kt (see yzExpectations.kt as a guideline)
- [ ] add `@since 0.19.0` (adapt to current [milestone](https://github.com/robstoll/atrium/milestones)) to KDOC
- [ ] extend or write a separate Spec named XyExpectationsSpec in specs-common (see for instance YzExpectationsSpec) and extend it in atrium-api-fluent-en_GB-common/src/test
- [ ] extend or write a separate Spec named XyExpectationsSpec in specs -> commonMain (see for instance YzExpectationsSpec) and extend it in atrium-api-fluent-en_GB -> commonTest

*api-infix*
- [ ] provide a val which returns `Expect<T>` in xYExpectations.kt(see yzExpectations.kt as a guideline)
- [ ] provide a fun which expects an `assertionCreator`-lambda and returns `Expect<AB>` in xyExpectations.kt (see yzExpectations.kt as a guideline)
- [ ] add `@since 0.19.0` (adapt to current [milestone](https://github.com/robstoll/atrium/milestones)) to KDOC
- [ ] extend or write a separate Spec named XyExpectationsSpec in specs-common (see for instance YzExpectationsSpec) and extend it in atrium-api-infix-en_GB-common/src/test
- [ ] extend or write a separate Spec named XyExpectationsSpec in specs -> commonMain (see for instance YzExpectationsSpec) and extend it in atrium-api-infix-en_GB -> commonTest


## Non-Code related feature
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ dependencies {
and for the aforementioned extensions:
```
dependencies {
testImplementation("ch.tutteli.atrium:atrium-api-infix-en_GB-kotlin_1_3-js:$atriumVersion")
testImplementation("ch.tutteli.atrium:atrium-api-infix-en_GB-kotlin_1_3:$atriumVersion")
}
```
<hr/>
Expand Down Expand Up @@ -1773,7 +1773,7 @@ Have a look at [apis/differences.md](https://github.com/robstoll/atrium/tree/mai
This site contains also a list of all APIs with links to their expectation function catalogs.
You can also have a look at the
[specifications](https://github.com/robstoll/atrium/tree/main/misc/specs/atrium-specs-common/src/main/kotlin/ch/tutteli/atrium/specs)
[specifications](https://github.com/robstoll/atrium/tree/main/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs)
for more examples.
## Sample Projects
Expand Down Expand Up @@ -2350,7 +2350,7 @@ Following a quick overview what extension methods could be useful:
- all expectation functions on the logic level (what you have seen in [Compose expectation functions](#compose-expectation-functions)
was the API level) so that you can reuse and compose them in other ways.
- `changeSubject` which allows to change the subject either:
- `unreported`; meaning it does not show up in reporting (e.g. `Expect<Array<out T>>.asList()` uses it, see [arrayAssertions](https://github.com/robstoll/atrium/tree/main/apis/fluent-en_GB/atrium-api-fluent-en_GB-common/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/arraySubjectChangers.kt#L20))
- `unreported`; meaning it does not show up in reporting (e.g. `Expect<Array<out T>>.asList()` uses it, see [arrayAssertions](https://github.com/robstoll/atrium/tree/main/apis/fluent-en_GB/atrium-api-fluent-en_GB/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/arraySubjectChangers.kt#L20))
- reported, using `reportBuilder`; meaning a subject transformation which is shown in reporting as it incorporates a transformation (e.g. `toBeAnInstanceOf` uses it, see [AnyAssertions](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultAnyAssertions.kt#L66))
- `collect` which allows to collect expectations - especially helpful in composing expectations (see [mapAssertions](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultMapAssertions.kt#L49))
- `extractFeature` for feature extraction where it is not always save to extract (see [`List.get`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultListAssertions.kt#L13))
Expand Down
7 changes: 0 additions & 7 deletions apis/fluent-en_GB/atrium-api-fluent-en_GB-common/build.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
package ch.tutteli.atrium.api.fluent.en_GB

import ch.tutteli.atrium.api.verbs.internal.expect
import kotlin.js.JsName
//TODO 0.19.0 we are in a common module but it fails. Check if it does not if we use the default src layout
//import kotlin.js.JsName

class WorstCase {

val propAndFun: Int = 1
@JsName("propFun")
// @JsName("propFun")
fun propAndFun(): Int = 1

fun overloaded(): Int = 1
Expand Down
7 changes: 0 additions & 7 deletions apis/fluent-en_GB/atrium-api-fluent-en_GB-js/build.gradle

This file was deleted.

14 changes: 0 additions & 14 deletions apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/build.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package ch.tutteli.atrium.api.fluent.en_GB.samples

import ch.tutteli.atrium.api.fluent.en_GB.*
import ch.tutteli.atrium.api.verbs.internal.expect
import org.junit.jupiter.api.Test
import java.util.*
import kotlin.test.Test

class OptionalExpectationSamples {

Expand Down
38 changes: 38 additions & 0 deletions apis/fluent-en_GB/atrium-api-fluent-en_GB/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
description = "A fluent expectation function API in en_GB with a focus on code completion"

val niokVersion: String by rootProject.extra

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
api(prefixedProject("logic"))
}
}

val jvmMain by getting {
dependencies {
implementation("ch.tutteli.niok:niok:$niokVersion")
}
}

val commonTest by getting {
dependencies {
implementation(prefixedProject("specs"))
}
}
val jvmTest by getting {
dependencies {
implementation(prefixedProject("specs"))
}
}
}
}

val jacocoAdditional: List<Project> by extra(
listOf(
prefixedProject("translations-en_GB"),
prefixedProject("logic"),
prefixedProject("core")
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
description = "Kotlin 1.3 specific expectation functions and builders for atrium-api-fluent-en_GB -- will be merged into fluent-en_GB with 1.0.0 at the latest"

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
api(prefixedProject("api-fluent-en_GB"))
api(prefixedProject("logic-kotlin_1_3"))
}
}

val commonTest by getting {
dependencies {
implementation(prefixedProject("specs"))
}
}
val jvmTest by getting {
dependencies {
implementation(prefixedProject("specs"))
}
}

configureEach {
languageSettings.apply {
languageVersion = "1.3"
apiVersion = "1.3"
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions apis/infix-en_GB/atrium-api-infix-en_GB-common/build.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
package ch.tutteli.atrium.api.infix.en_GB

import ch.tutteli.atrium.api.verbs.internal.expect
import kotlin.js.JsName
//TODO 0.19.0 complains we are not in common module but we are. Check if error disappears once we use the default src folder
//import kotlin.js.JsName

class WorstCase {

val propAndFun: Int = 1
@JsName("propFun")
// @JsName("propFun")
fun propAndFun(): Int = 1

fun overloaded(): Int = 1
Expand Down
7 changes: 0 additions & 7 deletions apis/infix-en_GB/atrium-api-infix-en_GB-js/build.gradle

This file was deleted.

16 changes: 0 additions & 16 deletions apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle

This file was deleted.

43 changes: 43 additions & 0 deletions apis/infix-en_GB/atrium-api-infix-en_GB/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
description = "An infix API in en_GB with a focus on code completion."

val niokVersion: String by rootProject.extra

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
api(prefixedProject("logic"))
}
}

val jvmMain by getting {
dependencies {
implementation("ch.tutteli.niok:niok:$niokVersion")
}
}

val commonTest by getting {
dependencies {
implementation(project(":${rootProject.name}-specs")) {
exclude(module = "${rootProject.name}-translations-en_GB")
}
implementation(prefixedProject("translations-de_CH"))
}
}
val jvmTest by getting {
dependencies {
implementation(project(":${rootProject.name}-specs")) {
exclude(module = "${rootProject.name}-translations-en_GB")
}
}
}
}
}

val jacocoAdditional: List<Project> by extra(
listOf(
prefixedProject("translations-en_GB"),
prefixedProject("logic"),
prefixedProject("core")
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
description = "Kotlin 1.3 specific expectation functions and builders for atrium-api-fluent-en_GB -- will be merged into fluent-en_GB with 1.0.0 at the latest"

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
api(prefixedProject("api-infix-en_GB"))
api(prefixedProject("logic-kotlin_1_3"))
}
}

val commonTest by getting {
dependencies {
implementation(prefixedProject("specs"))
}
}
val jvmTest by getting {
dependencies {
implementation(prefixedProject("specs"))
}
}

configureEach {
languageSettings.apply {
languageVersion = "1.3"
apiVersion = "1.3"
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 6 additions & 6 deletions atrium-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ kotlin {
}
val commonTest by getting {
dependencies {
implementation(prefixedProject("api-infix-en_GB-common"))
implementation(prefixedProject("specs-common"))
implementation(prefixedProject("api-infix-en_GB"))
implementation(prefixedProject("specs"))
}
}
val jvmMain by getting {
Expand All @@ -22,8 +22,8 @@ kotlin {
}
val jvmTest by getting {
dependencies {
implementation(prefixedProject("api-infix-en_GB-jvm"))
implementation(prefixedProject("specs-jvm"))
implementation(prefixedProject("api-infix-en_GB"))
implementation(prefixedProject("specs"))
}
}
//TODO 0.19.0 activate again as soon as api-infix has a js module
Expand All @@ -34,8 +34,8 @@ kotlin {
// }
// val jsTest by getting {
// dependencies {
// implementation(prefixedProject("api-infix-en_GB-js"))
// implementation(prefixedProject("specs-js"))
// implementation(prefixedProject("api-infix-en_GB"))
// implementation(prefixedProject("specs"))
// }
// }
}
Expand Down
Loading

0 comments on commit 4a415bd

Please sign in to comment.