how to execute independant javaexec tasks

155 views Asked by At

I have a gradle project titled 'FunctionalityMaintainer' I am trying to execute two JavaExec tasks in a build.gradle, but independantly. The following is the structure of my 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')]
}

If I execute say deleteZip task, with the following command -

gradle deleteZip -PzipPath='D:/PathtoZip'

It fails with the error,

could not get unknown property 'baseDir' for root project 'FunctionalityMaintainer' of type org.gradle.api.Project. 

Can somebody please tell me what am I doing wrong?

0

There are 0 answers