From d588328ea907b6f4db38ee687877f295d7c530b0 Mon Sep 17 00:00:00 2001 From: Brian Holt Date: Fri, 4 Oct 2024 22:24:31 -0500 Subject: [PATCH] properly isolate the cache stores --- .../smithy4s/codegen/Smithy4sCodegenPlugin.scala | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/codegen-plugin/src/smithy4s/codegen/Smithy4sCodegenPlugin.scala b/modules/codegen-plugin/src/smithy4s/codegen/Smithy4sCodegenPlugin.scala index 90216f42c..a97ac8a3c 100644 --- a/modules/codegen-plugin/src/smithy4s/codegen/Smithy4sCodegenPlugin.scala +++ b/modules/codegen-plugin/src/smithy4s/codegen/Smithy4sCodegenPlugin.scala @@ -264,16 +264,13 @@ object Smithy4sCodegenPlugin extends AutoPlugin { (config / sourceManaged).value / "smithy" / "generated-metadata.smithy" }, config / smithy4sGeneratedSmithyFiles := { - val cacheFactory = (config / streams).value.cacheStoreFactory + val cacheFactory = + (config / streams).value.cacheStoreFactory.sub(scalaVersion.value) val cached = Tracked.inputChanged[(String, Boolean), Seq[File]]( - cacheFactory.make( - s"smithy4sGeneratedSmithyFilesInput${scalaVersion.value}" - ) + cacheFactory.make("smithy4sGeneratedSmithyFilesInput") ) { case (changed, (wildcardArg, shouldGenerateOptics)) => val lastOutput = Tracked.lastOutput[Boolean, Seq[File]]( - cacheFactory.make( - s"smithy4sGeneratedSmithyFilesOutput${scalaVersion.value}" - ) + cacheFactory.make("smithy4sGeneratedSmithyFilesOutput") ) { case (changed, prevResult) => if (changed || prevResult.isEmpty) { val file = @@ -458,14 +455,15 @@ object Smithy4sCodegenPlugin extends AutoPlugin { smithyBuild = smithyBuildValue ) + val cacheStoreFactory = s.cacheStoreFactory.sub(scalaVersion.value) val cached = CachedTask.inputChanged[CodegenArgs, Seq[File]]( - s.cacheStoreFactory.make(s"input${scalaVersion.value}"), + cacheStoreFactory.make("input"), s.log ) { Function.untupled { Tracked.lastOutput[(Boolean, CodegenArgs), Seq[File]]( - s.cacheStoreFactory.make(s"output${scalaVersion.value}") + cacheStoreFactory.make("output") ) { case ((inputChanged, args), outputs) => if (inputChanged || outputs.isEmpty) { s.log.debug(s"[smithy4s] Input changed: $inputChanged")