From 1f6706d28b8d83579f18addbff132ebdfddab801 Mon Sep 17 00:00:00 2001 From: "A. G" Date: Sat, 17 Jun 2023 13:06:53 +0100 Subject: [PATCH] combine version information into single file it is annoying having to change 2 different files (Config and AppVersion) when updating Apex API version --- src/main/scala/com/neowit/apex/AppVersion.scala | 1 + src/main/scala/com/neowit/utils/Config.scala | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/neowit/apex/AppVersion.scala b/src/main/scala/com/neowit/apex/AppVersion.scala index b568362..e08db6e 100644 --- a/src/main/scala/com/neowit/apex/AppVersion.scala +++ b/src/main/scala/com/neowit/apex/AppVersion.scala @@ -27,6 +27,7 @@ import scala.concurrent.{ExecutionContext, Future} object AppVersion { val APP_NAME = "tooling-force.com" val VERSION = "0.5.8.0" + val SFDC_API_VERSION:Double = 58.0 } class AppVersion extends ApexAction { protected override def act()(implicit ec: ExecutionContext): Future[ActionResult] = { diff --git a/src/main/scala/com/neowit/utils/Config.scala b/src/main/scala/com/neowit/utils/Config.scala index 0f21bce..aee7e5e 100644 --- a/src/main/scala/com/neowit/utils/Config.scala +++ b/src/main/scala/com/neowit/utils/Config.scala @@ -19,10 +19,11 @@ package com.neowit.utils +import com.neowit.apex.AppVersion + import java.util.Properties import java.io.{File, FileWriter, OutputStream} import java.nio.file.{Files, Paths} - import com.neowit.auth._ import com.neowit.response.ResponseWriter import com.neowit.response.protocols.vim.ResponseWriterVim @@ -222,7 +223,7 @@ regardless of whether it is also specified in config file or not class Config(val basicConfig: BasicConfig) extends OAuth2JsonSupport with Logging{ - val apiVersion:Double = 57.0 + val apiVersion:Double = AppVersion.SFDC_API_VERSION //make BasicConfig methods available in Config def load(arglist: List[String]): Unit = {