import java.time.LocalDateTime import java.time.format.DateTimeFormatter plugins { java application id("com.github.johnrengelman.shadow") version "5.2.0" } group = "com.fanruan.hihidata" version = "1.0-SNAPSHOT" tasks.withType().configureEach { options.encoding = "UTF-8" } application { mainClassName = "com.fanruan.hihidata.datasource.server.ServerApplication" } repositories { mavenCentral() maven(url = "https://mvn.fanruan.com/repository/maven-public/") } dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) implementation("com.google.guava:guava:31.1-jre") implementation("org.apache.httpcomponents:httpclient:4.5.13") testImplementation("junit:junit:4.12") } java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } fun now(): String { val current = LocalDateTime.now() val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm") return current.format(formatter) } tasks.withType { archiveClassifier.set("fat") manifest { attributes(mapOf("Specification-Version" to now())) } } tasks.withType { setProperty("archiveFileName", "api-datasource-server.jar") }