<commit_before>var fs = require('fs-extra');

/**************************
 * UI5 and browser:
 * Copy the browser project and all needed UI5 libraries from npm_modules and bower_components to a local folder
 *************************/

// copy browser
fs.copySync('./node_modules/ui5lab-browser/dist/test-resources/ui5lab/browser', './test/ui5lab/browser');

// ui5
fs.copySync('./bower_components/openui5-sap.f/resources', './resources');
fs.copySync('./bower_components/openui5-sap.m/resources', './resources');
fs.copySync('./bower_components/openui5-sap.ui.layout/resources', './resources');
fs.copySync('./bower_components/openui5-sap.ui.core/resources', './resources');
fs.copySync('./bower_components/openui5-themelib_sap_belize/resources', './resources');

/**************************
 * UI5Lab projects:
 * Copy all loaded projects to the appropriate places (resources and test-resources)
 **************************/

// TODO: detect projects dynamically and copy them based on metadata in libraries.json file

// ui5lab.geometry
fs.copySync('./node_modules/ui5lab-library-simple/dist/resources/', './resources');
fs.copySync('./node_modules/ui5lab-library-simple/dist/test-resources/', './test');

// ui5lab.striptoastr
fs.copySync('./node_modules/striptoastr/dist/', './resources');
fs.copySync('./node_modules/striptoastr/test/', './test');

// it.designfuture.qrcode
fs.copySync('./node_modules/openui5-qrcode/dist/', './resources');
fs.copySync('./node_modules/openui5-qrcode/src/', './src');
fs.copySync('./node_modules/openui5-qrcode/test/demo', './test/it/designfuture/qrcode');
fs.copySync('./node_modules/openui5-qrcode/test/index.json', './test/it/designfuture/qrcode/index.json');

// nabi.m
fs.copySync('./node_modules/ui5-nabi-m/dist/resources/', './resources');
fs.copySync('./node_modules/ui5-nabi-m/dist/test-resources/', './test');

// openui5.googlemaps
fs.copySync('./node_modules/openui5-googlemaps/dist/', './resources');
fs.copySync('./node_modules/openui5-googlemaps/test/', './test');

// copy central library.json that lists all UI5Lab projects<commit_msg>hardened combinProjects.js script with try/catch blocks<commit_after>var fs = require('fs-extra');

/**************************
 * UI5 and browser:
 * Copy the browser project and all needed UI5 libraries from npm_modules and bower_components to a local folder
 *************************/

// copy browser
fs.copySync('./node_modules/ui5lab-browser/dist/test-resources/ui5lab/browser', './test/ui5lab/browser');

// ui5
fs.copySync('./bower_components/openui5-sap.f/resources', './resources');
fs.copySync('./bower_components/openui5-sap.m/resources', './resources');
fs.copySync('./bower_components/openui5-sap.ui.layout/resources', './resources');
fs.copySync('./bower_components/openui5-sap.ui.core/resources', './resources');
fs.copySync('./bower_components/openui5-themelib_sap_belize/resources', './resources');

/**************************
 * UI5Lab projects:
 * Copy all loaded projects to the appropriate places (resources and test-resources)
 **************************/

// TODO: detect projects dynamically and copy them based on metadata in libraries.json file

// ui5lab.geometry
try {
	fs.copySync('./node_modules/ui5lab-library-simple/dist/resources/', './resources');
	fs.copySync('./node_modules/ui5lab-library-simple/dist/test-resources/', './test');
} catch (e) {
	console.log("an error occured post-processing the ui5lab.geometry library: " + e.message);
}

// ui5lab.striptoastr
try {
	fs.copySync('./node_modules/striptoastr/dist/', './resources');
	fs.copySync('./node_modules/striptoastr/test/', './test');
} catch (e) {
	console.log("an error occured post-processing the ui5lab.striptoastr library: " + e.message);
}

// it.designfuture.qrcode
try {
	fs.copySync('./node_modules/openui5-qrcode/dist/', './resources');
	fs.copySync('./node_modules/openui5-qrcode/src/', './src');
	fs.copySync('./node_modules/openui5-qrcode/test/demo', './test/it/designfuture/qrcode');
	fs.copySync('./node_modules/openui5-qrcode/test/index.json', './test/it/designfuture/qrcode/index.json');
} catch (e) {
	console.log("an error occured post-processing the it.designfuture.qrcode library: " + e.message);
}

// nabi.m
try {
	fs.copySync('./node_modules/ui5-nabi-m/dist/resources/', './resources');
	fs.copySync('./node_modules/ui5-nabi-m/dist/test-resources/', './test');
} catch (e) {
	console.log("an error occured post-processing the nabi.m library: " + e.message);
}

// openui5.googlemaps
try {
	fs.copySync('./node_modules/openui5-googlemaps/dist/', './resources');
	fs.copySync('./node_modules/openui5-googlemaps/test/', './test');
} catch (e) {
	console.log("an error occured post-processing the openui5.googlemaps library: " + e.message)
}

// copy central library.json that lists all UI5Lab projects
{'fraction_non_alphanumeric': 0.21845770110164206, 'fraction_numerical': 0.011432134691332363, 'mean_word_length': 4.762874251497006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1411416', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1560, 'n_words': 261}