diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index e5e949750a..d3a6e78f1d 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -382,3 +382,36 @@ processResources.dependsOn compileJava javadoc { dependsOn resolve } + +task devRun(type: org.springframework.boot.gradle.tasks.run.BootRun) { + description = 'Runs the application quickly for development by skipping quality checks' + group = 'Application' + + // Configure the build to skip quality checks + gradle.taskGraph.whenReady { graph -> + if (graph.hasTask(devRun)) { + tasks.matching { task -> + task.name in ['checkstyle', 'checkstyleMain', 'checkstyleTest', + 'spotlessCheck', 'spotlessApply', + 'spotbugsMain', 'spotbugsTest', + 'javadoc', 'javadocJar', + 'modernizer'] + }.configureEach { + enabled = false + } + // Also disable error prone compilation flags + tasks.withType(JavaCompile).configureEach { + options.errorprone.enabled = false + } + } + } + + // Inherit all bootRun settings + classpath = bootRun.classpath + mainClass = bootRun.mainClass + jvmArgs = bootRun.jvmArgs + + doFirst { + println "Running in development mode - quality checks are disabled" + } +}