wilkinsona / project-generator

3 stars 4 forks source link

Enhance Gradle task customisation to support requirements of projects using Kotlin #9

Closed wilkinsona closed 5 years ago

wilkinsona commented 5 years ago

A project that uses Kotlin needs to be able to do task customisation like this:

compileKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

The current implementation was driven by requirements from Spring REST Docs and only supports customisation like this:

asciidoctor { 
    inputs.dir snippetsDir 
    dependsOn test 
}

We need to support the nesting (kotlinOptions in this specific case). We also need to look at the difference between jvmTarget = "1.8" and jvmTarget "1.8". We may need to support both.

wilkinsona commented 5 years ago

The compileKotlin customization can be written like this using the current functionality:

compileKotlin {
    kotlinOptions.freeCompilerArgs = ["-Xjsr305=strict"]
    kotlinOptions.jvmTarget = "1.8"
}

We definitely need to support assignment.

wilkinsona commented 5 years ago

Fixed in 094b58cd3d5b4a2da47b1f3ef53043603347f141.