[build] Write out a list of files generated by our code generator scripts
This will help us tracking deleted/modified/added files
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -34,3 +34,8 @@ xcuserdata
|
||||
test/fixtures/api/assets.zip
|
||||
test/fixtures/storage/assets.zip
|
||||
/.circle-week
|
||||
|
||||
# Generated list files from code generation
|
||||
/scripts/generate-cmake-files.list
|
||||
/scripts/generate-shaders.list
|
||||
/scripts/generate-style-code.list
|
||||
2
platform/android/.gitignore
vendored
2
platform/android/.gitignore
vendored
@@ -30,3 +30,5 @@ captures/
|
||||
# Generated test cases
|
||||
MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/activity/gen/
|
||||
|
||||
# Generated list files from code generation
|
||||
/scripts/generate-style-code.list
|
||||
|
||||
3
platform/darwin/.gitignore
vendored
Normal file
3
platform/darwin/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Generated list files from code generation
|
||||
/scripts/generate-style-code.list
|
||||
/scripts/update-examples.list
|
||||
@@ -1,6 +1,7 @@
|
||||
// Global functions //
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
global.iff = function (condition, val) {
|
||||
return condition() ? val : "";
|
||||
@@ -26,7 +27,15 @@ global.unhyphenate = function (str) {
|
||||
return str.replace(/-/g, " ");
|
||||
};
|
||||
|
||||
// Write out a list of files that this script is modifying so that we can check
|
||||
var files = [];
|
||||
process.on('exit', function() {
|
||||
const list = path.join(path.dirname(process.argv[1]), path.basename(process.argv[1], '.js') + '.list');
|
||||
fs.writeFileSync(list, files.join('\n'));
|
||||
});
|
||||
|
||||
global.writeIfModified = function(filename, newContent) {
|
||||
files.push(filename);
|
||||
try {
|
||||
const oldContent = fs.readFileSync(filename, 'utf8');
|
||||
if (oldContent == newContent) {
|
||||
|
||||
Reference in New Issue
Block a user