Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update from velocity:1.7 to velocity-engine-core:2.3 #119

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading