Skip to content

Add Kotlin DSL#25

Draft
jamierocks wants to merge 1 commit intodevelopfrom
feature/dsl-kotlin
Draft

Add Kotlin DSL#25
jamierocks wants to merge 1 commit intodevelopfrom
feature/dsl-kotlin

Conversation

@jamierocks
Copy link
Member

@jamierocks jamierocks commented Sep 2, 2019

Resolves #24

    val mappings = MappingSetDsl.create {
        klass("a") {
            deobf = "Example"
            extension(EXTRA, "Hello, World!")
        }
        klass("b") {
            deobf = "Demo"

            field("g") {
                deobf = "name"
            }

            method("h", "(Z)Ljava/lang/String;") {
                deobf = "getName"
                param(0) {
                    deobf = "propagate"
                }
            }

            klass("d") {
                deobf = "Inner"
            }
        }
    }

Huge thanks to @pie-flavor for helping me to navigate my way through Kotlin 👍

todo

  • Generate javadocs jar, with Kappa
  • Document fully
  • Unit test, with Kotlintest

@jamierocks jamierocks marked this pull request as draft May 10, 2020 13:10
@jamierocks jamierocks changed the title WIP: Add Kotlin DSL Add Kotlin DSL May 10, 2020
@DenWav
Copy link
Contributor

DenWav commented Jul 15, 2020

Probably too late now, but might be worth breaking API compatibility to fix it. The lorenz-dsl-groovy module provides the org.cadixdev.lorenz.dsl package and this PR provides the org.cadixdev.lorenz.dsl.kotlin package. In order for these libraries to be compatible with JPMS modules can't provide the same package, so that's okay, but it would be nice if the lorenz-dsl-groovy module provided the org.cadixdev.lorenz.dsl.groovy package instead for consistency - and that would open the option for something like a lorenz-dsl project which could do something similar but with lambda expressions and provide near-DSL like support for Java.

@jamierocks
Copy link
Member Author

@DemonWav I'll eventually re-locate the Groovy one as per your suggestion, I'm sure that was my intention.

@jamierocks jamierocks added this to the 0.6.0 milestone Oct 5, 2020
@jamierocks
Copy link
Member Author

Alright, I've relocated the Groovy DSL. Hopefully I'll find some time over the next week or so to finish this off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kotlin DSL

2 participants