2020-06-21 09:55:22 -04:00
|
|
|
plugins {
|
|
|
|
id "scala"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "${projectGroup}"
|
|
|
|
version "${projectVersion}"
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compileOnly group: "org.scala-lang", name:"scala-library", version: "${scalaMajorVersion}.${scalaMinorVersion}"
|
|
|
|
|
|
|
|
compileOnly group: "org.apache.spark", name: "spark-core_${scalaMajorVersion}", version: "${apacheSparkVersion}"
|
|
|
|
compileOnly group: "org.apache.spark", name: "spark-sql_${scalaMajorVersion}", version: "${apacheSparkVersion}"
|
|
|
|
|
|
|
|
testImplementation group: "org.scalatest", name: "scalatest_${scalaMajorVersion}", version: "${scalaTestVersion}"
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
testImplementation.extendsFrom compileOnly
|
|
|
|
}
|
|
|
|
|
2023-03-16 07:32:45 -04:00
|
|
|
tasks.register('scalaTest', JavaExec) {
|
|
|
|
dependsOn['testClasses']
|
|
|
|
mainClass = 'org.scalatest.tools.Runner'
|
2020-06-21 09:55:22 -04:00
|
|
|
args = ['-R', 'build/classes/scala/test', '-o']
|
|
|
|
classpath = sourceSets.test.runtimeClasspath
|
|
|
|
}
|
|
|
|
|
|
|
|
test.dependsOn scalaTest
|
|
|
|
|
2020-11-25 02:35:56 -05:00
|
|
|
jar {
|
2020-06-21 09:55:22 -04:00
|
|
|
manifest {
|
|
|
|
attributes "Main-Class": "${mainClass}"
|
|
|
|
}
|
2020-11-25 02:35:56 -05:00
|
|
|
from {
|
2023-03-16 07:32:45 -04:00
|
|
|
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
2020-11-25 02:35:56 -05:00
|
|
|
}
|
2020-06-21 09:55:22 -04:00
|
|
|
archiveFileName.set("${getArchiveBaseName().get()}-${projectVersion}.${getArchiveExtension().get()}")
|
|
|
|
}
|
|
|
|
|
|
|
|
clean.doFirst {
|
|
|
|
delete "logs/"
|
2020-11-25 02:35:56 -05:00
|
|
|
}
|