summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--homematic/meson.build4
-rw-r--r--meson.build37
3 files changed, 42 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..378eac2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build
diff --git a/homematic/meson.build b/homematic/meson.build
new file mode 100644
index 0000000..5a35437
--- /dev/null
+++ b/homematic/meson.build
@@ -0,0 +1,4 @@
+homematic = [
+ meson.current_source_dir() / 'xmlrpc.go',
+ meson.current_source_dir() / 'device.go',
+]
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..4de00bd
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,37 @@
+project('homematic-go')
+
+go = find_program('go', required : true)
+
+subdir('homematic')
+
+homematic_go = custom_target(
+ input : [
+ meson.current_source_dir() / 'main.go',
+ ],
+ output : 'homematic-go',
+ command : [
+ go,
+ 'build',
+ '-o',
+ '@OUTPUT@',
+ '@INPUT@',
+ ],
+ depend_files : [
+ homematic,
+ ],
+ build_by_default : true,
+)
+
+run_target(
+ 'run',
+ command : [
+ homematic_go,
+ ],
+)
+
+test(
+ 'unit-tests',
+ go,
+ args: ['test', './...'],
+ workdir: meson.current_source_dir()
+)