diff --git a/itests/cache.feature b/itests/cache.feature index 07457a4356d4a..7bc08ceff0896 100644 --- a/itests/cache.feature +++ b/itests/cache.feature @@ -3,7 +3,7 @@ Feature: cache Scenario: clear cache default When command('jbang cache clear') * match exit == 0 -* match err == "[jbang] Clearing cache for urls\n[jbang] Clearing cache for jars\n[jbang] Clearing cache for scripts\n[jbang] Clearing cache for stdins\n[jbang] Clearing cache for deps\n" +* match err == "[jbang] Clearing cache for urls\n[jbang] Clearing cache for jars\n[jbang] Clearing cache for kotlincs\n[jbang] Clearing cache for groovycs\n[jbang] Clearing cache for scripts\n[jbang] Clearing cache for stdins\n[jbang] Clearing cache for deps\n" Scenario: clear cache default When command('jbang cache clear --all') @@ -11,7 +11,7 @@ When command('jbang cache clear --all') * match err == "[jbang] Clearing cache for urls\n[jbang] Clearing cache for jars\n[jbang] Clearing cache for jdks\n[jbang] Clearing cache for kotlincs\n[jbang] Clearing cache for groovycs\n[jbang] Clearing cache for projects\n[jbang] Clearing cache for scripts\n[jbang] Clearing cache for stdins\n[jbang] Clearing cache for deps\n" Scenario: clear cache default -When command('jbang cache clear --all --no-jdk --no-url --no-jar --no-project --no-script --no-stdin --no-deps --no-kotlinc') +When command('jbang cache clear --all --no-jdk --no-url --no-jar --no-project --no-script --no-stdin --no-deps --no-kotlinc --groovyc') * match exit == 0 * match err == "" diff --git a/src/main/java/dev/jbang/cli/Cache.java b/src/main/java/dev/jbang/cli/Cache.java index 10973a2edcedd..6bc20ed7767c8 100644 --- a/src/main/java/dev/jbang/cli/Cache.java +++ b/src/main/java/dev/jbang/cli/Cache.java @@ -22,6 +22,8 @@ public Integer clear( "--jdk" }, description = "clear JDK cache only", negatable = true) Boolean jdks, @CommandLine.Option(names = { "--kotlinc" }, description = "clear kotlinc cache only", negatable = true) Boolean kotlincs, + @CommandLine.Option(names = { + "--groovyc" }, description = "clear groovyc cache only", negatable = true) Boolean groovys, @CommandLine.Option(names = { "--project" }, description = "clear temporary projects cache only", negatable = true) Boolean projects, @CommandLine.Option(names = { @@ -38,6 +40,7 @@ public Integer clear( && jars == null && jdks == null && kotlincs == null + && groovys == null && projects == null && scripts == null && stdins == null @@ -45,6 +48,8 @@ public Integer clear( // add the default (safe) set classes.add(dev.jbang.Cache.CacheClass.urls); classes.add(dev.jbang.Cache.CacheClass.jars); + classes.add(dev.jbang.Cache.CacheClass.kotlincs); + classes.add(dev.jbang.Cache.CacheClass.groovycs); classes.add(dev.jbang.Cache.CacheClass.scripts); classes.add(dev.jbang.Cache.CacheClass.stdins); classes.add(dev.jbang.Cache.CacheClass.deps); @@ -55,6 +60,7 @@ public Integer clear( toggleCache(jars, dev.jbang.Cache.CacheClass.jars, classes); toggleCache(jdks, dev.jbang.Cache.CacheClass.jdks, classes); toggleCache(kotlincs, dev.jbang.Cache.CacheClass.kotlincs, classes); + toggleCache(kotlincs, dev.jbang.Cache.CacheClass.groovycs, classes); toggleCache(deps, dev.jbang.Cache.CacheClass.deps, classes); toggleCache(projects, dev.jbang.Cache.CacheClass.projects, classes); toggleCache(scripts, dev.jbang.Cache.CacheClass.scripts, classes);