I've been attempting to run a java main from Gradle however Gradle keeps giving me the error
Execution failed for task ':myTask'
No main class specified
I've attached the code below
sourceSets {
main {
java {
srcDirs 'src/myPackage/downloadupdater'
srcDirs 'src/myPackage/downloadupdater/util'
srcDirs 'src/myPackage/downloadupdater/dao'
}
// output.classesDir = "/bin"
}
}
task myTask(dependsOn : compileJava, type : JavaExec){
group = "Custom"
description = "Acquires the weekly stats"
doLast{
classpath = sourceSets.main.output.classesDir
main = "myPackage.SomeClass"
args "-w"
}
}
The java class I'm calling is:
package myPackage
public class SomeClass{
private static DownloadUpdater updater;
public static void main (String [] args) {
updater = new DownloadUpdater();
updater.whichStatistics(args[0]);
updater.setCalendar();
updater.secureWorkbook();
updater.getStatistics();
}
}
After building, my directories come up with a build-classes-java-main-myPackage but gradle still can't find the main class.