plugins {
    id 'java'
}

// tag::file-deps[]
repositories {
    flatDir {
        name = 'libs dir'
        dir file('libs')  // <1>
    }
}

dependencies {
    implementation files('libs/our-custom.jar')  // <2>
    implementation ':log4j:1.2.8', ':commons-io:2.1'  // <3>
}
// end::file-deps[]

// tag::retrieve-deps[]
task retrieveRuntimeDependencies(type: Copy) {
    into "$buildDir/libs"
    from configurations.runtimeClasspath
}
// end::retrieve-deps[]

// tag::properties[]
ext {
    tmpDistDir = file("$buildDir/dist")
}

task javadocJar(type: Jar) {
    from javadoc  // <1>
    archiveClassifier = 'javadoc'
}

task unpackJavadocs(type: Copy) {
    from zipTree(javadocJar.archiveFile)  // <2>
    into tmpDistDir  // <3>
}
// end::properties[]
