Commit aaab88ae authored by Gilles Mouchard's avatar Gilles Mouchard
Browse files

Made lazier about artefact type more generally because PKM has rules to fix it.

parent 9bb0e65e
Pipeline #18102 passed with stages
in 8 minutes and 58 seconds
......@@ -109,10 +109,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
files.push(new File(
c_annotations_document.sourceFile + '.c_annotations' + (id ? ('_' + id) : '') + '.json',
JSON.stringify(c_annotations_document, null, 2),
'utf8',
'Annotation',
'application/json'
JSON.stringify(c_annotations_document, null, 2)
));
});
});
......
......@@ -109,10 +109,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
files.push(new File(
c_comments_document.sourceFile + '.c_comments' + (id ? ('_' + id) : '') + '.json',
JSON.stringify(c_comments_document, null, 2),
'utf8',
'Comment',
'application/json'
JSON.stringify(c_comments_document, null, 2)
));
});
});
......
......@@ -109,10 +109,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
files.push(new File(
c_source_code_document.sourceFile + '.c_source_code' + (id ? ('_' + id) : '') + '.json',
JSON.stringify(c_source_code_document, null, 2),
'utf8',
'Code',
'application/json'
JSON.stringify(c_source_code_document, null, 2)
));
});
});
......
......@@ -109,10 +109,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
files.push(new File(
cpp_annotations_document.sourceFile + '.cpp_annotations' + (id ? ('_' + id) : '') + '.json',
JSON.stringify(cpp_annotations_document, null, 2),
'utf8',
'Annotation',
'application/json'
JSON.stringify(cpp_annotations_document, null, 2)
));
});
});
......
......@@ -109,10 +109,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
files.push(new File(
cpp_comments_document.sourceFile + '.cpp_comments' + (id ? ('_' + id) : '') + '.json',
JSON.stringify(cpp_comments_document, null, 2),
'utf8',
'Comment',
'application/json'
JSON.stringify(cpp_comments_document, null, 2)
));
});
});
......
......@@ -109,10 +109,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
files.push(new File(
cpp_source_code_document.sourceFile + '.cpp_source_code' + (id ? ('_' + id) : '') + '.json',
JSON.stringify(cpp_source_code_document, null, 2),
'utf8',
'Code',
'application/json'
JSON.stringify(cpp_source_code_document, null, 2)
));
});
});
......
......@@ -99,10 +99,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
const uml_class_diagram_file = new File(
uml_class_diagram.name, // rel_path
uml_class_diagram_content, // content
'utf8', // encoding
'Diagram', // type
'application/json' // MIME type
uml_class_diagram_content // content
);
write_file_promises.push(file_system.writeFile(uml_class_diagram_file));
......
......@@ -88,7 +88,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
host_source_file_paths.forEach((host_source_file_path) =>
{
const path = require('path');
read_file_promises.push(file_system.readFile(path.resolve(host_source_file_path), { type : 'Code' }).then((source_file) =>
read_file_promises.push(file_system.readFile(path.resolve(host_source_file_path)).then((source_file) =>
{
return new Promise((resolve, reject) =>
{
......
......@@ -89,7 +89,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
host_uml_class_diagram_file_paths.forEach((host_uml_class_diagram_file_path) =>
{
const path = require('path');
read_file_promises.push(file_system.readFile(path.resolve(host_uml_class_diagram_file_path), { type : 'Diagram', mime_type : 'application/json' }).then((uml_class_diagram_file) =>
read_file_promises.push(file_system.readFile(path.resolve(host_uml_class_diagram_file_path)).then((uml_class_diagram_file) =>
{
return new Promise((resolve, reject) =>
{
......
......@@ -88,7 +88,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
host_uml_file_paths.forEach((host_uml_file_path) =>
{
const path = require('path');
read_file_promises.push(file_system.readFile(path.resolve(host_uml_file_path), { type : 'Diagram' }).then((uml_file) =>
read_file_promises.push(file_system.readFile(path.resolve(host_uml_file_path)).then((uml_file) =>
{
return new Promise((resolve, reject) =>
{
......
......@@ -89,7 +89,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
host_uml_state_machine_file_paths.forEach((host_uml_state_machine_file_path) =>
{
const path = require('path');
read_file_promises.push(file_system.readFile(path.resolve(host_uml_state_machine_file_path), { type : 'Diagram', mime_type : 'application/json' }).then((uml_state_machine_file) =>
read_file_promises.push(file_system.readFile(path.resolve(host_uml_state_machine_file_path)).then((uml_state_machine_file) =>
{
return new Promise((resolve, reject) =>
{
......
......@@ -88,7 +88,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
host_source_file_paths.forEach((host_source_file_path) =>
{
const path = require('path');
read_file_promises.push(file_system.readFile(path.resolve(host_source_file_path), { type : 'Code' }).then((source_file) =>
read_file_promises.push(file_system.readFile(path.resolve(host_source_file_path)).then((source_file) =>
{
return new Promise((resolve, reject) =>
{
......
......@@ -89,7 +89,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
host_uml_class_diagram_file_paths.forEach((host_uml_class_diagram_file_path) =>
{
const path = require('path');
read_file_promises.push(file_system.readFile(path.resolve(host_uml_class_diagram_file_path), { type : 'Diagram', mime_type : 'application/json' }).then((uml_class_diagram_file) =>
read_file_promises.push(file_system.readFile(path.resolve(host_uml_class_diagram_file_path)).then((uml_class_diagram_file) =>
{
return new Promise((resolve, reject) =>
{
......
......@@ -88,7 +88,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
host_uml_file_paths.forEach((host_uml_file_path) =>
{
const path = require('path');
read_file_promises.push(file_system.readFile(path.resolve(host_uml_file_path), { type : 'Diagram' }).then((uml_file) =>
read_file_promises.push(file_system.readFile(path.resolve(host_uml_file_path)).then((uml_file) =>
{
return new Promise((resolve, reject) =>
{
......
......@@ -89,7 +89,7 @@ parse_cmdline(['help', 'version', 'user', 'db', 'host', 'pkm-db', 'root', 'encod
host_uml_state_machine_file_paths.forEach((host_uml_state_machine_file_path) =>
{
const path = require('path');
read_file_promises.push(file_system.readFile(path.resolve(host_uml_state_machine_file_path), { type : 'Diagram', mime_type : 'application/json' }).then((uml_state_machine_file) =>
read_file_promises.push(file_system.readFile(path.resolve(host_uml_state_machine_file_path)).then((uml_state_machine_file) =>
{
return new Promise((resolve, reject) =>
{
......
......@@ -28,10 +28,6 @@
*/
function insert_update_java_annotations(dbName, java_annotations_documents, update)
{
java_annotations_documents.forEach((java_annotations_document) =>
{
if(!java_annotations_document.type) java_annotations_document.type = 'Annotation';
});
return this.insert_update_documents(dbName, 'annotationsJML', java_annotations_documents, update, { signature : { sourceFile : 1 } });
}
......
......@@ -28,10 +28,6 @@
*/
function insert_update_java_comments(dbName, java_comments_documents, update)
{
java_comments_documents.forEach((java_comments_document) =>
{
if(!java_comments_document.type) java_comments_document.type = 'Comment';
});
return this.insert_update_documents(dbName, 'commentsjava', java_comments_documents, update, { signature : { sourceFile : 1 } });
}
......
......@@ -48,7 +48,7 @@ function postprocess_c_annotations(c_annotations_documents, options = {})
{
var tmp =
{
type : 'Annotation',
type : c_annotations_document.type,
sourceFile : c_annotations_document.sourceFile,
annotations : c_annotations_document.annotations
};
......
......@@ -48,7 +48,7 @@ function postprocess_c_comments(c_comments_documents, options = {})
{
var tmp =
{
type : 'Comment',
type : c_comments_document.type,
sourceFile : c_comments_document.sourceFile,
comments : c_comments_document.comments
};
......
......@@ -48,7 +48,7 @@ function postprocess_c_source_codes(c_source_code_documents, options = {})
{
var tmp =
{
type : 'Code',
type : c_source_code_document.type,
sourceFile : c_source_code_document.sourceFile,
globals : c_source_code_document.globals,
globinit : { option : "None" },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment