diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-15 05:27:35 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-19 20:46:04 +0530 |
commit | 65e9761cb1c8c5d7f75c65f8b35af4ce9bb124d5 (patch) | |
tree | a4131a81ad8f3b60eba33b60b3ec4a21e8400f83 /test cases/vala | |
parent | 23b060f0aa64d59ab6636964f9c308d6c0d2bebc (diff) | |
download | meson-65e9761cb1c8c5d7f75c65f8b35af4ce9bb124d5.zip meson-65e9761cb1c8c5d7f75c65f8b35af4ce9bb124d5.tar.gz meson-65e9761cb1c8c5d7f75c65f8b35af4ce9bb124d5.tar.bz2 |
Support all kinds of generated vala and vapi sources
This is the first step in making Vala support have feature-parity with
C/C++ support. Vala and Vapi sources generated with Generators and
CustomTargets are no longer ignored. Dependencies are setup properly and
they are added to the commandline.
Diffstat (limited to 'test cases/vala')
-rw-r--r-- | test cases/vala/8 generated source/src/meson.build | 5 | ||||
-rw-r--r-- | test cases/vala/8 generated source/src/test.vala | 3 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/installed_files.txt (renamed from test cases/vala/8 generated source/installed_files.txt) | 0 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/meson.build (renamed from test cases/vala/8 generated source/meson.build) | 0 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/src/config.vala.in (renamed from test cases/vala/8 generated source/src/config.vala.in) | 0 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/src/copy_file.py | 7 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/src/meson.build | 17 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/src/returncode.in | 3 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/src/test.vala | 4 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/src/write_wrapper.py | 12 | ||||
-rw-r--r-- | test cases/vala/8 generated sources/tools/meson.build (renamed from test cases/vala/8 generated source/tools/meson.build) | 2 |
11 files changed, 44 insertions, 9 deletions
diff --git a/test cases/vala/8 generated source/src/meson.build b/test cases/vala/8 generated source/src/meson.build deleted file mode 100644 index 9096c67..0000000 --- a/test cases/vala/8 generated source/src/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -config = configure_file(input: 'config.vala.in', - output: 'config.vala', - configuration: cd) - -src = files('test.vala') diff --git a/test cases/vala/8 generated source/src/test.vala b/test cases/vala/8 generated source/src/test.vala deleted file mode 100644 index 98d6821..0000000 --- a/test cases/vala/8 generated source/src/test.vala +++ /dev/null @@ -1,3 +0,0 @@ -void main() { - print (Config.x); -} diff --git a/test cases/vala/8 generated source/installed_files.txt b/test cases/vala/8 generated sources/installed_files.txt index a4c37f6..a4c37f6 100644 --- a/test cases/vala/8 generated source/installed_files.txt +++ b/test cases/vala/8 generated sources/installed_files.txt diff --git a/test cases/vala/8 generated source/meson.build b/test cases/vala/8 generated sources/meson.build index 7271821..7271821 100644 --- a/test cases/vala/8 generated source/meson.build +++ b/test cases/vala/8 generated sources/meson.build diff --git a/test cases/vala/8 generated source/src/config.vala.in b/test cases/vala/8 generated sources/src/config.vala.in index a5196fd..a5196fd 100644 --- a/test cases/vala/8 generated source/src/config.vala.in +++ b/test cases/vala/8 generated sources/src/config.vala.in diff --git a/test cases/vala/8 generated sources/src/copy_file.py b/test cases/vala/8 generated sources/src/copy_file.py new file mode 100644 index 0000000..b90d91f --- /dev/null +++ b/test cases/vala/8 generated sources/src/copy_file.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 + +import os +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff --git a/test cases/vala/8 generated sources/src/meson.build b/test cases/vala/8 generated sources/src/meson.build new file mode 100644 index 0000000..06515c1 --- /dev/null +++ b/test cases/vala/8 generated sources/src/meson.build @@ -0,0 +1,17 @@ +config = configure_file(input: 'config.vala.in', + output: 'config.vala', + configuration: cd) + +print = find_program('write_wrapper.py') +wrapper = custom_target('wrapper', + output : 'print_wrapper.vala', + command : [print, '@OUTPUT@']) + +copy = find_program('copy_file.py') +gen = generator(copy, + output : '@BASENAME@.vala', + arguments : ['@INPUT@', '@OUTPUT@']) + +returncode = gen.process('returncode.in') + +src = files('test.vala') diff --git a/test cases/vala/8 generated sources/src/returncode.in b/test cases/vala/8 generated sources/src/returncode.in new file mode 100644 index 0000000..e3d3ea6 --- /dev/null +++ b/test cases/vala/8 generated sources/src/returncode.in @@ -0,0 +1,3 @@ +int return_code() { + return 0; +} diff --git a/test cases/vala/8 generated sources/src/test.vala b/test cases/vala/8 generated sources/src/test.vala new file mode 100644 index 0000000..ca27676 --- /dev/null +++ b/test cases/vala/8 generated sources/src/test.vala @@ -0,0 +1,4 @@ +int main() { + print_wrapper (Config.x); + return return_code (); +} diff --git a/test cases/vala/8 generated sources/src/write_wrapper.py b/test cases/vala/8 generated sources/src/write_wrapper.py new file mode 100644 index 0000000..b5608f7 --- /dev/null +++ b/test cases/vala/8 generated sources/src/write_wrapper.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import sys + +contents = ''' +void print_wrapper(string arg) { + print (arg); +} +''' + +with open(sys.argv[1], 'w') as f: + f.write(contents) diff --git a/test cases/vala/8 generated source/tools/meson.build b/test cases/vala/8 generated sources/tools/meson.build index 834ec1a..303468e 100644 --- a/test cases/vala/8 generated source/tools/meson.build +++ b/test cases/vala/8 generated sources/tools/meson.build @@ -1,3 +1,3 @@ -executable('generatedtest', [src, config], +executable('generatedtest', [src, config, returncode, wrapper], install : true, dependencies: [dependency('glib-2.0'), dependency('gobject-2.0')]) |