Как поручить Gradle помещать зависимости компиляции в каталог alt - PullRequest
0 голосов
/ 18 февраля 2020

Я хотел бы поместить скомпилированные groovy зависимости не в ~/.groovy/grapes, а в каталог по своему выбору.

Я использую gradle kotlin - кто-нибудь делал это раньше? Я вижу много предложений, но самое лучшее, что я могу придумать, это уплощенный список всех удаленных зависимостей, а не оригинальная структура папок.

В моем сценарии используется копия, но, по моему мнению, простое переопределение каталога зависимостей должно быть намного чище

plugins {
    groovy
}
sourceSets {
    main {
        withConvention(GroovySourceSet::class) {
            groovy {
                setSrcDirs(listOf("fs/var/jenkins_home/init.groovy.d"))
            }
        }
    }
}
repositories {
    mavenCentral()
    maven{
        url = uri("https://repo.jenkins-ci.org/public/")
    }
}

dependencies {
    // Use the latest Groovy version for building this library
    implementation("org.codehaus.groovy:groovy-all:2.5.8")
    implementation("org.jenkins-ci.plugins:cloudbees-folder:5.12")
    implementation("org.jenkins-ci.plugins.workflow:workflow-aggregator:2.5")
    implementation("org.jenkins-ci.plugins:git:3.3.2")
    implementation("com.github.kostyasha.yet-another-docker:yet-another-docker-plugin:0.1.0-rc37")
    implementation("com.synopsys.jenkinsci:ownership:0.10.0")
    implementation("com.synopsys.arc.jenkinsci.plugins:job-restrictions:0.6")
    implementation("org.jenkins-ci.plugins:role-strategy:2.5.1")


}

task<Copy>("deps") {
    description = "Copies the dependencies necessary for our scripts into the grapes directory"
    dependsOn(tasks.findByName("compileGroovy"))
    from(configurations.compileClasspath)
    into("fs/var/jenkins_home/.groovy/grapes")
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...