plugins { id 'java' } sourceCompatibility = 11 targetCompatibility = 11 repositories { mavenCentral() } version = '2.0.0' sourceSets { main { java { srcDir 'src/main/java' } } test { java { srcDir 'src/test/java' } } } dependencies { // Logging runtime 'org.apache.logging.log4j:log4j-api:2.11.1' runtime 'org.apache.logging.log4j:log4j-core:2.11.1' compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.1' // HTTP Framework compile 'io.javalin:javalin:3.6.0' compile 'org.freemarker:freemarker:2.3.28' compile 'org.apache.httpcomponents:httpclient:4.5.7' // JSON Mapping/Marshalling compile 'com.fasterxml.jackson.core:jackson-databind:2.9.6' compile 'com.fasterxml.jackson.core:jackson-core:2.9.6' compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.6' // Database compile 'com.zaxxer:HikariCP:3.3.1' compile 'org.mariadb.jdbc:mariadb-java-client:2.4.0' compile 'org.flywaydb:flyway-core:6.1.0' // MISC compile 'org.apache.commons:commons-lang3:3.7' // Unit Testing testCompile 'junit:junit:4.11' testCompile 'org.mockito:mockito-core:1.10.19' } jar { manifest { attributes "Main-Class": "io.linuxserver.fleet.core.Main" } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } exclude 'META-INF/INDEX.LIST', 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' } task configureLogConfiguration(type: Copy) { def logFile = project.hasProperty('env') ? "${env}" : 'local' from "config/log4j2.${logFile}.xml" into 'src/main/resources' rename "log4j2.${logFile}.xml", 'log4j2.xml' } task buildVersionProperties() { doFirst { def versionProperties = new Properties() def propFile = new File("src/main/resources/version.properties") versionProperties.load(propFile.newDataInputStream()); versionProperties.setProperty("app.version", project.version.toString()) versionProperties.setProperty("app.build.user", System.getProperty("user.name")) versionProperties.setProperty("app.build.date", new Date().format("yyyy-MM-dd'T'HH:mm:ss")) versionProperties.setProperty("app.build.os", System.getProperty("os.name")) versionProperties.store(propFile.newWriter(), null) } } build.dependsOn configureLogConfiguration, buildVersionProperties