[polari/ci: 2/7] build: Syntax-check javascript sources



commit 8446247aa43e8739ba2a7f20a4832af98dfe35b0
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Oct 18 21:29:17 2017 +0200

    build: Syntax-check javascript sources

 meson.build     | 1 +
 src/meson.build | 7 +++++++
 2 files changed, 8 insertions(+)
---
diff --git a/meson.build b/meson.build
index c0bd207..048643b 100644
--- a/meson.build
+++ b/meson.build
@@ -28,6 +28,7 @@ girdir = join_paths(pkgdatadir, 'gir-1.0')
 typelibdir = join_paths(pkglibdir, 'girepository-1.0')
 
 gjs_console = find_program('gjs')
+js52 = find_program('js52', required: false)
 
 desktop_file_validate = find_program('desktop-file-validate', required: false)
 appstream_util = find_program('appstream-util', required: false)
diff --git a/src/meson.build b/src/meson.build
index c0242d2..084d6e7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -44,6 +44,13 @@ js_sources = [
 js_xml = []
 foreach js_source : js_sources
   js_xml += '    <file>@0@</file>'.format(js_source)
+
+  if (js52.found())
+    test('Syntax check ' + js_source, js52,
+      args: ['-s', '-c', js_source],
+      workdir: meson.current_source_dir()
+    )
+  endif
 endforeach
 
 resource_data = configuration_data()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]