Skip to content

Commit

Permalink
Merge pull request #119 from SumoLogic-Labs/velocity-engine_2.3
Browse files Browse the repository at this point in the history
update from velocity:1.7 to velocity-engine-core:2.3
  • Loading branch information
mccartney authored Jun 24, 2024
2 parents 7f24477 + 84c5664 commit 1f6621f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
ext.scalaSlackClientVersion = '0.4.0'
ext.scalatestVersion = '3.0.9'
ext.slf4jVersion = '2.0.13'
ext.velocityVersion = '1.7'
ext.velocityVersion = '2.3'
}

allprojects {
Expand All @@ -36,13 +36,12 @@ allprojects {
group = "com.sumologic.shellbase"
description = "Sumo Logic's Scala-based interactive shell framework"

version = '3.0.0'
version = '4.0.0'

sourceCompatibility = javaSourceVersion
targetCompatibility = javaTargetVersion

repositories {
jcenter()
mavenCentral()
}

Expand Down Expand Up @@ -162,7 +161,7 @@ project(':shellbase-core') {
implementation "commons-cli:commons-cli:${commonsCliVersion}"
implementation "commons-io:commons-io:${commonsIoVersion}"
implementation "jline:jline:${jlineVersion}"
implementation "org.apache.velocity:velocity:${velocityVersion}"
implementation "org.apache.velocity:velocity-engine-core:${velocityVersion}"
implementation "org.scala-lang:scala-library:${scalaMajorVersion}.${scalaMinorVersion}"
}
}
Expand All @@ -172,7 +171,7 @@ project(':shellbase-example') {
implementation project(':shellbase-core')
implementation "jline:jline:${jlineVersion}"
implementation "org.scala-lang:scala-library:${scalaMajorVersion}.${scalaMinorVersion}"
implementation "org.apache.velocity:velocity:${velocityVersion}"
implementation "org.apache.velocity:velocity-engine-core:${velocityVersion}"
implementation "commons-cli:commons-cli:${commonsCliVersion}"
}
}
Expand All @@ -183,7 +182,7 @@ project(':shellbase-slack') {
implementation "com.github.slack-scala-client:slack-scala-client_${scalaMajorVersion}:${scalaSlackClientVersion}"
implementation "jline:jline:${jlineVersion}"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
implementation "org.apache.velocity:velocity:${velocityVersion}"
implementation "org.apache.velocity:velocity-engine-core:${velocityVersion}"
implementation "commons-cli:commons-cli:${commonsCliVersion}"
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'all'
rootProject.name = 'shellbase'
include 'shellbase-core', 'shellbase-example', 'shellbase-slack'

determineAndSetScalaVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ package com.sumologic.shellbase

import java.io._
import java.util.Properties

import org.apache.commons.io.IOUtils
import org.apache.velocity.VelocityContext
import org.apache.velocity.app.{Velocity, VelocityEngine}

import java.util
import scala.collection.JavaConverters._

object VelocityRenderer {
Expand Down Expand Up @@ -62,7 +62,7 @@ object VelocityRenderer {
}

def createScriptFromTemplate(scriptResource: String,
variables: Map[AnyRef, AnyRef] = Map[AnyRef, AnyRef]()): File = {
variables: Map[String, AnyRef] = Map[String, AnyRef]()): File = {
val engine = new VelocityEngine()
engine.setProperty("resource.loader", "class")
engine.setProperty("class.resource.loader.description", "Velocity Classpath Resource Loader")
Expand All @@ -74,7 +74,7 @@ object VelocityRenderer {

val tempFile = File.createTempFile(".tmp", ".sh")

val modifiableVariables = new java.util.HashMap[AnyRef, AnyRef]()
val modifiableVariables: util.HashMap[String, AnyRef] = new java.util.HashMap[String, AnyRef]()
modifiableVariables.asScala ++= variables

val writer = new FileWriter(tempFile)
Expand Down

0 comments on commit 1f6621f

Please sign in to comment.