From fc99eb3e65b7a8fb25517782c760f7a1692bf2cc Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Sat, 19 Jan 2019 16:16:58 -0800 Subject: [PATCH] Add cache cleaning task for ML snapshot (#37505) The ML subproject of xpack has a cache for the cpp artifact snapshots which is checked on each build. The cache is outside of the build dir so that it is not wiped on a typical clean, as the artifacts can be large and do not change often. This commit adds a cleanCache task which will wipe the cache dir, as over time the size of the directory can become bloated. --- x-pack/plugin/ml/cpp-snapshot/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x-pack/plugin/ml/cpp-snapshot/build.gradle b/x-pack/plugin/ml/cpp-snapshot/build.gradle index e47566cc82c..e5b55293159 100644 --- a/x-pack/plugin/ml/cpp-snapshot/build.gradle +++ b/x-pack/plugin/ml/cpp-snapshot/build.gradle @@ -46,6 +46,10 @@ task downloadMachineLearningSnapshot { } } +task cleanCache(type: Delete) { + delete "${projectDir}/.cache" +} + artifacts { 'default' file: snapshotZip, name: 'ml-cpp', type: 'zip', builtBy: downloadMachineLearningSnapshot }