Skip to content
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

Provide an extension to configure the default task #212

Open
thc202 opened this issue Sep 14, 2018 · 3 comments
Open

Provide an extension to configure the default task #212

thc202 opened this issue Sep 14, 2018 · 3 comments

Comments

@thc202
Copy link
Contributor

thc202 commented Sep 14, 2018

It's considered best practice to configure the default task through an extension.

This also has the advantage of providing a more similar configuration for Groovy and Kotlin DSLs.

Currently, in Groovy DSL you can simply do:

htmlSanityCheck {
    sourceDir = file("src/main/docs")
}

but in Kotlin DSL you need to be more explicit and get the task, e.g.:

tasks.named<org.aim42.htmlsanitycheck.HtmlSanityCheckTask>("htmlSanityCheck") {
    sourceDir = file("src/main/docs")
}

which is more verbose than the usual/ideal.

It might also be a good opportunity to start using lazy properties and task configuration avoidance.

@gernotstarke
Copy link
Member

  • Sorry, I have absolutely no experience in Kotlin :-(
  • The idea of configuring through extension seems nice on first read, but I'm quite sure I won't find time to implement that before October...

I'm open for suggestions on how to proceed here. Is it an urgent issue for you?

again, thanx for your research and contribution

@thc202
Copy link
Contributor Author

thc202 commented Sep 19, 2018

This can be implemented in Groovy (the Kotlin DSL is just another consumer), happy to contribute that.

No urgency, just a good to have.

@ascheman
Copy link
Member

We are currently modularising HSC and therefore reorganising the complete build (cf. #309 and the develop branch of the project). Are you still interested in contributing a respective extension, @thc202? I'd be happy to see a PR.

You seem to be very familiar with Gradle. If you happen to have some time, reviewing the modular build, I'd appreciate any feedback as well.

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

No branches or pull requests

3 participants