У меня есть проект, в котором build.gradle жестко запрограммирован с пакетом зависимостей (: config-packages: geocloud-relay-cfg-dev-lxd), как показано ниже
plugins {
id "nebula.ospackage" version "5.2.0"
}
def configname="$configname"
project.evaluationDependsOn ':acds-pkg'
project.evaluationDependsOn ':config-packages:configname'
project.buildDir = "${rootProject.buildDir}/rpm/${project.name}"
apply plugin: "nebula.ospackage"
buildRpm {
requires("java-1.8.0-openjdk-devel")
directory("/opt/geocloud", 0755)
}
task createDataDir(type: Copy) {
dependsOn project(':config-packages:configname').tasks['configTar']
from tarTree(resources.gzip(project(':config-packages:configname').buildDir.toString() \
+ "/distributions/configname-${project.version}.tar.gz"))
into file("${project.buildDir}/data")
}
ospackage {
packageName 'geocloud-caac'
version "${project.version}_${getDate()}"
release '2'
arch 'X86_64'
os 'LINUX'
type 'BINARY'
summary 'Creating CAAC RPM package'
from("${project.buildDir}/data") {
into "/opt/geocloud/"
fileMode = 755
}
postInstall file("postInstallCaac.sh")
}
tasks['createDataDir'].dependsOn project(':config-packages:configname').tasks['configTar']
tasks['buildRpm'].dependsOn tasks['cleanBuildRpm']
tasks['buildRpm'].dependsOn tasks['createDataDir']
tasks['createDataDir'].dependsOn tasks['cleanCreateDataDir']
Пробовал ниже
. / Gradlew buildRpm -pconfigname = some-config-name
, но проблема не сработала, как показано ниже
* What went wrong:
A problem occurred evaluating project ':rpm:caac'.
> Project with path ':config-packages:configname' could not be found in project ':rpm:caac'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Моя основная идея заключается в параметризации зависимостипроекта в build.gradle, я ищу то же самое.