From 3ba4f286d13c1d3fa7ae7894533b073fb1087858 Mon Sep 17 00:00:00 2001 From: "aravind.est" Date: Fri, 28 Jul 2023 14:48:29 +0100 Subject: [PATCH] Add maven script windows support Add bat script to support sme openapi generation. Add instruction in README to fix the git submodule update issue in windows. Issue-ID: NONRTRIC-899 Signed-off-by: aravind.est Change-Id: Id53fe50807bd5103f6a62495eb4b3527c7c9cdd5 --- README.md | 22 +++++++++++++++++++++ rapp-manager-acm/pom.xml | 4 ++-- rapp-manager-sme/pom.xml | 42 +++++++++++++++++++++++++++++++-------- scripts/init/init-sme-spec.bat | 45 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 10 deletions(-) create mode 100755 scripts/init/init-sme-spec.bat diff --git a/README.md b/README.md index ce1339b..fae2730 100755 --- a/README.md +++ b/README.md @@ -8,3 +8,25 @@ Rapp manager is an application which lifecycle manages the Rapp. ONAP ACM is used here as a backend of Rapp manager to lifecycle manage the deployment items as part of Rapp. ONAP ACM related details can be found [here](https://docs.onap.org/projects/onap-policy-parent/en/london/clamp/clamp.html). + + +## Maven Build + +This build supports Linux and Windows environments. + +In case of below error during the build in Windows environment, + +``` +[INFO] --- exec-maven-plugin:3.1.0:exec (git submodule update) @ rapp-manager-sme --- +C:/Program Files/Git/mingw64/libexec/git-core\git-submodule: line 7: basename: command not found +C:/Program Files/Git/mingw64/libexec/git-core\git-submodule: line 7: sed: command not found +C:/Program Files/Git/mingw64/libexec/git-core\git-submodule: line 22: .: git-sh-setup: file not found +``` + +It is necessary to append additional paths listed below to the System environment variable +named "PATH". These paths can vary based on the git installation location. + +``` +C:\Program Files\Git\usr\bin +C:\Program Files\Git\mingw64\libexec\git-core +``` \ No newline at end of file diff --git a/rapp-manager-acm/pom.xml b/rapp-manager-acm/pom.xml index 9740db8..29e05af 100755 --- a/rapp-manager-acm/pom.xml +++ b/rapp-manager-acm/pom.xml @@ -77,7 +77,7 @@ generate - rapp-manager-acm/src/main/resources/openapi/acm-spec.yaml + ${project.basedir}/src/main/resources/openapi/acm-spec.yaml java resttemplate false @@ -120,4 +120,4 @@ - \ No newline at end of file + diff --git a/rapp-manager-sme/pom.xml b/rapp-manager-sme/pom.xml index ac7c97e..6f80741 100755 --- a/rapp-manager-sme/pom.xml +++ b/rapp-manager-sme/pom.xml @@ -19,6 +19,33 @@ 3.1.0 + + + Windows + + + Windows + + + + .bat + \ + + + + unix + + + unix + + + + .sh + / + + + + com.oransc.rappmanager @@ -82,10 +109,9 @@ exec - bash - - ../scripts/init/init-sme-spec.sh - + + ..${file.separator}scripts${file.separator}init${file.separator}init-sme-spec${script.extension} + @@ -102,7 +128,7 @@ - rapp-manager-sme/src/main/resources/openapi/TS29222_CAPIF_API_Provider_Management_API.yaml + ${project.basedir}/src/main/resources/openapi/TS29222_CAPIF_API_Provider_Management_API.yaml java resttemplate @@ -131,7 +157,7 @@ - rapp-manager-sme/src/main/resources/openapi/TS29222_CAPIF_Publish_Service_API.yaml + ${project.basedir}/src/main/resources/openapi/TS29222_CAPIF_Publish_Service_API.yaml java resttemplate @@ -160,7 +186,7 @@ - rapp-manager-sme/src/main/resources/openapi/TS29222_CAPIF_API_Invoker_Management_API.yaml + ${project.basedir}/src/main/resources/openapi/TS29222_CAPIF_API_Invoker_Management_API.yaml java resttemplate @@ -186,4 +212,4 @@ - \ No newline at end of file + diff --git a/scripts/init/init-sme-spec.bat b/scripts/init/init-sme-spec.bat new file mode 100755 index 0000000..afc946a --- /dev/null +++ b/scripts/init/init-sme-spec.bat @@ -0,0 +1,45 @@ +:: ============LICENSE_START=============================================== +:: Copyright (C) 2023 Nordix Foundation. All rights reserved. +:: ======================================================================== +:: 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. +:: ============LICENSE_END================================================= +:: + +@echo off +set SME_LOCATION="..\sme\capifcore" +cp ..\scripts\init\getsmeswagger.go %SME_LOCATION% +cd %SME_LOCATION% + +echo Generating SME openapi spec... + +IF EXIST getsmeswagger.go ( + echo Generating... + go run getsmeswagger.go + + echo Copying generated specs... + mkdir ..\..\rapp-manager-sme\src\main\resources\openapi + echo Copying CommonData.yaml + mv CommonData.yaml ..\..\rapp-manager-sme\src\main\resources\openapi + echo Copying TS29122_CommonData.yaml + mv TS29122_CommonData.yaml ..\..\rapp-manager-sme\src\main\resources\openapi + echo Copying TS29571_CommonData.yaml + mv TS29571_CommonData.yaml ..\..\rapp-manager-sme\src\main\resources\openapi + echo Copying TS29222_CAPIF_API_Invoker_Management_API.yaml + mv TS29222_CAPIF_API_Invoker_Management_API.yaml ..\..\rapp-manager-sme\src\main\resources\openapi + echo Copying TS29222_CAPIF_API_Provider_Management_API.yaml + mv TS29222_CAPIF_API_Provider_Management_API.yaml ..\..\rapp-manager-sme\src\main\resources\openapi + echo Copying TS29222_CAPIF_Publish_Service_API.yaml + mv TS29222_CAPIF_Publish_Service_API.yaml ..\..\rapp-manager-sme\src\main\resources\openapi +) ELSE ( + echo Unable to find the openapi spec generator. +) -- 2.16.6