From 72fed8f256ca2298f2d22dd70595803911a0b2b8 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Fri, 26 Jul 2019 10:22:16 -0400 Subject: [PATCH] Upgrade cds spring and kotlin versions. Change-Id: I0f323bd13c433d9ef0e207f51234d10cd8c22858 Issue-ID: CCSDK-1352 Signed-off-by: Brinda Santh --- components/parent/pom.xml | 5 ----- ...rocessor.cba.kts => InternalRAProcessor.cba.kt} | 0 ms/blueprintsprocessor/parent/pom.xml | 8 ++------ .../core/scripts/BluePrintScriptingHost.kt | 22 ++++++++++------------ ms/controllerblueprints/parent/pom.xml | 5 ----- 5 files changed, 12 insertions(+), 28 deletions(-) rename ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/scripts/{InternalRAProcessor.cba.kts => InternalRAProcessor.cba.kt} (100%) diff --git a/components/parent/pom.xml b/components/parent/pom.xml index 4411b84f9..821448d66 100644 --- a/components/parent/pom.xml +++ b/components/parent/pom.xml @@ -29,11 +29,6 @@ pom 1.8 - 2.1.3.RELEASE - 5.1.5.RELEASE - 1.3.21 - 1.3.21 - 1.1.1 1.18.0 3.6.1 1.0.0 diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/scripts/InternalRAProcessor.cba.kts b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/scripts/InternalRAProcessor.cba.kt similarity index 100% rename from ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/scripts/InternalRAProcessor.cba.kts rename to ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/scripts/InternalRAProcessor.cba.kt diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index b03c7b4d7..1ed0a6570 100755 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -14,7 +14,8 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.cds @@ -28,11 +29,6 @@ Blueprints Processor Parent 1.8 - 2.1.3.RELEASE - 5.1.5.RELEASE - 1.3.21 - 1.3.21 - 1.1.1 1.18.0 2.2.0 0.1.55 diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptingHost.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptingHost.kt index 05a147171..d35f2b49b 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptingHost.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptingHost.kt @@ -31,14 +31,13 @@ val blueprintScriptCompiler = JvmScriptCompiler(defaultJvmScriptingHostConfigura open class BlueprintScriptingHost(evaluator: ScriptEvaluator) : BasicScriptingHost(blueprintScriptCompiler, evaluator) { - override fun eval(script: SourceCode, scriptCompilationConfiguration: ScriptCompilationConfiguration, - configuration: ScriptEvaluationConfiguration?): ResultWithDiagnostics = + override fun eval(script: SourceCode, compilationConfiguration: ScriptCompilationConfiguration, + evaluationConfiguration: ScriptEvaluationConfiguration?): ResultWithDiagnostics = runInCoroutineContext { - - blueprintScriptCompiler(script, scriptCompilationConfiguration) - .onSuccess { - evaluator(it, configuration) + blueprintScriptCompiler(script, compilationConfiguration) + .onSuccess { compiledScript -> + evaluator(compiledScript, evaluationConfiguration ?: ScriptEvaluationConfiguration.Default) }.onFailure { failedResult -> val messages = failedResult.reports.joinToString("\n") throw BluePrintProcessorException(messages) @@ -51,7 +50,7 @@ open class BluePrintScriptEvaluator(private val scriptClassName: String) : Scrip private val log = LoggerFactory.getLogger(BluePrintScriptEvaluator::class.java)!! override suspend operator fun invoke(compiledScript: CompiledScript<*>, - scriptEvaluationConfiguration: ScriptEvaluationConfiguration? + scriptEvaluationConfiguration: ScriptEvaluationConfiguration ): ResultWithDiagnostics = try { log.debug("Getting script class name($scriptClassName) from the compiled sources ") @@ -59,20 +58,19 @@ open class BluePrintScriptEvaluator(private val scriptClassName: String) : Scrip val bluePrintCompiledScript = compiledScript as BluePrintCompiledScript bluePrintCompiledScript.scriptClassFQName = scriptClassName - val classResult = compiledScript.getClass(scriptEvaluationConfiguration) - when (classResult) { + when (val classResult = compiledScript.getClass(scriptEvaluationConfiguration)) { is ResultWithDiagnostics.Failure -> classResult is ResultWithDiagnostics.Success -> { val scriptClass = classResult.value val args = ArrayList() - scriptEvaluationConfiguration?.get(ScriptEvaluationConfiguration.providedProperties)?.forEach { + scriptEvaluationConfiguration.get(ScriptEvaluationConfiguration.providedProperties)?.forEach { args.add(it.value) } - scriptEvaluationConfiguration?.get(ScriptEvaluationConfiguration.implicitReceivers)?.let { + scriptEvaluationConfiguration.get(ScriptEvaluationConfiguration.implicitReceivers)?.let { args.addAll(it) } - scriptEvaluationConfiguration?.get(ScriptEvaluationConfiguration.constructorArgs)?.let { + scriptEvaluationConfiguration.get(ScriptEvaluationConfiguration.constructorArgs)?.let { args.addAll(it) } diff --git a/ms/controllerblueprints/parent/pom.xml b/ms/controllerblueprints/parent/pom.xml index 6ff76e944..4b571191d 100644 --- a/ms/controllerblueprints/parent/pom.xml +++ b/ms/controllerblueprints/parent/pom.xml @@ -29,11 +29,6 @@ pom 1.8 - 2.1.3.RELEASE - 5.1.5.RELEASE - 1.3.21 - 1.3.21 - 1.1.1 1.18.0 3.6.1 1.0.0 -- 2.16.6