Skip to content

Commit

Permalink
Update scala-library to 3.3.3 (#96)
Browse files Browse the repository at this point in the history
Co-authored-by: Kizuki Yasue <kizuki-yasue@m3.com>
  • Loading branch information
kijuky and Kizuki Yasue authored Sep 23, 2024
1 parent bebdd66 commit 7c319c6
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This plugin is published to sonatype oss repository.
Include the plugin in `project/plugins.sbt`:

```scala
addSbtPlugin("org.scalatra.scalate" % "sbt-scalate-precompiler" % "1.9.6.0")
addSbtPlugin("org.scalatra.scalate" % "sbt-scalate-precompiler" % "1.10.0.0")
```

Configure the plugin in `build.sbt`:
Expand Down
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ lazy val precompiler = (project in file("precompiler")).settings(baseSettings).s
sbtPlugin := false,
name := "scalate-precompiler",
libraryDependencies += "org.scalatra.scalate" %% "scalate-core" % "1.10.1" % "compile",
crossScalaVersions := Seq("2.13.15", "2.12.20", "2.11.12")
crossScalaVersions := Seq("3.3.3", "2.13.15", "2.12.20", "2.11.12")
).disablePlugins(ScriptedPlugin)

lazy val plugin = (project in file("plugin")).settings(baseSettings).settings(
name := "sbt-scalate-precompiler",
sbtPlugin := true,
crossSbtVersions := Seq("1.3.10"),
crossSbtVersions := Seq("1.5.0"),
Compile / sourceGenerators += Def.task {
val file = (Compile / sourceManaged).value / organization.value.replace(".","/") / "Version.scala"
val code = {
Expand All @@ -26,7 +26,7 @@ object Version {

lazy val baseSettings = Seq(
organization := "org.scalatra.scalate",
version := "1.9.7.0",
version := "1.10.0.0-SNAPSHOT",
Global / transitiveClassifiers := Seq(Artifact.SourceClassifier),
Test / parallelExecution := false,
Test / logBuffered := false,
Expand Down
18 changes: 9 additions & 9 deletions plugin/src/main/scala/ScalatePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object ScalatePlugin extends AutoPlugin {
import ScalateKeys._

def scalateSourceGeneratorTask: Initialize[Task[Seq[File]]] = Def.task {
generateScalateSource(streams.value, new File((sourceManaged in Compile).value, "scalate"), (scalateLoggingConfig in Compile).value, (managedClasspath in scalateClasspaths).value, (scalateOverwrite in Compile).value, (scalateTemplateConfig in Compile).value)
generateScalateSource(streams.value, new File((Compile / sourceManaged).value, "scalate"), (Compile / scalateLoggingConfig).value, (scalateClasspaths / managedClasspath).value, (Compile / scalateOverwrite).value, (Compile / scalateTemplateConfig).value)
}

type Generator = {
Expand All @@ -67,8 +67,8 @@ object ScalatePlugin extends AutoPlugin {

val className = "org.fusesource.scalate.Precompiler"
val klass = classLoader.loadClass(className)
val inst = klass.newInstance
val generator = klass.newInstance.asInstanceOf[Generator]
val inst = klass.getDeclaredConstructor().newInstance()
val generator = klass.getDeclaredConstructor().newInstance().asInstanceOf[Generator]

val source = t.scalateTemplateDirectory
out.log.info("Compiling Templates in Template Directory: %s" format t.scalateTemplateDirectory.getAbsolutePath)
Expand Down Expand Up @@ -106,14 +106,14 @@ object ScalatePlugin extends AutoPlugin {

val scalateSettings: Seq[sbt.Def.Setting[_]] = Seq(
ivyConfigurations += Scalate,
scalateTemplateConfig in Compile := Seq(TemplateConfig(file(".") / "src" / "main" / "webapp" / "WEB-INF", Nil, Nil, Some("scalate"))),
scalateLoggingConfig in Compile := (resourceDirectory in Compile).value / "logback.xml",
Compile / scalateTemplateConfig := Seq(TemplateConfig(file(".") / "src" / "main" / "webapp" / "WEB-INF", Nil, Nil, Some("scalate"))),
Compile / scalateLoggingConfig := (Compile / resourceDirectory).value / "logback.xml",
libraryDependencies += "org.scalatra.scalate" %% "scalate-precompiler" % Version.version % Scalate.name,
sourceGenerators in Compile += scalateSourceGeneratorTask.taskValue,
watchSources ++= (scalateTemplateConfig in Compile).value.map(_.scalateTemplateDirectory).flatMap(d => (d ** "*").get),
Compile / sourceGenerators += scalateSourceGeneratorTask.taskValue,
watchSources ++= (Compile / scalateTemplateConfig).value.map(_.scalateTemplateDirectory).flatMap(d => (d ** "*").get),
scalateOverwrite := true,
managedClasspath in scalateClasspaths := Classpaths.managedJars(Scalate, classpathTypes.value, update.value),
scalateClasspaths := scalateClasspathsTask((fullClasspath in Runtime).value, (managedClasspath in scalateClasspaths).value))
scalateClasspaths / managedClasspath := Classpaths.managedJars(Scalate, classpathTypes.value, update.value),
scalateClasspaths := scalateClasspathsTask((Runtime / fullClasspath).value, (scalateClasspaths / managedClasspath).value))

/**
* Runs a block of code with the Scalate classpath as the context class loader.
Expand Down
4 changes: 1 addition & 3 deletions plugin/src/sbt-test/plugin/always_recompile/build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import org.fusesource.scalate.ScalatePlugin._
import ScalateKeys._

scalaVersion := "2.12.8"

resolvers += Resolver.file("ivy-local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.mavenStylePatterns)
scalaVersion := "2.12.20"

libraryDependencies += "org.scalatra.scalate" %% "scalate-core" % "1.10.1" % "compile"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
resolvers += Resolver.file("ivy-local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.mavenStylePatterns)

{
val pluginVersion = System.getProperty("plugin.version")
if (pluginVersion == null) {
Expand Down
4 changes: 1 addition & 3 deletions plugin/src/sbt-test/plugin/overwrite/build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import org.fusesource.scalate.ScalatePlugin._
import ScalateKeys._

scalaVersion := "2.12.8"

resolvers += Resolver.file("ivy-local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.mavenStylePatterns)
scalaVersion := "2.12.20"

libraryDependencies += "org.scalatra.scalate" %% "scalate-core" % "1.10.1" % "compile"

Expand Down
2 changes: 0 additions & 2 deletions plugin/src/sbt-test/plugin/overwrite/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
resolvers += Resolver.file("ivy-local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.mavenStylePatterns)

{
val pluginVersion = System.getProperty("plugin.version")
if (pluginVersion == null) {
Expand Down
4 changes: 1 addition & 3 deletions plugin/src/sbt-test/plugin/simple/build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import org.fusesource.scalate.ScalatePlugin._
import ScalateKeys._

scalaVersion := "2.12.8"

resolvers += Resolver.file("ivy-local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.mavenStylePatterns)
scalaVersion := "2.12.20"

libraryDependencies += "org.scalatra.scalate" %% "scalate-core" % "1.10.1" % "compile"

Expand Down
2 changes: 0 additions & 2 deletions plugin/src/sbt-test/plugin/simple/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
resolvers += Resolver.file("ivy-local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.mavenStylePatterns)

{
val pluginVersion = System.getProperty("plugin.version")
if (pluginVersion == null) {
Expand Down
3 changes: 3 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ sbt \
++2.13.x \
clean \
publishSigned \
++3.3.x \
clean \
publishSigned \
"project plugin" \
clean \
publishSigned

0 comments on commit 7c319c6

Please sign in to comment.