2018-10-25 14:40:31 -07:00
|
|
|
add_languages('cs')
|
|
|
|
|
2019-01-15 23:29:56 -08:00
|
|
|
|
|
|
|
runtime_assemblies = []
|
|
|
|
|
|
|
|
# Check if we should use dotnet options
|
|
|
|
cs_is_dotnet = meson.get_compiler('cs').get_id().contains('dotnet')
|
|
|
|
|
|
|
|
if (cs_is_dotnet)
|
|
|
|
|
2019-03-02 07:09:55 -08:00
|
|
|
warning('Dotnet support is still not upstream in meson.')
|
|
|
|
|
2019-01-15 23:29:56 -08:00
|
|
|
runtime_assemblies += [
|
2019-03-02 07:09:55 -08:00
|
|
|
'-r:System.Console.dll',
|
|
|
|
'-r:Microsoft.CSharp.dll',
|
|
|
|
'-r:System.Collections.dll',
|
|
|
|
'-r:System.Collections.Concurrent.dll',
|
|
|
|
'-r:System.ComponentModel.Primitives.dll',
|
|
|
|
'-r:System.ComponentModel.Primitives.dll',
|
|
|
|
'-r:System.Diagnostics.Debug.dll',
|
|
|
|
'-r:System.Diagnostics.TraceSource.dll',
|
|
|
|
'-r:System.Dynamic.Runtime.dll',
|
|
|
|
'-r:System.Linq.dll',
|
|
|
|
'-r:System.Runtime.dll',
|
|
|
|
'-r:System.Runtime.Extensions.dll',
|
|
|
|
'-r:System.Security.dll',
|
2019-01-15 23:29:56 -08:00
|
|
|
]
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2018-10-17 04:04:07 -07:00
|
|
|
mono_sublibs = [
|
|
|
|
['Eina', true, ], #
|
|
|
|
['Eolian', true, ], #
|
|
|
|
['Eo', true, ], #
|
|
|
|
['Ecore', false, ], #
|
|
|
|
['Efl', true, ], #
|
|
|
|
['Evas', false, ], #
|
|
|
|
['Edje', false, ], #
|
|
|
|
['Eldbus', true, ], #
|
|
|
|
['Elementary', false, ] #
|
|
|
|
]
|
|
|
|
|
|
|
|
blacklisted_files = [
|
2019-02-06 11:50:28 -08:00
|
|
|
'efl_class.eo',
|
2018-10-17 04:04:07 -07:00
|
|
|
'efl_canvas_text.eo',
|
|
|
|
'efl_canvas_scene3d.eo',
|
|
|
|
'evas_canvas3d_camera.eo',
|
|
|
|
'evas_canvas3d_light.eo',
|
|
|
|
'evas_canvas3d_material.eo',
|
|
|
|
'evas_canvas3d_mesh.eo',
|
|
|
|
'evas_canvas3d_node.eo',
|
|
|
|
'evas_canvas3d_object.eo',
|
|
|
|
'evas_canvas3d_primitive.eo',
|
|
|
|
'evas_canvas3d_scene.eo',
|
|
|
|
'evas_canvas3d_texture.eo',
|
|
|
|
'efl_canvas_vg_object.eo',
|
|
|
|
'efl_vg.eo',
|
|
|
|
'efl_vg_container.eo',
|
|
|
|
'efl_vg_gradient.eo',
|
|
|
|
'efl_vg_gradient_radial.eo',
|
|
|
|
'efl_vg_gradient_linear.eo',
|
|
|
|
'efl_vg_root_node.eo',
|
|
|
|
'efl_vg_shape.eo.cs',
|
|
|
|
'efl_io_buffer.eo',
|
|
|
|
'efl_io_queue.eo',
|
|
|
|
'efl_io_sizer.eo',
|
|
|
|
'efl_io_closer_fd.eo',
|
|
|
|
'efl_io_buffered_stream.eo',
|
|
|
|
'efl_io_positioner_fd.eo',
|
|
|
|
'efl_io_reader_fd.eo',
|
|
|
|
'efl_io_writer_fd.eo',
|
|
|
|
'efl_io_copier_fd.eo',
|
|
|
|
'efl_io_sizer_fd.eo',
|
|
|
|
'efl_io_stdin.eo',
|
|
|
|
'efl_io_stdout.eo',
|
|
|
|
'efl_io_stderr.eo',
|
|
|
|
'efl_io_file.eo',
|
|
|
|
'efl_io_copier.eo',
|
|
|
|
'efl_object_override.eo',
|
|
|
|
'elm_web.eo',
|
|
|
|
'elm_map.eo',
|
|
|
|
'elm_list.eo',
|
|
|
|
'elm_genlist.eo',
|
|
|
|
'elm_view_list.eo',
|
|
|
|
'elm_genlist_item.eo',
|
|
|
|
'elm_gengrid.eo',
|
efl-csharp: Respect beta for classes and other stuff.
Summary:
In order to work around an issue with Efl.App, which is stable but
inherits from Efl.Core.Command_Line, @beta interfaces/mixins in the
inheritance chain are simply skipped.
Also changed the class used int test for inheritance from C#
Efl.Loop is stable but internally it uses a @beta class as argument to
its Register() method in the constructor. When instantiating a
user-defined C# subclass, the binding calls the C# override in the
NativeInherit class and the marshalling fails as no code is generated
for the beta class.
Also moved Efl.Part test to a beta class. Efl.Part is still beta.
Regarding parts, they are skipped if its class is @beta too.
Also rejected all elm_* files in elm public eo files. They should get
back in as they are converted to Efl.Ui.* api. An exception is
elm_interface_scrollable.eo, as efl_ui_panel depends on it.
Fixes T7730
Test Plan: Run tests
Reviewers: vitor.sousa, segfaultxavi, felipealmeida, cedric, bu5hm4n, zmike
Reviewed By: vitor.sousa
Subscribers: #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7730
Differential Revision: https://phab.enlightenment.org/D8268
2019-03-11 11:46:12 -07:00
|
|
|
'elm_glview_eo.cs',
|
|
|
|
'elm_code_widget.eo',
|
|
|
|
'elm_multibuttonentry_part.eo',
|
|
|
|
'elm_atspi_bridge.eo',
|
|
|
|
'elm_atspi_app_object.eo',
|
2018-10-17 04:04:07 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
efl_mono_lib = library('eflcustomexportsmono',
|
|
|
|
join_paths('..', '..', 'lib', 'efl_mono', 'efl_custom_exports_mono.c'),
|
|
|
|
install : true,
|
2019-05-10 03:29:34 -07:00
|
|
|
dependencies : [eo, eina, ecore],
|
|
|
|
version : meson.project_version()
|
2018-10-17 04:04:07 -07:00
|
|
|
)
|
|
|
|
|
2019-01-17 04:43:57 -08:00
|
|
|
beta_option = []
|
|
|
|
if (get_option('mono-beta'))
|
|
|
|
beta_option = '-b'
|
|
|
|
endif
|
|
|
|
|
2018-10-17 04:04:07 -07:00
|
|
|
mono_generator_target = []
|
|
|
|
mono_files = []
|
|
|
|
foreach lib : mono_sublibs
|
|
|
|
package_name = lib[0].to_lower()
|
|
|
|
eo_file_subdirs = get_variable(package_name + '_eo_subdirs')
|
|
|
|
file_location = join_paths('..', '..', 'lib', package_name)
|
|
|
|
|
|
|
|
if (package_name != 'eldbus')
|
|
|
|
foreach eo_file_subdir : eo_file_subdirs
|
|
|
|
if eo_file_subdir != ''
|
|
|
|
mono_pub_eo_files = get_variable(package_name + '_' + eo_file_subdir +'_eo_files') + get_variable(package_name + '_' + eo_file_subdir + '_eot_files')
|
|
|
|
else
|
|
|
|
mono_pub_eo_files = get_variable(package_name +'_eo_files') + get_variable(package_name + '_eot_files')
|
|
|
|
endif
|
|
|
|
|
|
|
|
subdir_file_location = join_paths(file_location, eo_file_subdir)
|
|
|
|
foreach mono_gen_file : mono_pub_eo_files
|
|
|
|
if not blacklisted_files.contains(mono_gen_file)
|
|
|
|
mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
|
|
|
|
input : join_paths(subdir_file_location, mono_gen_file),
|
|
|
|
output : [mono_gen_file + '.cs'],
|
2019-01-17 04:43:57 -08:00
|
|
|
command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
|
2018-10-17 04:04:07 -07:00
|
|
|
'--dllimport', package_name,
|
|
|
|
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
mono-docs: Allow embedding external examples
Summary:
New option added to eolian_gen: -e <dir>
This specifies a directory to search for examples. If a file is found with the
same name as an EFL C# class (e.g. Efl.Ui.Button.cs) or as an EFL C# method or
property (e.g. Efl.IText.Text.cs, Efl.IText.SetText.cs) its full
contents will be embedded in the documentation for that class or method within
<example> and <code> tags. This is, in turn, is parsed by DocFX and shown
in Example boxes in the generated pages.
If an example file is not found, no examples are embedded for that object.
If -e is not used, no examples are embedded for any object.
New option added to meson: mono-examples-dir to point to the examples directory.
This directory is then passed to eolian_mono through -e.
Do not use it (or define it to nothing) to disable example embedding.
No performance drop has been observed because of these extra tests.
Right now examples can only be given for base classes, not for derived ones
(i.e. Efl.IText.Text but not Efl.Ui.Button.Text). This will be addressed in a
later commit.
Feature
Depends on D8587
Test Plan:
Create an examples folder and put some files in it:
```
mkdir /tmp/examples
echo 'var button = new Efl.Ui.Button();' > /tmp/examples/Efl.Ui.Button.cs
echo 'button.AutoRepeatEnabled = true;' > /tmp/examples/Efl.Ui.IAutorepeat.AutorepeatEnabled.cs
echo 'button.SetAutoRepeatEnabled(true);' > /tmp/examples/Efl.Ui.IAutorepeat.SetAutorepeatEnabled.cs
```
Configure meson to embed examples and build:
```
meson configure -Dmono-examples-dir=/tmp/examples
ninja
```
Examine the generated efl_ui_button.eo.cs file to see embedded <example> tags,
or run DocFX and bask in the glory of documentation pages with examples:
```
cd doc/docfx
./gendoc.sh
```
Reviewers: lauromoura, felipealmeida, vitor.sousa, zmike, bu5hm4n
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8592
2019-04-11 01:38:40 -07:00
|
|
|
'-e', get_option('mono-examples-dir'),
|
2018-10-17 04:04:07 -07:00
|
|
|
'@INPUT@'])
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
if lib[1]
|
|
|
|
subdir(package_name + '_mono')
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2019-01-03 13:06:53 -08:00
|
|
|
efl_mono_conf_data = configuration_data()
|
|
|
|
efl_mono_conf_data.set('EINA', eina_lib.full_path())
|
|
|
|
efl_mono_conf_data.set('EFL', efl_lib.full_path())
|
|
|
|
efl_mono_conf_data.set('ECORE', ecore_lib.full_path())
|
|
|
|
efl_mono_conf_data.set('EO', eo_lib.full_path())
|
|
|
|
efl_mono_conf_data.set('EVAS', evas_lib.full_path())
|
|
|
|
efl_mono_conf_data.set('ELDBUS', eldbus_lib.full_path())
|
|
|
|
efl_mono_conf_data.set('ELEMENTARY', elementary_lib.full_path())
|
|
|
|
|
2019-01-15 23:29:56 -08:00
|
|
|
efl_mono_dll_config = configure_file(input : 'efl_mono.dll.config.in',
|
|
|
|
output : 'efl_mono.dll.config',
|
|
|
|
configuration : efl_mono_conf_data)
|
2019-01-03 13:06:53 -08:00
|
|
|
|
2019-03-07 01:54:35 -08:00
|
|
|
extra_cs_args = runtime_assemblies
|
|
|
|
|
|
|
|
if get_option('mono-beta')
|
|
|
|
extra_cs_args += '-d:EFL_BETA'
|
|
|
|
endif
|
|
|
|
|
2019-03-15 02:35:10 -07:00
|
|
|
efl_mono_install_dir = join_paths(dir_lib, 'efl-mono-'+version_major)
|
|
|
|
efl_mono_xml_doc = join_paths(meson.current_build_dir(), 'efl_mono.xml')
|
|
|
|
|
2018-10-17 04:04:07 -07:00
|
|
|
efl_mono = library('efl_mono',
|
|
|
|
mono_generator_target + mono_files + [efl_src],
|
|
|
|
install : true,
|
2019-03-15 02:35:10 -07:00
|
|
|
install_dir : efl_mono_install_dir,
|
|
|
|
cs_args : extra_cs_args + ['-doc:' + efl_mono_xml_doc]
|
2018-10-17 04:04:07 -07:00
|
|
|
)
|
|
|
|
|
2019-03-15 02:35:10 -07:00
|
|
|
meson.add_install_script(join_paths(meson.source_root(), 'meson', 'meson_csharp_docs.sh'),
|
|
|
|
efl_mono_xml_doc,
|
|
|
|
efl_mono_install_dir)
|
|
|
|
|
2018-10-17 04:04:07 -07:00
|
|
|
efl_mono_test_suite_path=join_paths(meson.current_build_dir())
|
|
|
|
|
|
|
|
pkgconfig.generate(
|
|
|
|
name : 'efl-mono',
|
|
|
|
description : 'Efl C# bindings',
|
2018-12-27 03:54:30 -08:00
|
|
|
version : version_major + '.' + version_minor + '.' + version_micro,
|
2018-10-17 04:04:07 -07:00
|
|
|
libraries : ['-r:${assemblies_dir}/efl_mono.dll'],
|
|
|
|
variables : ['assemblies_dir='+join_paths(dir_lib, 'efl-mono-'+version_major),
|
|
|
|
'mono_libs=-r:${assemblies_dir}/efl_mono.dll']
|
|
|
|
)
|
|
|
|
test_dirs += 'efl_mono'
|