我有一个名为“FunctionalityMaintainer”的 gradle 项目,我正在尝试在 build.gradle 中执行两个 JavaExec 任务,但它们是独立的。以下是我的 build.gradle 的结构
task(findPattern, dependsOn:'classes', type:JavaExec){
main = 'org.package.somepackage1.PatternMatcher'
classpath = sourceSets.main.runtimeClasspath
args = [project.getProperty('baseDir'), project.getProperty('playGroundWorkspace')]
}
task(deleteZip, dependsOn:'classes', type:JavaExec){
main = 'org.package.somepackage2.ZipDeleter'
classpath = sourceSets.main.runtimeClasspath
args = [project.getProperty('zipPath')]
}
如果我执行说 deleteZip 任务,使用以下命令 -
gradle deleteZip -PzipPath='D:/PathtoZip'
它因错误而失败,
could not get unknown property 'baseDir' for root project 'FunctionalityMaintainer' of type org.gradle.api.Project.
有人可以告诉我我在做什么错吗?