-
Notifications
You must be signed in to change notification settings - Fork 57
Project Structure
Alberto Gallardo edited this page Aug 28, 2015
·
5 revisions
This is still a draft. If deemed necessary, it should be listed in the Sidebar
The dependencies node will divide dependencies into the three categories: compile, provided, runtime. These mimics maven's dependency scopes.
Consider the following build script:
apply plugin: 'java'
repositories {
mavenCentral()
}
sourceSets.main {
// This will be provided by the runtime environment
compileClasspath += files("lib/serverAPI.jar")
// This is a directory
compileClasspath += files("extDir")
compileClasspath += files("lib/hello.jar")
runtimeClasspath += files("extDir")
runtimeClasspath += files("lib/hello.jar")
// Implementation required only in runtime
runtimeClasspath += files("lib/helloimpl.jar")
}
// Maven dependencies
dependencies {
compile 'org.slf4j:slf4j-api:1.7.12'
// Implementation required only in runtime
runtime 'org.slf4j:slf4j-simple:1.7.12'
}
Its dependencies node will look like: