From 1cb28d26b954a24e5549fede6328f1222ce2a758 Mon Sep 17 00:00:00 2001 From: Kristof Jozsa Date: Mon, 6 Jan 2025 18:12:42 +0100 Subject: [PATCH] add developer run mode --- fineract-provider/build.gradle | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index e5e949750aa..d3a6e78f1d5 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" + } +}