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

Support alternative to string-based dependency configuration syntax, e.g. "testCompile"(...) #36

Closed
cbeams opened this Issue May 30, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@cbeams
Contributor

cbeams commented May 30, 2016

@cbeams cbeams added this to the 1.0.0-M2 milestone May 30, 2016

@cbeams cbeams changed the title from Support alternative to string-based dependency configuration syntax to Support alternative to string-based dependency configuration syntax, e.g. "testCompile(...)" May 31, 2016

@cbeams cbeams changed the title from Support alternative to string-based dependency configuration syntax, e.g. "testCompile(...)" to Support alternative to string-based dependency configuration syntax, e.g. "testCompile"(...) May 31, 2016

@DanielThomas

This comment has been minimized.

Show comment
Hide comment
@DanielThomas

DanielThomas Jun 2, 2016

Thought I'd copy this here for you - Kotlin Slack is limited to 10K messages, and I'd expect this to be bumped out of the history pretty quickly:

val DependencyHandler.testCompile by DependencyProperty

interface DependencyHandler {
    fun add(s: String, s2: String)
}

object DependencyProperty {
    operator fun getValue(handler: DependencyHandler, property: KProperty<*>): (String) -> Unit = {
        handler.add(property.name, it)
    }
}

fun dependencies(d: DependencyHandler.() -> Unit) {
}

fun test() {
    dependencies {
        testCompile("")
    }
}

DanielThomas commented Jun 2, 2016

Thought I'd copy this here for you - Kotlin Slack is limited to 10K messages, and I'd expect this to be bumped out of the history pretty quickly:

val DependencyHandler.testCompile by DependencyProperty

interface DependencyHandler {
    fun add(s: String, s2: String)
}

object DependencyProperty {
    operator fun getValue(handler: DependencyHandler, property: KProperty<*>): (String) -> Unit = {
        handler.add(property.name, it)
    }
}

fun dependencies(d: DependencyHandler.() -> Unit) {
}

fun test() {
    dependencies {
        testCompile("")
    }
}

bamboo added a commit that referenced this issue Jun 20, 2016

bamboo added a commit that referenced this issue Jun 20, 2016

bamboo added a commit that referenced this issue Jun 21, 2016

Favor configuration extensions
This reverts commit 0297783.

See #36

bamboo added a commit that referenced this issue Jun 21, 2016

Move configuration extensions to DependencyHandler
So they can also be used with regular dot invocation syntax:

    dependencies.testCompile("junit:junit:4.12")

See #36
@cbeams

This comment has been minimized.

Show comment
Hide comment
@cbeams

cbeams Jun 21, 2016

Contributor

Resolving as complete with the above commits. @bamboo, I assume it was just an oversight that you didn't close this yourself.

Contributor

cbeams commented Jun 21, 2016

Resolving as complete with the above commits. @bamboo, I assume it was just an oversight that you didn't close this yourself.

@cbeams cbeams closed this Jun 21, 2016

@bsideup

This comment has been minimized.

Show comment
Hide comment
@bsideup

bsideup Jun 22, 2016

AFAIR this one was proposed by me :D Yay :D

bsideup commented Jun 22, 2016

AFAIR this one was proposed by me :D Yay :D

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