Skip to content

Commit

Permalink
fix template resources
Browse files Browse the repository at this point in the history
  • Loading branch information
barryoneill committed Nov 15, 2024
1 parent b841496 commit 38c718e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ lazy val plugin = project
publishSettings
)
.dependsOn(`plugin-shared`)
// .enablePlugins(BuildInfoPlugin, SbtPlugin)
.enablePlugins(BuildInfoPlugin, SbtPlugin)

lazy val `plugin-shared` = project
Expand All @@ -44,6 +43,7 @@ lazy val `plugin-shared` = project
name := "sbt-laserdisc-defaults-shared",
compileSettings,
publishSettings,
Compile / resourceGenerators += FileTemplates.copyToResources, // crucial for templating - see function comment
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2"),
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.1.0"),
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.4"),
Expand All @@ -55,7 +55,6 @@ lazy val `plugin-shared` = project
.enablePlugins(SbtPlugin, JavaAppPackaging, ScalafmtPlugin, GitPlugin)

def compileSettings = Seq(
Compile / resourceGenerators += FileTemplates.copyToResources,
scalacOptions ++= Seq(
"-encoding",
"UTF-8", // source files are in UTF-8
Expand Down
4 changes: 2 additions & 2 deletions project/FileTemplates.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ object FileTemplates {

val FileNames: List[String] = List(".scalafmt.conf", ".gitignore", "project/build.properties")

/** In order for the plugin to be able to template these config files at runtime, they need to
* be packaged with the plugin (so that they will be available in the classpath).
/** In order for plugin to be able to template these config files at runtime, they need to
* be packaged with the JAR (so that they will be available in the classpath).
*
* We could just maintain a separate set of files in the resources directory, but that's
* a maintenance overhead, and why risk somebody updating one, but not the other.. :)
Expand Down

0 comments on commit 38c718e

Please sign in to comment.