Move data out of resources. Deliver as separate directory.

This commit is contained in:
Alexander Nozik 2024-03-02 19:10:57 +03:00
parent 324afe8fd5
commit a8ff9c3c6c
2 changed files with 14 additions and 6 deletions

View File

@ -11,7 +11,7 @@ repositories{
dependencies{ dependencies{
implementation(spclibs.kotlin.gradle) implementation(spclibs.kotlin.gradle)
implementation("com.github.mwiede:jsch:0.2.9") implementation("com.github.mwiede:jsch:0.2.17")
} }
gradlePlugin{ gradlePlugin{

View File

@ -2,7 +2,9 @@ package space.kscience.snark.plugin
import org.gradle.api.Plugin import org.gradle.api.Plugin
import org.gradle.api.Project 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 org.gradle.kotlin.dsl.withType
import java.io.File import java.io.File
import java.time.LocalDateTime import java.time.LocalDateTime
@ -43,10 +45,16 @@ public class SnarkGradlePlugin : Plugin<Project> {
tasks.getByName("processResources").dependsOn(writeBuildDate) tasks.getByName("processResources").dependsOn(writeBuildDate)
extensions.configure<org.gradle.api.tasks.SourceSetContainer>("sourceSets") { }
getByName("main") {
logger.info("Adding ${snarkExtension.dataDirectory} to resources") plugins.withId("org.gradle.application"){
resources.srcDir(snarkExtension.dataDirectory) extensions.findByType<DistributionContainer>()?.apply{
named<org.gradle.api.distribution.Distribution>("main"){
contents {
from(snarkExtension.dataDirectory){
into("data")
}
}
} }
} }
} }