From 3d281342eb2352c872f46b180afbdd95338dc6ac Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh" Date: Fri, 11 Jan 2019 11:30:40 -0500 Subject: Add blueprint Kotlin script support. Change-Id: I92b8e9850ea07c7f671e7aada9770713854534c3 Issue-ID: CCSDK-941 Signed-off-by: Muthuramalingam, Brinda Santh --- ...sourceAssignmentProcessorScriptConfiguration.kt | 42 ++++++ .../CapabilityResourceAssignmentProcessor.kt | 4 + ms/blueprintsprocessor/parent/pom.xml | 148 ++++++++++++++------- 3 files changed, 145 insertions(+), 49 deletions(-) create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentProcessorScriptConfiguration.kt diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentProcessorScriptConfiguration.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentProcessorScriptConfiguration.kt new file mode 100644 index 000000000..ffe09e4df --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/ResourceAssignmentProcessorScriptConfiguration.kt @@ -0,0 +1,42 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution + +import org.jetbrains.kotlin.script.util.DependsOn +import org.jetbrains.kotlin.script.util.Repository +import kotlin.script.experimental.annotations.KotlinScript +import kotlin.script.experimental.api.ScriptCompilationConfiguration +import kotlin.script.experimental.api.defaultImports +import kotlin.script.experimental.jvm.dependenciesFromCurrentContext +import kotlin.script.experimental.jvm.jvm + +@KotlinScript(fileExtension = "resourceassignmentprocessor.kts", + compilationConfiguration = ResourceAssignmentProcessorScriptConfiguration::class) +abstract class ResourceAssignmentProcessorScript { + +} + +object ResourceAssignmentProcessorScriptConfiguration : ScriptCompilationConfiguration( + { + defaultImports(DependsOn::class, Repository::class) + jvm { + dependenciesFromCurrentContext( + wholeClasspath = true + ) + } + } +) \ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt index f1de8f7d3..4aec2e505 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessor.kt @@ -28,6 +28,7 @@ import org.springframework.stereotype.Service open class CapabilityResourceAssignmentProcessor : ResourceAssignmentProcessor() { companion object { + const val CAPABILITY_TYPE_KOTLIN_COMPONENT = "KOTLIN-COMPONENT" const val CAPABILITY_TYPE_JAVA_COMPONENT = "JAVA-COMPONENT" const val CAPABILITY_TYPE_JYTHON_COMPONENT = "JYTHON-COMPONENT" } @@ -58,6 +59,9 @@ open class CapabilityResourceAssignmentProcessor : ResourceAssignmentProcessor() var componentResourceAssignmentProcessor: ResourceAssignmentProcessor? = null when (instanceType) { + CAPABILITY_TYPE_KOTLIN_COMPONENT ->{ + TODO("NO implementation") + } CAPABILITY_TYPE_JAVA_COMPONENT -> { // Initialize Capability Resource Assignment Processor componentResourceAssignmentProcessor = applicationContext.getBean(instanceName, ResourceAssignmentProcessor::class.java) diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index b44236b88..401fef0ac 100644 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -31,14 +31,14 @@ 2.1.1.RELEASE 5.1.3.RELEASE - 1.3.10 - 1.3.10 - 1.0.1 - 1.16.1 + 1.3.11 + 1.3.11 + 1.1.0 + 1.17.1 3.6.1 1.0.0 0.4.1-SNAPSHOT - 26.0-jre + 27.0.1-jre 2.7.1 2.9.2 1.4.197 @@ -68,12 +68,82 @@ ${onap.logger.slf4j} + + + io.springfox + springfox-swagger2 + ${springfox.swagger2.version} + + + io.springfox + springfox-swagger-ui + ${springfox.swagger2.version} + + + + + org.apache.commons + commons-lang3 + 3.2.1 + + + commons-collections + commons-collections + 3.2.2 + + + commons-io + commons-io + 2.6 + + + org.apache.commons + commons-compress + 1.15 + + + org.apache.velocity + velocity + 1.7 + + + com.google.guava + guava + ${guava.version} + + + org.python + jython-standalone + ${jython.version} + + org.jetbrains.kotlin kotlin-stdlib ${kotlin.version} + + org.jetbrains.kotlin + kotlin-scripting-jvm-host + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-compiler-embeddable + ${kotlin.version} + runtime + + + org.jetbrains.kotlin + kotlin-script-util + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-script-runtime + ${kotlin.version} + org.jetbrains.kotlinx kotlinx-coroutines-core @@ -234,50 +304,6 @@ ${project.version} - - - io.springfox - springfox-swagger2 - ${springfox.swagger2.version} - - - io.springfox - springfox-swagger-ui - ${springfox.swagger2.version} - - - - - org.apache.commons - commons-lang3 - 3.2.1 - - - commons-collections - commons-collections - 3.2.2 - - - commons-io - commons-io - 2.6 - - - org.apache.velocity - velocity - 1.7 - - - com.google.guava - guava - ${guava.version} - - - org.python - jython-standalone - ${jython.version} - - com.h2database @@ -328,10 +354,18 @@ commons-io commons-io + + org.apache.commons + commons-compress + com.jayway.jsonpath json-path + + com.google.guava + guava + io.springfox springfox-swagger2 @@ -344,14 +378,30 @@ org.jetbrains.kotlin kotlin-stdlib + + org.jetbrains.kotlin + kotlin-script-util + org.jetbrains.kotlin kotlin-stdlib-jdk8 + + org.jetbrains.kotlinx + kotlinx-coroutines-core + + + org.jetbrains.kotlinx + kotlinx-coroutines-reactor + com.fasterxml.jackson.module jackson-module-kotlin + + org.jetbrains.kotlin + kotlin-scripting-jvm-host + io.grpc -- cgit 1.2.3-korg