Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPPSDK: remove reduntant code #178

Merged
merged 149 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
8c32467
chore: Copy JS templates to C and create language.config.json
jlacivita Apr 26, 2023
8692163
feat(languages): Add support for a distinct JSON-type for each schema
jlacivita Apr 26, 2023
dcc5d6b
chore: Dropped debug logs
jlacivita Apr 26, 2023
64688fa
fix: Stop passing non-schemas in to getSchemaType
jlacivita Apr 26, 2023
bc47db5
feat(accessors): New macro section for schema property accessors
jlacivita Apr 28, 2023
9d6047f
fix: Sort the macrofied schemas based on schema refs (#90)
sramani-metro May 23, 2023
717b777
Enum fixes (#93)
HaseenaSainul Jun 1, 2023
bd7db6c
Types and Accessor related fixes (#94)
HaseenaSainul Jun 5, 2023
81df47c
Static code implementation updates (#96)
HaseenaSainul Jun 8, 2023
47d81ab
Add support to generate file inclusion for common schema also (#97)
HaseenaSainul Jun 15, 2023
9d925c8
C-Language: Templates based property methods (#100)
sramani-metro Jun 20, 2023
79f731b
Add support to keep original file permissions of template/sdk files (…
HaseenaSainul Jun 22, 2023
450035a
Event template implementation added (#101)
HaseenaSainul Jun 22, 2023
229cae6
Template for Polymorphic pull method (#102)
sramani-metro Jun 22, 2023
1613f3e
fix: In progress commit
jlacivita Jul 5, 2023
f3970c3
fix: Promote and name sub-schemas in one place
jlacivita Jul 5, 2023
2a39d44
fix: Add extractSubSchemas flag to C language
jlacivita Jul 5, 2023
b3eb478
fix: Uncomment writeFilePermissions
jlacivita Jul 5, 2023
8db3860
Merge pull request #108 from rdkcentral/fix/anonymous-schemas
jlacivita Jul 5, 2023
ad6870d
Merge branch 'feature/c-language' into features/c-cleanup
jlacivita Jul 5, 2023
ad4fb21
polymorphic-pull: method and event implementation added (#107)
HaseenaSainul Jul 10, 2023
e44476c
SchemaSorting: logic updated to consider all schemas (#106)
HaseenaSainul Jul 10, 2023
0def424
fix: Fix the reentrancy of methods from callback (#105)
sramani-metro Jul 11, 2023
6509066
Default template implementation added (#103)
HaseenaSainul Jul 11, 2023
e6c6bed
feat(macrofier): Add dynamic schema template output
jlacivita Jul 11, 2023
4d22a4d
Naming + void* to struct* changes based on sky review, removed redund…
HaseenaSainul Jul 12, 2023
8d231a1
language-c: re-arrange files locations (#112)
HaseenaSainul Jul 17, 2023
335e64a
fixes to generate array inside subschemas (#111)
HaseenaSainul Jul 17, 2023
5c194a6
include test always (#113)
HaseenaSainul Jul 17, 2023
30246aa
use String type if there is any issue with anyOf merge (#114)
HaseenaSainul Jul 17, 2023
ffd97fd
calls-metrics: support added (#115)
HaseenaSainul Jul 17, 2023
549e4a0
Generate polymorphci methods for anyOf param/result case (#110)
HaseenaSainul Jul 17, 2023
d58a52c
fix: Split c-structs from c (w/ Accessors)
jlacivita Jul 19, 2023
6997281
Merge branch 'feature/c-language' into features/c-cleanup
jlacivita Jul 19, 2023
2c20679
fix: Latest work
jlacivita Jul 27, 2023
c44e9a6
chore: Copy JS templates to C and create language.config.json
jlacivita Apr 26, 2023
b61188f
feat(languages): Add support for a distinct JSON-type for each schema
jlacivita Apr 26, 2023
02e2e73
chore: Dropped debug logs
jlacivita Apr 26, 2023
5814d9d
fix: Stop passing non-schemas in to getSchemaType
jlacivita Apr 26, 2023
c1ba6ae
feat(accessors): New macro section for schema property accessors
jlacivita Apr 28, 2023
ef9c924
fix: Sort the macrofied schemas based on schema refs (#90)
sramani-metro May 23, 2023
7c8d025
Enum fixes (#93)
HaseenaSainul Jun 1, 2023
e3cf471
Types and Accessor related fixes (#94)
HaseenaSainul Jun 5, 2023
77abef6
Static code implementation updates (#96)
HaseenaSainul Jun 8, 2023
8818654
Add support to generate file inclusion for common schema also (#97)
HaseenaSainul Jun 15, 2023
a168c8d
C-Language: Templates based property methods (#100)
sramani-metro Jun 20, 2023
8e716e5
Add support to keep original file permissions of template/sdk files (…
HaseenaSainul Jun 22, 2023
8d9ac14
Event template implementation added (#101)
HaseenaSainul Jun 22, 2023
db4c7fe
Template for Polymorphic pull method (#102)
sramani-metro Jun 22, 2023
014e4fb
fix: Promote and name sub-schemas in one place
jlacivita Jul 5, 2023
044e528
fix: Add extractSubSchemas flag to C language
jlacivita Jul 5, 2023
45280e0
fix: Uncomment writeFilePermissions
jlacivita Jul 5, 2023
d3ef7f3
polymorphic-pull: method and event implementation added (#107)
HaseenaSainul Jul 10, 2023
9687033
SchemaSorting: logic updated to consider all schemas (#106)
HaseenaSainul Jul 10, 2023
5a15e16
fix: Fix the reentrancy of methods from callback (#105)
sramani-metro Jul 11, 2023
daf6ec6
Default template implementation added (#103)
HaseenaSainul Jul 11, 2023
161b347
Naming + void* to struct* changes based on sky review, removed redund…
HaseenaSainul Jul 12, 2023
5f12311
language-c: re-arrange files locations (#112)
HaseenaSainul Jul 17, 2023
923de60
fixes to generate array inside subschemas (#111)
HaseenaSainul Jul 17, 2023
14dfca7
include test always (#113)
HaseenaSainul Jul 17, 2023
e7e9eba
use String type if there is any issue with anyOf merge (#114)
HaseenaSainul Jul 17, 2023
51f3043
calls-metrics: support added (#115)
HaseenaSainul Jul 17, 2023
6a17ba2
Generate polymorphci methods for anyOf param/result case (#110)
HaseenaSainul Jul 17, 2023
934fcfd
Create namespaces only if there is value to put (#117)
HaseenaSainul Jul 24, 2023
6d43093
Changes to avoid duplication of sub-array schema with same reference …
HaseenaSainul Jul 24, 2023
3a94727
detach setter declaration from property template and add setter templ…
HaseenaSainul Jul 26, 2023
5fd33a4
SubArray generation issue fix (#121)
HaseenaSainul Aug 7, 2023
6c3b417
cmake changes to install proper files (#119)
HaseenaSainul Aug 7, 2023
0db1758
Merge branch 'next' into feature/c-language
jlacivita Aug 10, 2023
37dd5a6
chore: Copy JS templates to C and create language.config.json
jlacivita Apr 26, 2023
e4779e2
feat(languages): Add support for a distinct JSON-type for each schema
jlacivita Apr 26, 2023
f2cd197
chore: Dropped debug logs
jlacivita Apr 26, 2023
38dc633
fix: Stop passing non-schemas in to getSchemaType
jlacivita Apr 26, 2023
6cb39c3
feat(accessors): New macro section for schema property accessors
jlacivita Apr 28, 2023
3700c99
fix: Sort the macrofied schemas based on schema refs (#90)
sramani-metro May 23, 2023
56c6278
Enum fixes (#93)
HaseenaSainul Jun 1, 2023
57550c1
Types and Accessor related fixes (#94)
HaseenaSainul Jun 5, 2023
3ab8bad
Static code implementation updates (#96)
HaseenaSainul Jun 8, 2023
0e742f2
Add support to generate file inclusion for common schema also (#97)
HaseenaSainul Jun 15, 2023
99c0033
C-Language: Templates based property methods (#100)
sramani-metro Jun 20, 2023
133f8e3
Add support to keep original file permissions of template/sdk files (…
HaseenaSainul Jun 22, 2023
b5528f8
Event template implementation added (#101)
HaseenaSainul Jun 22, 2023
d08f0d2
Template for Polymorphic pull method (#102)
sramani-metro Jun 22, 2023
757fc46
fix: Promote and name sub-schemas in one place
jlacivita Jul 5, 2023
1186b96
fix: Add extractSubSchemas flag to C language
jlacivita Jul 5, 2023
b1dbf18
fix: Uncomment writeFilePermissions
jlacivita Jul 5, 2023
aa321aa
polymorphic-pull: method and event implementation added (#107)
HaseenaSainul Jul 10, 2023
e73a67a
SchemaSorting: logic updated to consider all schemas (#106)
HaseenaSainul Jul 10, 2023
6015caf
fix: Fix the reentrancy of methods from callback (#105)
sramani-metro Jul 11, 2023
2f3b237
Default template implementation added (#103)
HaseenaSainul Jul 11, 2023
8b1e5fc
Naming + void* to struct* changes based on sky review, removed redund…
HaseenaSainul Jul 12, 2023
76d9009
language-c: re-arrange files locations (#112)
HaseenaSainul Jul 17, 2023
2f866c2
fixes to generate array inside subschemas (#111)
HaseenaSainul Jul 17, 2023
f9c324e
include test always (#113)
HaseenaSainul Jul 17, 2023
31ddf5e
use String type if there is any issue with anyOf merge (#114)
HaseenaSainul Jul 17, 2023
eb0023b
calls-metrics: support added (#115)
HaseenaSainul Jul 17, 2023
06f0f39
Generate polymorphci methods for anyOf param/result case (#110)
HaseenaSainul Jul 17, 2023
260fa65
Create namespaces only if there is value to put (#117)
HaseenaSainul Jul 24, 2023
a6eb5df
Changes to avoid duplication of sub-array schema with same reference …
HaseenaSainul Jul 24, 2023
f8faf1f
detach setter declaration from property template and add setter templ…
HaseenaSainul Jul 26, 2023
1563c64
SubArray generation issue fix (#121)
HaseenaSainul Aug 7, 2023
3c9a909
cmake changes to install proper files (#119)
HaseenaSainul Aug 7, 2023
46a8a1c
Merge branch 'feature/c-language' of https://github.com/rdkcentral/fi…
jlacivita Aug 11, 2023
6a0f4e6
native code: changed return type from uint32_t to int32_t (#127)
HaseenaSainul Aug 15, 2023
626378f
Merge branch 'feature/c-language' into features/c-cleanup
jlacivita Aug 15, 2023
efcbece
fix: Provider Interfaces and Tuples in JS
jlacivita Aug 15, 2023
8b37a49
feat: Initial commit of cpp sdk
Sep 1, 2023
fd66f37
feat: Fix issues in generated headers
Sep 6, 2023
c952047
CPPSDK: static code + template changes (#137)
HaseenaSainul Oct 9, 2023
b7a27f0
CPPSDK: namespace settings changes (#135)
HaseenaSainul Oct 10, 2023
5695efe
CPP SDK : changes to handle additional Properties (#134)
HaseenaSainul Oct 18, 2023
1f2854b
CPPSDK: parameter and result handling changes (#136)
HaseenaSainul Oct 18, 2023
7031fc2
CPPSDK: aggregate files based on suffix type handling added, module a…
HaseenaSainul Oct 24, 2023
6d1339b
CPPSDK: changes to handle enum and x-schema enum without title (#138)
HaseenaSainul Oct 25, 2023
24eedc4
CPPSDK: parameter/result handling for method and events + inner objec…
HaseenaSainul Oct 25, 2023
ebe1439
CPPSDK: template added for capabilties-method (#142)
HaseenaSainul Oct 31, 2023
3e45884
CPPSDK: method name changed to camel case (#144)
HaseenaSainul Nov 3, 2023
2396364
CPPSDK: event name changed to camelcase (#145)
HaseenaSainul Nov 6, 2023
fddefee
CPPSDK: add overrideRule to handle template generation + remove enum …
HaseenaSainul Nov 6, 2023
b50d33d
CPPSDK: remove const from return type (#149)
HaseenaSainul Nov 7, 2023
fcae038
CPPSDK: typo fix (#150)
HaseenaSainul Nov 9, 2023
195bce4
CPPSDK: handle empty properties and propertyNames with templates (#152)
HaseenaSainul Nov 13, 2023
993c25d
CPPSDK: code generation template and engine changes (#151)
HaseenaSainul Nov 15, 2023
77f2cfc
CPPSDK: template updates based on more complex schema generation (#153)
HaseenaSainul Nov 16, 2023
e679004
CPPSDK: polymorphic-pull method/event generation support added (#154)
HaseenaSainul Nov 18, 2023
f31b5d7
CPPSDK: provider support added (#156)
HaseenaSainul Dec 5, 2023
f583521
Merge branch 'next' into features/cpp
HaseenaSainul Dec 5, 2023
4c9e870
CPPSDK: check jsonrpc response values are set or not before assigning…
HaseenaSainul Dec 12, 2023
c2cc7e5
fix: Copy allow-focus tag to use methods
jlacivita Dec 14, 2023
80d95ee
Merge branch 'fix/copy-allow-focus' into features/cpp
HaseenaSainul Dec 15, 2023
8901760
CPPSDK: calls metrics support added (#158)
HaseenaSainul Dec 15, 2023
4a63789
CPPSDK: handle patternProperties (#160)
HaseenaSainul Dec 19, 2023
c200483
CPPSDK: polymorphic method schema creation changes (#159)
HaseenaSainul Dec 21, 2023
f3593b1
CPPSDK: changes to handle context params (#161)
HaseenaSainul Jan 3, 2024
651c8d6
CPPSDK: warning fix during promoteAndNameSubSchemas (#163)
HaseenaSainul Jan 17, 2024
66c6feb
Check template for codeblocks exists or not before trying to generate…
HaseenaSainul Jan 31, 2024
30e8133
Optimization of generation time: generate macros only based on the sc…
HaseenaSainul Jan 31, 2024
6c20a90
Updates based on MAC testing (#167)
HaseenaSainul Feb 13, 2024
50031be
CPPSDK: proceed to install only the build is successfully done and so…
HaseenaSainul Feb 23, 2024
f64fb6d
Merge branch 'next' into features/cpp
HaseenaSainul Mar 1, 2024
80acfba
merge conflict fixes
HaseenaSainul Mar 1, 2024
5e8edf3
feature/cpp branch alignment based on next branch merging for both op…
HaseenaSainul Mar 5, 2024
67088b1
CPPSDK: update install script to handle version parsing for file base…
HaseenaSainul Mar 7, 2024
2f7017a
Update to align generated firebolt.d.ts sync with same is next branch…
HaseenaSainul Mar 12, 2024
d79396f
CPPSDK : Add Async communication support and CPP code generation for …
HaseenaSainul Mar 19, 2024
7ff9fe1
Merge branch 'next' into features/cpp
HaseenaSainul Mar 28, 2024
ebbe55a
CPPSDK: remove reduntant code
HaseenaSainul Mar 28, 2024
c7ff5a8
Merge branch 'next' into features/cpp
HaseenaSainul Apr 8, 2024
55801a6
Merge branch 'next' into features/cpp
kschrief Apr 8, 2024
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
41 changes: 0 additions & 41 deletions src/macrofier/engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -484,42 +484,6 @@ const promoteAndNameSubSchemas = (obj) => {
return obj
}

const skip = ['NavigationIntent']
const findAll = (tag, obj, transform) => {
if (Array.isArray(obj)) {
obj.forEach(item => findAll(tag, item, transform))
}
else if (obj && (typeof obj === "object")) {
Object.keys(obj).forEach(key => {
if (!skip.includes(key)) {
if (key === tag) {
if (obj[key].find(schema => schema.$ref.endsWith('/ListenResponse'))) {

}
else {
Object.assign(obj, transform(obj))
delete obj[key]
console.dir(obj)
findAll(tag, obj, transform)
}
}
else {
findAll(tag, obj[key], transform)
}
}
})
}
}

const mergeAnyOfs = (obj) => {
// make a copy so we don't polute our inputs
obj = JSON.parse(JSON.stringify(obj))

findAll('anyOf', obj, anyOf => mergeAnyOf(anyOf))

return obj
}

const generateMacros = (obj, templates, languages, options = {}) => {
if (options.createPolymorphicMethods) {
let methods = []
Expand All @@ -541,11 +505,6 @@ const generateMacros = (obj, templates, languages, options = {}) => {
obj = promoteAndNameSubSchemas(obj)
}

// config.mergeAnyOfs = true
// if (config.mergeAnyOfs) {
// obj = mergeAnyOfs(obj)
// }

// grab the options so we don't have to pass them from method to method
Object.assign(state, options)

Expand Down
3 changes: 0 additions & 3 deletions src/shared/modules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,9 +1112,6 @@ const addComponentSubSchemasName = (obj, schemas) => {
key = key.charAt(0).toUpperCase() + key.substring(1)
componentSchema = addComponentSubSchemasNameForProperties(key, componentSchema)
})
if (!schema.title && !key) {
schema.title = capitalize(key)
}
})

return schemas
Expand Down
Loading