Knotx / knotx-aggregator

An aggregator for all Knot.x projects - release guides, automation, etc.
https://knotx.io
Apache License 2.0
0 stars 3 forks source link

Failing gradle build due to using ternary operator (not existing in Kotlin language) #41

Closed marcinus closed 3 years ago

marcinus commented 4 years ago

To reproduce:

  1. Go to release-gradle folder
  2. Launch ./gradlew clean build command

Expected result: Build passes

Actual result: Build fails:

$ ./gradlew clean build

> Task :buildSrc:compileKotlin FAILED
The `kotlin-dsl` plugin applied to project ':buildSrc' enables experimental Kotlin compiler features. For more information see https://docs.gradle.org/6.2.2/userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin
e: [...]\AggregateChangelogsTask.kt: (25, 73): Expecting ')'
e: [...]\AggregateChangelogsTask.kt: (25, 75): Unexpected tokens (use ';' to separate expressions on the same line)
e: [...]\AggregateChangelogsTask.kt: (26, 53): Unexpected tokens (use ';' to separate expressions on the same line)
e: [...]\AggregateChangelogsTask.kt: (28, 9): Expecting an element
e: [...]\AggregateChangelogsTask.kt: (25, 17): Operator '==' cannot be applied to 'Pair<String, String>' and 'String'
e: [...]\AggregateChangelogsTask.kt: (25, 17): Type mismatch: inferred type is Boolean but Pair<TypeVariable(K), TypeVariable(V)> was expected

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSrc:compileKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

Reason: This occurs due to using a non-existing ternary operator in AggregateChangelogsTask.kt file:

"releaseType" to version.substringAfterLast(".") == "0" ? "minor" : "patch",