From a9a7a202a78752fad71647303c643b03823cf384 Mon Sep 17 00:00:00 2001 From: Bill Sorensen Date: Tue, 7 May 2019 14:11:03 -0500 Subject: [PATCH 1/3] Add command-line switch for detect deployment type --- mulint.js | 4 +++- pomParser.js | 14 ++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/mulint.js b/mulint.js index 47b9fcb..01a7b19 100755 --- a/mulint.js +++ b/mulint.js @@ -17,6 +17,7 @@ program .version("2.0.1") .description("Mule project linter") .arguments("") + .option("-d, --detect-deploy", "Detect deployment type (otherwise assumes on-prem)") .on("--help", () => { const path = "C:\\SourceCode\\mulesoft-apis\\System APIs\\wsflx-system-api"; console.log(""); @@ -30,7 +31,8 @@ program apiBasePath = apiBasePath.replace(/"$/, ""); let folderInfo = folderParser(apiBasePath); - let pomInfo = pomParser(folderInfo.pomFile); + let pomInfo = pomParser(folderInfo.pomFile, program.detectDeploy); + validateApiFiles(folderInfo, pomInfo); validatePom(folderInfo, pomInfo); validateGlobal(folderInfo); diff --git a/pomParser.js b/pomParser.js index bcb0d43..6887893 100644 --- a/pomParser.js +++ b/pomParser.js @@ -1,6 +1,6 @@ const xmlParser = require("./xmlParser"); -const pomParser = pomFile => { +const pomParser = (pomFile, detectDeploy) => { let { xml } = xmlParser(pomFile); let xmlProperties = xml.project.properties[0]; let properties = new Map(); @@ -23,9 +23,15 @@ const pomParser = pomFile => { let muleMavenPlugin = findPlugin("mule-maven-plugin"); - // Currently assuming if not using the Mule Maven Plugin then deploying on-prem. - let isOnPrem = - !muleMavenPlugin || properties.get("deployment.type") === "arm"; + let isOnPrem; + + if (detectDeploy) { + // Currently assuming if not using the Mule Maven Plugin then deploying on-prem. + isOnPrem = + !muleMavenPlugin || properties.get("deployment.type") === "arm"; + } else { + isOnPrem = true; + } return { findDependency, From cd691b4abbd16db964f9478b94ecd8e8eb992f43 Mon Sep 17 00:00:00 2001 From: Bill Sorensen Date: Tue, 7 May 2019 14:12:13 -0500 Subject: [PATCH 2/3] Version 2.1.0 --- mulint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mulint.js b/mulint.js index 01a7b19..c273ada 100755 --- a/mulint.js +++ b/mulint.js @@ -14,7 +14,7 @@ const validateLog4j = require("./validateLog4j"); const assert = require("./assert"); program - .version("2.0.1") + .version("2.1.0") .description("Mule project linter") .arguments("") .option("-d, --detect-deploy", "Detect deployment type (otherwise assumes on-prem)") From 0d7d426be9b61b19397749c8b6dec34f2b0387b8 Mon Sep 17 00:00:00 2001 From: Bill Sorensen Date: Tue, 7 May 2019 14:19:00 -0500 Subject: [PATCH 3/3] Version 3.0.0 (really a breaking change) --- mulint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mulint.js b/mulint.js index c273ada..ce46d42 100755 --- a/mulint.js +++ b/mulint.js @@ -14,7 +14,7 @@ const validateLog4j = require("./validateLog4j"); const assert = require("./assert"); program - .version("2.1.0") + .version("3.0.0") .description("Mule project linter") .arguments("") .option("-d, --detect-deploy", "Detect deployment type (otherwise assumes on-prem)")