Kotlin-dsl-samples: local dependencies

Created on 14 Oct 2017  路  7Comments  路  Source: gradle/kotlin-dsl-samples

Hi,

I am stuck with this. I define a local repository and wanted to use all the *.jar inside the lib/junit folder as my testCompile dependencies. So not sure how to do that. Any sample code that I can use for reference?

plugins {
    java
}

repositories {
    flatDir {
        dirs("lib/junit")
    }
}
dependencies{
     //what syntax/api to use??
}

All 7 comments

What are you doing now that isn't working?

Hi,

Just trying to know how to write the kotlin dsl for seting up dependencies which is on my local file system

Maybe something like:

dependencies {
  compile(file("lib/junit.jar"))
}

But it really is not clear what it is you are trying to do and what isn't working.

What have you tried? Where are you getting stuck?

Hi,

Yes. I am looking for the syntax on how to refer to dependencies on my file system, and you have solved my query. Thanks mkobit!
I was wishing that someone could compile a list of mapping of api and syntax between kolin vs groovy DSL in the context of gradle

Awesome, glad I could help.

The Kotlin Slack #gradle channel might be able to help you with these kinds of things faster in the future. The documentation is still a work-in-progress, so it might not have everything just yet.

The sample may have something closer to what you are looking for, so it is usually a good start.

Maybe something like:

dependencies {
  compile(file("lib/junit.jar"))
}

But it really is not clear what it is you are trying to do and what isn't working.

What have you tried? Where are you getting stuck?

Actually, it's compile(files("libs/f1.jar"[,...])).

Was this page helpful?
0 / 5 - 0 ratings