Newer
Older
COMP101_JDBC_demo / build.gradle
plugins {
    id 'java'
    id 'application'
    id 'com.github.johnrengelman.shadow' version '5.2.0'
}

repositories {
    jcenter()
}

dependencies {
    def oracleVer =  '12.2.0.1'
    compile group: 'com.oracle.database.jdbc', name: 'ojdbc8', version: oracleVer
}

run {
    standardInput = System.in
}

task createMissingSourceDirs {
    group = "Source Directories"
    description = "Create all of the missing source directories for this project."
    doFirst {
        sourceSets.each { def sourceRoot ->
            sourceRoot.allSource.srcDirTrees.each { def sourceDir ->
                if(!sourceDir.dir.exists()) {
                    println "Creating ${sourceDir}"
                    mkdir sourceDir.dir
                }
            }
        }
    }
}

task deleteEmptySourceDirs {
    group = "Source Directories"
    description = "Delete all empty source directories."
    doFirst {
        sourceSets.each { def sourceRoot ->
            sourceRoot.allSource.srcDirTrees.each { def sourceDir ->
                if(sourceDir.dir.exists() && sourceDir.dir.isDirectory() && sourceDir.dir.list().length == 0) {
                    println "Removing empty ${sourceDir}"
                    sourceDir.dir.delete()
                }
            }
        }
    }

}

mainClassName = 'ui.WaterQualityReporter'