Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mulint.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ const validateLog4j = require("./validateLog4j");
const assert = require("./assert");

program
.version("2.0.1")
.version("3.0.0")
.description("Mule project linter")
.arguments("<apiBasePath>")
.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("");
Expand All @@ -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);
Expand Down
14 changes: 10 additions & 4 deletions pomParser.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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,
Expand Down