summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-01-10 16:04:06 -0800
committerKonstantin Käfer <mail@kkaefer.com>2018-01-24 08:35:31 -0800
commitecfb77c637b4b572114a61fe4f6887edd34b474b (patch)
tree0c8c2743776838461fa5c5de1a72341550443efe
parente7e6cffcf354cc3d2427103b628f924bb39d7fb0 (diff)
downloadqtlocation-mapboxgl-ecfb77c637b4b572114a61fe4f6887edd34b474b.tar.gz
[build] Write out a list of files generated by our code generator scripts
This will help us tracking deleted/modified/added files
-rw-r--r--.gitignore5
-rw-r--r--platform/android/.gitignore2
-rw-r--r--platform/darwin/.gitignore3
-rw-r--r--scripts/style-code.js9
4 files changed, 19 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index ce65e4c9b6..0f4fa77858 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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 \ No newline at end of file
diff --git a/platform/android/.gitignore b/platform/android/.gitignore
index 3194c43ca8..3d6d48dc02 100644
--- a/platform/android/.gitignore
+++ b/platform/android/.gitignore
@@ -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
diff --git a/platform/darwin/.gitignore b/platform/darwin/.gitignore
new file mode 100644
index 0000000000..f4635b2c19
--- /dev/null
+++ b/platform/darwin/.gitignore
@@ -0,0 +1,3 @@
+# Generated list files from code generation
+/scripts/generate-style-code.list
+/scripts/update-examples.list
diff --git a/scripts/style-code.js b/scripts/style-code.js
index 7e53ebb6be..7a93b13a77 100644
--- a/scripts/style-code.js
+++ b/scripts/style-code.js
@@ -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) {