<@U7XT42Q84> you need to update dependencies secti...
# announcements
r
@jamie-purchase you need to update dependencies section of build.gradle (add used dependency there). Gradle supports adding dependencies from repositories and also from local files system (if jar-library was built locally and was not published as artifact)
j
yeah I was looking at http://zweifisch.github.io/kotlin-with-gradle.html and it shows something like
Copy code
dependencies {
    ...
    compile 'com.github.kevinsawicki:http-request:6.0'
    ...
}
but I can't find an example of the syntax for path/classpath to/for local jar
r
compile fileTree(dir: ‘imports’, include: ‘*.jar’) where imports is a directory with jar in root project
j
brilliant thanks
m
You can do that or you can create a local repository... On the project that is going to be imported, add this to your build.gradle adjusting the path as you prefer:
Copy code
uploadArchives {
    repositories {
        flatDir dir: "${System.getProperty('user.home')}/.gradle/repos"
    }
}
Now you have that directive, use it to compile and upload your class to the repo. On the other project, add this to the repositories:
Copy code
repositories {
    flatDir dirs: "${System.getProperty('user.home')}/.gradle/repos/"
    mavenCentral()
    }
}
Then you can import like any other depedency...
Copy code
compile("com.company:com.company.package:0.0.1")
So you can have versioning,etc...