Move data out of resources. Deliver as separate directory.
This commit is contained in:
parent
324afe8fd5
commit
a8ff9c3c6c
@ -11,7 +11,7 @@ repositories{
|
||||
|
||||
dependencies{
|
||||
implementation(spclibs.kotlin.gradle)
|
||||
implementation("com.github.mwiede:jsch:0.2.9")
|
||||
implementation("com.github.mwiede:jsch:0.2.17")
|
||||
}
|
||||
|
||||
gradlePlugin{
|
||||
|
@ -2,7 +2,9 @@ package space.kscience.snark.plugin
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.file.FileTree
|
||||
import org.gradle.api.distribution.DistributionContainer
|
||||
import org.gradle.kotlin.dsl.findByType
|
||||
import org.gradle.kotlin.dsl.named
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import java.io.File
|
||||
import java.time.LocalDateTime
|
||||
@ -43,10 +45,16 @@ public class SnarkGradlePlugin : Plugin<Project> {
|
||||
|
||||
tasks.getByName("processResources").dependsOn(writeBuildDate)
|
||||
|
||||
extensions.configure<org.gradle.api.tasks.SourceSetContainer>("sourceSets") {
|
||||
getByName("main") {
|
||||
logger.info("Adding ${snarkExtension.dataDirectory} to resources")
|
||||
resources.srcDir(snarkExtension.dataDirectory)
|
||||
}
|
||||
|
||||
plugins.withId("org.gradle.application"){
|
||||
extensions.findByType<DistributionContainer>()?.apply{
|
||||
named<org.gradle.api.distribution.Distribution>("main"){
|
||||
contents {
|
||||
from(snarkExtension.dataDirectory){
|
||||
into("data")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user