-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to Kotlin #76
Move to Kotlin #76
Conversation
# v2.7.0 is giving issues | ||
uses: cycjimmy/semantic-release-action@v2.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What issues? I'm using it without issue in jwt-kt
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you can see in this run, it fails without any useful info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial quick look looks good to me - this is quite a big one to review, so I'm trusting you semi-blindly here @erwinw ❤️🔥
prop-archaius/src/main/kotlin/io/pleo/prop/archaius/ParsingProperty.kt
Outdated
Show resolved
Hide resolved
// Static properties can't change. No callbacks. | ||
override fun addCallback(callback: Runnable) {} | ||
override fun removeAllCallbacks() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this comment so it's visible in engineers' editor? Unsure if this is JavaDoc or how IntelliJ pulls out that information - WDYT? Could limit engineers being unpleasantly surprised
457e8c2
to
8f31466
Compare
Trust is good, testing is better -- I've tested this locally by using it with JVM Commons and building & testing it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, E!
} | ||
|
||
repositories { | ||
mavenLocal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it worth to include only jvm-commons here, like:
mavenLocal {
content {
// this repository *only* contains artifacts with group "pleo-io.jvm-commons"
includeGroup "pleo-io.jvm-commons"
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh no; Prop is a public repo and does not rely on JVM Commons!
val parser = parserFactory.createParserForType(type) | ||
try { | ||
val annotation = parameter.getAnnotation(Default::class.java) | ||
println("ANNOTATION: $annotation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this guy should be removed I think
val parameter = parameters[dependency.parameterIndex] | ||
PropResult(parameterToProp(parameter, key)) | ||
} catch (ex: RuntimeException) { | ||
PropResult(ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, how does it work if PropResult will be an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a follow-up PR I'm replacing this with the more idiomatic Kotlin Result.
.map(Default::value) | ||
.map(parser::apply) | ||
.orElse(null) | ||
println("DEF: $defaultValue") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, and this one
|
||
private fun getNamedAnnotationValue(annotations: List<Annotation>, key: Key<*>): String = | ||
annotations.mapNotNull(::annotationValueIfNamed).lastOrNull().also { | ||
println("?? $it") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more print to be either removed or logger used
is com.google.inject.name.Named -> annotation.value | ||
else -> null | ||
}?.ifEmpty { null }.also { | ||
println(">> $it") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
this.error = error | ||
} | ||
|
||
fun isError() = error != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, now I see how it works! 👍
🎉 This PR is included in version 4.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Move to Kotlin
Move the existing Java implementation to Kotlin
Breaking changes: any breaking changes EXCEPT one: fixing the package for
JacksonParserFactory
(it was mistakenly put as.guice
instead of.jackson
).