I'm learning gradle and saw a build.gradle which i'd really like to understand. I tried searching through the docs but couldn't figure this out.
configurations {
provided
}
sourceSets {
main {
compileClasspath += configurations.provided
}
}
- Is the
configurations
documented somewhere? Is provided just a list of dependencies available at runtime ? (I read about provided but didn't know if it was the same)
A run task is also defined:
task run(type: JavaExec, dependsOn: classes) {
main = mainClassFile
classpath sourceSets.main.runtimeClasspath
classpath configurations.runtime
}
The mainClassFile
is defined in the gradle.properties file:
mainClassFile=template.project.Main
Where does the
configurations.runtime
come from?Finally, the following plugins are used:
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '1.2.3'
}
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'idea'
Is the java plugin needed if we use a scala plugin? Or defining both a better approach? I understand that we should use either plugins {} or apply but just copy-ing what the build.gradle has so I can understand it.