aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-07-15 18:46:08 +0000
committerGerrit Code Review <gerrit@onap.org>2019-07-15 18:46:08 +0000
commit4d4e27fe9d08ff92e356b465cbdef227b10fe38a (patch)
tree3d3d02275ea7deea14cf1d9c6eefad9d11a60e97 /ms/controllerblueprints
parent7d58591a2dd41b9e2655f5d06a1eb344146d8e76 (diff)
parentf439f401aa06ea497a84c73f3c158dfc6c62bc61 (diff)
Merge "Refractor blueprint-script to avoid cyclic dependency. There is a possibility of cyclic dependencies between blueprint-script module and code module. To avoid cyclic dependency blueprint-script implementation should be moved to Core module. This implementation has zero impact on code functionality and code testing."
Diffstat (limited to 'ms/controllerblueprints')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/pom.xml27
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt2
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompiledScript.kt (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintCompiledScript.kt)2
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompilerProxy.kt (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintCompilerProxy.kt)2
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptingHost.kt (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptingHost.kt)2
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptsConfiguration.kt (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsConfiguration.kt)2
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptsServiceImpl.kt (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsServiceImpl.kt)4
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt9
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/resources/META-INF/kotlin/script/templates/org.onap.ccsdk.apps.controllerblueprints.scripts.BluePrintKotlinScript (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/main/resources/META-INF/kotlin/script/templates/org.onap.ccsdk.apps.controllerblueprints.scripts.BluePrintKotlinScript)0
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BlueprintScriptingHostTest.kt (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BlueprintScriptingHostTest.kt)2
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts1/simple.cba.kts (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/test/resources/scripts1/simple.cba.kts)0
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts2/simple.cba.kts (renamed from ms/controllerblueprints/modules/blueprint-scripts/src/test/resources/scripts2/simple.cba.kts)0
-rw-r--r--ms/controllerblueprints/modules/blueprint-scripts/pom.xml60
-rw-r--r--ms/controllerblueprints/modules/pom.xml1
-rw-r--r--ms/controllerblueprints/modules/service/pom.xml4
-rw-r--r--ms/controllerblueprints/parent/pom.xml5
16 files changed, 36 insertions, 86 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/pom.xml b/ms/controllerblueprints/modules/blueprint-core/pom.xml
index 9e22af637..d0710b238 100644
--- a/ms/controllerblueprints/modules/blueprint-core/pom.xml
+++ b/ms/controllerblueprints/modules/blueprint-core/pom.xml
@@ -15,7 +15,8 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
@@ -26,6 +27,30 @@
<name>Controller Blueprints Core</name>
<dependencies>
+ <!-- Compiler Service -->
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-compiler-embeddable</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-scripting-jvm-host</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-compiler</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-script-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-script-runtime</artifactId>
+ </dependency>
+
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt
index b822f00b8..18091e630 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt
@@ -84,7 +84,7 @@ fun normalizedFile(path: String, vararg more: String?): File {
}
fun normalizedPath(path: String, vararg more: String?): Path {
- return Paths.get(path, *more).normalize().toAbsolutePath()
+ return Paths.get(path, *more).toAbsolutePath().normalize()
}
fun normalizedPathName(path: String, vararg more: String?): String {
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintCompiledScript.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompiledScript.kt
index e926b9828..03258c252 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintCompiledScript.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompiledScript.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.cds.controllerblueprints.scripts
+package org.onap.ccsdk.cds.controllerblueprints.core.scripts
import java.io.File
import java.io.Serializable
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintCompilerProxy.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompilerProxy.kt
index 6e88ba31a..df3302518 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintCompilerProxy.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompilerProxy.kt
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.cds.controllerblueprints.scripts
+package org.onap.ccsdk.cds.controllerblueprints.core.scripts
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoots
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptingHost.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptingHost.kt
index fa1488463..4fcc33d46 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptingHost.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptingHost.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.cds.controllerblueprints.scripts
+package org.onap.ccsdk.cds.controllerblueprints.core.scripts
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.slf4j.LoggerFactory
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsConfiguration.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptsConfiguration.kt
index 96d459066..3ac790171 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsConfiguration.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptsConfiguration.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.cds.controllerblueprints.scripts
+package org.onap.ccsdk.cds.controllerblueprints.core.scripts
import java.io.File
import kotlin.script.experimental.annotations.KotlinScript
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsServiceImpl.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptsServiceImpl.kt
index 9438c1f4b..e2c02603a 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BluePrintScriptsServiceImpl.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintScriptsServiceImpl.kt
@@ -15,19 +15,17 @@
* limitations under the License.
*/
-package org.onap.ccsdk.cds.controllerblueprints.scripts
+package org.onap.ccsdk.cds.controllerblueprints.core.scripts
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintScriptsService
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
-import org.springframework.stereotype.Service
import java.io.File
import java.util.*
import kotlin.script.experimental.api.ResultValue
import kotlin.script.experimental.api.resultOrNull
import kotlin.script.experimental.jvmhost.createJvmCompilationConfigurationFromTemplate
-@Service
open class BluePrintScriptsServiceImpl : BluePrintScriptsService {
override suspend fun <T> scriptInstance(blueprintContext: BluePrintContext, scriptClassName: String,
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt
index 60ed6343a..ef5cb81d9 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/BluePrintMetadataUtils.kt
@@ -18,24 +18,21 @@
package org.onap.ccsdk.cds.controllerblueprints.core.utils
-import org.slf4j.LoggerFactory
import com.fasterxml.jackson.databind.JsonNode
import kotlinx.coroutines.runBlocking
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
+import org.onap.ccsdk.cds.controllerblueprints.core.*
import org.onap.ccsdk.cds.controllerblueprints.core.data.ToscaMetaData
-import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
-import org.onap.ccsdk.cds.controllerblueprints.core.readNBLines
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintImportService
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService
+import org.slf4j.LoggerFactory
import java.io.File
import java.util.*
class BluePrintMetadataUtils {
companion object {
- private val log= LoggerFactory.getLogger(this::class.toString())
+ private val log = LoggerFactory.getLogger(this::class.toString())
suspend fun toscaMetaData(basePath: String): ToscaMetaData {
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/main/resources/META-INF/kotlin/script/templates/org.onap.ccsdk.apps.controllerblueprints.scripts.BluePrintKotlinScript b/ms/controllerblueprints/modules/blueprint-core/src/main/resources/META-INF/kotlin/script/templates/org.onap.ccsdk.apps.controllerblueprints.scripts.BluePrintKotlinScript
index e69de29bb..e69de29bb 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/main/resources/META-INF/kotlin/script/templates/org.onap.ccsdk.apps.controllerblueprints.scripts.BluePrintKotlinScript
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/resources/META-INF/kotlin/script/templates/org.onap.ccsdk.apps.controllerblueprints.scripts.BluePrintKotlinScript
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BlueprintScriptingHostTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BlueprintScriptingHostTest.kt
index 2c597ea2b..2288d62c8 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/scripts/BlueprintScriptingHostTest.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BlueprintScriptingHostTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.cds.controllerblueprints.scripts
+package org.onap.ccsdk.cds.controllerblueprints.core.scripts
import org.apache.commons.io.FileUtils
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/test/resources/scripts1/simple.cba.kts b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts1/simple.cba.kts
index 4fffda051..4fffda051 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/test/resources/scripts1/simple.cba.kts
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts1/simple.cba.kts
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/src/test/resources/scripts2/simple.cba.kts b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts2/simple.cba.kts
index 4ba56c491..4ba56c491 100644
--- a/ms/controllerblueprints/modules/blueprint-scripts/src/test/resources/scripts2/simple.cba.kts
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts2/simple.cba.kts
diff --git a/ms/controllerblueprints/modules/blueprint-scripts/pom.xml b/ms/controllerblueprints/modules/blueprint-scripts/pom.xml
deleted file mode 100644
index 2f4b0472d..000000000
--- a/ms/controllerblueprints/modules/blueprint-scripts/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>modules</artifactId>
- <groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
- <version>0.5.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>blueprint-scripts</artifactId>
- <name>Controller Blueprints Scripts</name>
-
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
- <artifactId>resource-dict</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-compiler-embeddable</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-scripting-jvm-host</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-compiler</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-script-util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-script-runtime</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-test-junit</artifactId>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/ms/controllerblueprints/modules/pom.xml b/ms/controllerblueprints/modules/pom.xml
index 3310c3824..0a7e82c2b 100644
--- a/ms/controllerblueprints/modules/pom.xml
+++ b/ms/controllerblueprints/modules/pom.xml
@@ -31,7 +31,6 @@
<module>blueprint-core</module>
<module>resource-dict</module>
<module>db-resources</module>
- <module>blueprint-scripts</module>
<module>blueprint-validation</module>
<module>service</module>
</modules>
diff --git a/ms/controllerblueprints/modules/service/pom.xml b/ms/controllerblueprints/modules/service/pom.xml
index 983e2772e..27babe118 100644
--- a/ms/controllerblueprints/modules/service/pom.xml
+++ b/ms/controllerblueprints/modules/service/pom.xml
@@ -45,10 +45,6 @@
<artifactId>blueprint-validation</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
- <artifactId>blueprint-scripts</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
</dependency>
diff --git a/ms/controllerblueprints/parent/pom.xml b/ms/controllerblueprints/parent/pom.xml
index 3defd74db..6ff76e944 100644
--- a/ms/controllerblueprints/parent/pom.xml
+++ b/ms/controllerblueprints/parent/pom.xml
@@ -246,11 +246,6 @@
</dependency>
<dependency>
<groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
- <artifactId>blueprint-scripts</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
<artifactId>service</artifactId>
<version>${project.version}</version>
</dependency>