@@ -39,11 +39,21 @@ object SmithyTraitCodegenPlugin extends AutoPlugin {
3939 " Dependencies to be added into codegen model"
4040 )
4141
42+ val smithyTraitCodegenSourceDirectory = settingKey[File ](
43+ " The directory where the smithy sources are located"
44+ )
45+
46+ val smithyTraitCodegenTargetDirectory = settingKey[File ](
47+ " The directory where the generated Java sources and resources will be placed"
48+ )
49+
4250 }
4351
4452 import autoImport .*
4553
4654 override def projectSettings : Seq [Setting [? ]] = Seq (
55+ smithyTraitCodegenSourceDirectory := (Compile / resourceDirectory).value / " META-INF" / " smithy" ,
56+ smithyTraitCodegenTargetDirectory := (Compile / target).value,
4757 Keys .generateSmithyTraits := Def .task {
4858 import sbt .util .CacheImplicits .*
4959 val s = (Compile / streams).value
@@ -64,8 +74,8 @@ object SmithyTraitCodegenPlugin extends AutoPlugin {
6474 val args = SmithyTraitCodegen .Args (
6575 javaPackage = smithyTraitCodegenJavaPackage.value,
6676 smithyNamespace = smithyTraitCodegenNamespace.value,
67- targetDir = os.Path (( Compile / target) .value),
68- smithySourcesDir = PathRef (( Compile / resourceDirectory) .value / " META-INF " / " smithy " ),
77+ targetDir = os.Path (smithyTraitCodegenTargetDirectory .value),
78+ smithySourcesDir = PathRef (smithyTraitCodegenSourceDirectory .value),
6979 dependencies = jars.map(PathRef (_)).toList,
7080 )
7181 val cachedCodegen =
@@ -82,7 +92,7 @@ object SmithyTraitCodegenPlugin extends AutoPlugin {
8292 .fold {
8393 SmithyTraitCodegen .generate(codegenArgs)
8494 } { last =>
85- logger.info(s " Using cached result of smithy-trait-codegen " )
95+ logger.info(" Using cached result of smithy-trait-codegen" )
8696 last
8797 }
8898 }
0 commit comments