Skip to content

Commit

Permalink
renamed module.title to info.title.lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseenaSainul committed Jul 11, 2023
1 parent b3a8498 commit 1320626
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion languages/c/templates/imports/default.cpp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#include "jsondata_${module.title}.h"
#include "jsondata_${info.title.lowercase}.h"
2 changes: 1 addition & 1 deletion languages/c/templates/imports/default.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#include "common/${module.title}.h"
#include "common/${info.title.lowercase}.h"
2 changes: 1 addition & 1 deletion languages/c/templates/imports/default.jsondata
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#include "jsondata_${module.title}.h"
#include "jsondata_${info.title.lowercase}.h"
2 changes: 1 addition & 1 deletion languages/c/templates/modules/src/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "FireboltSDK.h"
/* ${IMPORTS} */
#include "${module.title}.h"
#include "${info.title.lowercase}.h"

namespace FireboltSDK {
namespace ${info.Title} {
Expand Down
2 changes: 1 addition & 1 deletion languages/c/templates/schemas/src/jsondata_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#pragma once

/* ${IMPORTS} */
#include "common/${module.title}.h"
#include "common/${info.title.lowercase}.h"

namespace FireboltSDK {
namespace ${info.Title} {
Expand Down
2 changes: 1 addition & 1 deletion languages/c/templates/schemas/src/module_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "FireboltSDK.h"
/* ${IMPORTS} */
#include "jsondata_${module.title}.h"
#include "jsondata_${info.title.lowercase}.h"

/* ${ENUMS} */

Expand Down
8 changes: 4 additions & 4 deletions src/macrofier/engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ const insertMacros = (fContents = '', macros = {}) => {
fContents = fContents.replace(/\$\{minor\}/g, macros.version.minor)
fContents = fContents.replace(/\$\{patch\}/g, macros.version.patch)
fContents = fContents.replace(/\$\{info\.title\}/g, macros.title)
fContents = fContents.replace(/\$\{module\.title\}/g, macros.title.toLowerCase())
fContents = fContents.replace(/\$\{info\.title\.lowercase\}/g, macros.title.toLowerCase())
fContents = fContents.replace(/\$\{info\.Title\}/g, capitalize(macros.title))
fContents = fContents.replace(/\$\{info\.TITLE\}/g, macros.title.toUpperCase())
fContents = fContents.replace(/\$\{info\.description\}/g, macros.description)
Expand Down Expand Up @@ -830,12 +830,12 @@ const generateImports = (json, templates, options = { destination: '' }) => {
}

if (json['x-schemas'] && Object.keys(json['x-schemas']).length > 0 && !json.info['x-uri-titles']) {
imports += Object.keys(json['x-schemas']).map(shared => template.replace(/\$\{module.title\}/g, shared.toLowerCase())).join('')
imports += Object.keys(json['x-schemas']).map(shared => template.replace(/\$\{info.title.lowercase\}/g, shared.toLowerCase())).join('')
}

let componentExternalSchema = getComponentExternalSchema(json)
if (componentExternalSchema.length && json.info['x-uri-titles']) {
imports += componentExternalSchema.map(shared => template.replace(/\$\{module.title\}/g, shared.toLowerCase())).join('')
imports += componentExternalSchema.map(shared => template.replace(/\$\{info.title.lowercase\}/g, shared.toLowerCase())).join('')
}
return imports
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ function insertMethodMacros(template, methodObj, json, templates, examples = {})
.replace(/\$\{event\.callback\.params\.serialization\}/g, callbackSerializedParams)
.replace(/\$\{event\.callback\.result\.instantiation\}/g, callbackResultInst)
.replace(/\$\{event\.callback\.response\.instantiation\}/g, callbackResponseInst)
.replace(/\$\{module\.title\}/g, info.title.toLowerCase())
.replace(/\$\{info\.title\.lowercase\}/g, info.title.toLowerCase())
.replace(/\$\{info\.title\}/g, info.title)
.replace(/\$\{info\.Title\}/g, capitalize(info.title))
.replace(/\$\{info\.TITLE\}/g, info.title.toUpperCase())
Expand Down

0 comments on commit 1320626

Please sign in to comment.