SAP UI5 Tools 使用简介
我們可以使用如下命令行安裝 SAP UI5 Tools:
npm install --global @ui5/cli
進入一個空的文件夾,執行命令行 ui5 init 報錯:
Initialization not possible: Missing package.json file
然后用命令行 npm init 生成一個 package.json:
然后重新執行 ui5 init:
出現新的錯誤消息:
Could not detect project type: Could not find ‘webapp’ or ‘src’ / ‘test’ folders.
Applications should only have a ‘webapp’ folder.
那么我就手動創建一個 webapp 文件夾。
之后 init 執行成功,自動創建了一個 ui5.yaml 文件:
內容如下:
按照我這篇文章 使用 generator-easy-ui5 快速創建 SAP UI5 應用的工程結構 介紹的工具,創建一個 SAP UI5 應用所需的基本文件層級結構。
生成之后,查看其 package.json 里 script 區域定義的腳本:
"scripts": {"start": "fiori run --open 'index.html'","start-local": "fiori run --config ./ui5-local.yaml --open 'index.html'","start-noflp": "fiori run --open 'index.html'","build": "ui5 build -a --clean-dest --include-task=generateManifestBundle generateCachebusterInfo","deploy": "fiori verify","deploy-config": "fiori add deploy-config","unit-tests": "fiori run --open test/unit/unitTests.qunit.html","int-tests": "fiori run --open test/integration/opaTests.qunit.html"},腳本里的 fiori 命令,即是本文標題提到的 SAP UI5 Tools 的命令提示行工具 CLI。
執行 npm run start,實際執行的命令是 fiori run --open 'index.html':
最后運行時的效果:
我們直接運行 fiori deploy,會報錯:
‘fiori’ is not recognized as an internal or external command,
operable program or batch file.
需要在 npm 這個 wrapper 里運行:
npm run deploy:
錯誤消息:
No deployment configuration has been detected. Run npm run deploy-config to add configuration first.
意思是沒有檢測到 deployment configuration,需要先運行另一個命令:npm run deploy-config。
首先選擇 ABAP 環境:
這個命令行 npm run deploy-config 底層運行的還是 yo:
Target System URL,先隨便維護一個,后續可以修改:
輸入部署到 ABAP 系統后生成的 bsp 應用名稱和存儲的 ABAP package 名稱,即可成功生成 deployment configuration:
更多Jerry的原創文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的SAP UI5 Tools 使用简介的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 民营资本是什么意思 民营资本的含义
- 下一篇: 如何把本地开发的 SAP UI5 应用部