Road to 1.0 - Refactor project structure#142
Conversation
|
|
||
| @Serializable | ||
| data class DSL( | ||
| internal data class DSL( |
There was a problem hiding this comment.
the DSL object shouldn't be visible from the Danger File, DangerDSL yes
There was a problem hiding this comment.
I always forget that in kotlin default is public, because on Swift the default is internal 😅
|
|
||
| @Serializable | ||
| data class Meta( | ||
| internal data class Meta( |
There was a problem hiding this comment.
Meta as well shouldn't be visible from the Danger File as well, changed to internal
| } | ||
|
|
||
| class ShellExecutorImpl : ShellExecutor { | ||
| internal class ShellExecutorImpl : ShellExecutor { |
There was a problem hiding this comment.
our internal implementation for the shell executor shouldn't be visible from the danger file, we can access by interface
| import systems.danger.kotlin.models.git.FilePath | ||
| import java.io.File | ||
|
|
||
| internal object JsonParser { |
| import systems.danger.kotlin.sdk.Violation | ||
| import java.io.File | ||
|
|
||
| internal class MainDangerRunner(jsonInputFilePath: FilePath, jsonOutputPath: FilePath) : DangerContext { |
There was a problem hiding this comment.
Danger runner is now composed by 3 files: MainDangerRunner that contains the private implementation, MainPlugins that contains the helpers for registering and using Danger plugins and MainScript that contains all the API functions like message warn and initialisation val danger=Danger(args) or danger(args) {...} block.
Extensions onGit onGitHub .. moved to KtxDangerDSL.kt
Generated by 🚫 Danger Kotlin against 768b67f |
Generated by 🚫 Danger Kotlin against 768b67f |
| @@ -0,0 +1,5 @@ | |||
| package systems.danger.kotlin | |||
There was a problem hiding this comment.
Do we want something for the future? Or we can add it when is needed?
Looks a little bit a premature optimisation.
There was a problem hiding this comment.
Up to us! We can delete the empty stuff for now, but i like the idea that we have already a place where to put new extensions if needed
danger-kotlin-library/src/main/kotlin/systems/danger/kotlin/MainPlugins.kt
Show resolved
Hide resolved
|
|
||
| @Serializable | ||
| data class DSL( | ||
| internal data class DSL( |
There was a problem hiding this comment.
I always forget that in kotlin default is public, because on Swift the default is internal 😅
| * - [Sdk.API_VERSION] | ||
| * - [Sdk.VERSION_NAME] | ||
| * | ||
| * @constructor Create empty Sdk |
There was a problem hiding this comment.
Does anyone need to create an SDK object? Is there a way to make this impossible?
There was a problem hiding this comment.
Is a singleton with two fields, in this case works like a static class with const fields 😄 this is how works.
using object in kotlin is also a way to group under the same context static fields
…inPlugins.kt Co-authored-by: Franco Meloni <franco.meloni91@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.