csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
# Generation of .eo.cs files and test library common to dotnet and mono
|
2019-05-31 13:34:59 -07:00
|
|
|
eo_files = [
|
|
|
|
'dummy_child.eo',
|
|
|
|
'dummy_numberwrapper.eo',
|
|
|
|
'dummy_test_object.eo',
|
|
|
|
'dummy_test_iface.eo',
|
|
|
|
'dummy_inherit_helper.eo',
|
|
|
|
'dummy_inherit_iface.eo',
|
|
|
|
'dummy_part_holder.eo',
|
|
|
|
'dummy_event_manager.eo',
|
2019-06-28 06:29:01 -07:00
|
|
|
'dummy_constructible_object.eo',
|
2019-05-31 13:34:59 -07:00
|
|
|
]
|
2018-10-17 04:04:07 -07:00
|
|
|
|
2019-09-24 07:36:34 -07:00
|
|
|
private_eo_files = [
|
|
|
|
'dummy_hidden_object.eo'
|
|
|
|
]
|
|
|
|
|
2018-10-17 04:04:07 -07:00
|
|
|
eo_file_targets = []
|
|
|
|
|
2019-09-24 07:36:34 -07:00
|
|
|
foreach eo_file : eo_files + private_eo_files
|
2018-10-17 04:04:07 -07:00
|
|
|
eo_file_targets += custom_target('eolian_gen_' + eo_file,
|
|
|
|
input : eo_file,
|
|
|
|
output : [eo_file + '.h'],
|
2018-12-03 09:49:47 -08:00
|
|
|
command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
|
2018-10-17 04:04:07 -07:00
|
|
|
'-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
|
|
|
|
'-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
|
|
|
|
'-gch', '@INPUT@'])
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
efl_mono_native_test = library('efl_mono_native_test',
|
2019-05-22 13:21:02 -07:00
|
|
|
eo_file_targets + [
|
|
|
|
'libefl_mono_native_test.h',
|
|
|
|
'dummy_child.c',
|
|
|
|
'dummy_inherit_helper.c',
|
|
|
|
'dummy_interfaces.c',
|
|
|
|
'dummy_numberwrapper.c',
|
|
|
|
'dummy_part_holder.c',
|
|
|
|
'dummy_test_object.c',
|
2019-05-31 13:34:59 -07:00
|
|
|
'dummy_event_manager.c',
|
2019-06-28 06:29:01 -07:00
|
|
|
'dummy_constructible_object.c',
|
2019-09-24 07:36:34 -07:00
|
|
|
'dummy_hidden_object.c',
|
2019-05-22 13:21:02 -07:00
|
|
|
],
|
2018-10-17 04:04:07 -07:00
|
|
|
dependencies : [ecore, eo, efl],
|
|
|
|
)
|
|
|
|
|
|
|
|
eo_file_targets = []
|
|
|
|
|
|
|
|
foreach mono_gen_file : eo_files
|
|
|
|
eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
|
|
|
|
input : mono_gen_file,
|
|
|
|
output : [mono_gen_file + '.cs'],
|
2019-03-07 01:54:35 -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', 'efl_mono_native_test',
|
|
|
|
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
|
|
|
'@INPUT@'])
|
|
|
|
endforeach
|
|
|
|
|
2019-11-06 18:47:50 -08:00
|
|
|
efl_mono_src = [
|
|
|
|
'Main.cs',
|
|
|
|
'TestUtils.cs',
|
|
|
|
'EinaTestData.cs',
|
|
|
|
'StructHelpers.cs',
|
|
|
|
'BasicDirection.cs',
|
|
|
|
'Eina.cs',
|
|
|
|
'Eldbus.cs',
|
|
|
|
'Eo.cs',
|
|
|
|
'EoPromises.cs',
|
|
|
|
'EoConstruction.cs',
|
|
|
|
'Errors.cs',
|
|
|
|
'Events.cs',
|
|
|
|
'FunctionPointers.cs',
|
|
|
|
'FunctionPointerMarshalling.cs',
|
|
|
|
'Model.cs',
|
|
|
|
'Parts.cs',
|
|
|
|
'Promises.cs',
|
|
|
|
'Strbuf.cs',
|
|
|
|
'Strings.cs',
|
|
|
|
'Structs.cs',
|
|
|
|
'Value.cs',
|
|
|
|
'ValueEolian.cs',
|
|
|
|
'Inheritance.cs',
|
c#: Implement IList<T> to Eina.List.
Summary:
Container can have three configuration over `Own` and `OwnContent`:
`Own = true` and `OwnContent = true`;
`Own = true` and `OwnContent = false`;
`Own = false`and `OwnContent = false;
If someone try to instanciate the container with `Own = false` and `OwnContent = true`, a exception raises.
There is two Ownerships' behaviours in c#, where `IsReadOnly` is responsible and `IsReadOnly = !OwnContent`:
Full Ownership: User can use modify/Add/Remove operations over the container, this is implemented with `OwnContent = true`.
No Ownership: User **cannot** use modify/Add/Remove operations, this is implemented with `OwnContent = false`.
For the memory, `Own` frees the node, while `OwnContent` frees the data portion.
ref T8487
Reviewers: lauromoura, felipealmeida, YOhoho, segfaultxavi, jptiz
Reviewed By: lauromoura
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8487
Differential Revision: https://phab.enlightenment.org/D10742
2019-12-11 13:47:45 -08:00
|
|
|
'Hash.cs',
|
|
|
|
'List.cs',
|
2019-12-17 11:29:58 -08:00
|
|
|
'Array.cs',
|
2019-11-06 18:47:50 -08:00
|
|
|
]
|
|
|
|
|
csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
if get_option('dotnet')
|
|
|
|
|
|
|
|
dotnet_test_conf_data = configuration_data()
|
|
|
|
|
|
|
|
dotnet_test_conf_data.set('EFL_VERSION', meson.project_version())
|
|
|
|
dotnet_test_conf_data.set('BINDING_BUILD', join_paths(meson.current_build_dir(),
|
|
|
|
'..', '..', 'bindings', 'mono'))
|
|
|
|
dotnet_test_conf_data.set('BINDING_TEST_SRC', meson.current_source_dir())
|
|
|
|
|
|
|
|
dotnet_test_conf_data.set('NETCOREAPP_VERSION', dotnet_core_app_version)
|
|
|
|
|
|
|
|
if get_option('mono-beta')
|
|
|
|
dotnet_test_conf_data.set('EFL_BETA', 'EFL_BETA')
|
|
|
|
else
|
|
|
|
dotnet_test_conf_data.set('EFL_BETA', '')
|
|
|
|
endif
|
|
|
|
|
|
|
|
dotnet_test_csproj = configure_file(input: 'efl_sharp_test_suite.csproj.in',
|
|
|
|
output: 'efl_sharp_test_suite.csproj',
|
|
|
|
configuration: dotnet_test_conf_data,
|
|
|
|
)
|
|
|
|
|
|
|
|
efl_mono_suite = custom_target('efl_mono_test',
|
2019-11-06 18:47:50 -08:00
|
|
|
input: eo_file_targets + [dotnet_test_csproj] + efl_mono_src,
|
csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
output: 'efl_sharp_test_suite.dll',
|
|
|
|
depends: [efl_mono],
|
|
|
|
build_by_default: true,
|
|
|
|
command: [dotnet,
|
|
|
|
'build',
|
|
|
|
'-o',
|
|
|
|
meson.current_build_dir(),
|
|
|
|
'--framework',
|
|
|
|
'netcoreapp' + dotnet_core_app_version,
|
|
|
|
dotnet_test_csproj],
|
|
|
|
)
|
|
|
|
|
|
|
|
else
|
|
|
|
efl_mono_test = library('efl_mono_test',
|
|
|
|
eo_file_targets,
|
|
|
|
link_with : [efl_mono],
|
|
|
|
cs_args : extra_cs_args
|
|
|
|
)
|
|
|
|
|
|
|
|
efl_mono_suite = executable('efl-mono-suite',
|
|
|
|
efl_mono_src,
|
|
|
|
link_with : [efl_mono, efl_mono_test],
|
2019-03-07 01:54:35 -08:00
|
|
|
cs_args : extra_cs_args
|
csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
)
|
|
|
|
endif
|
2018-10-17 04:04:07 -07:00
|
|
|
|
csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
# Common environment shared by both dotnet and mono
|
2019-04-23 08:28:58 -07:00
|
|
|
env_mono = environment()
|
|
|
|
env_mono.set('MONO_PATH', efl_mono_test_suite_path )
|
2019-09-24 13:06:29 -07:00
|
|
|
env_mono.set('EFL_RUN_IN_TREE', '1')
|
2018-10-24 06:08:15 -07:00
|
|
|
|
2019-01-15 23:29:56 -08:00
|
|
|
|
2019-08-05 07:17:52 -07:00
|
|
|
config_libs = ['eina', 'ecore', 'eo', 'efl', 'evas', 'eldbus', 'elementary', 'efl_mono']
|
2019-05-31 12:58:19 -07:00
|
|
|
load_lib = efl_mono_test_suite_path + ':'
|
2018-10-24 06:08:15 -07:00
|
|
|
|
|
|
|
foreach config : config_libs
|
|
|
|
lib = get_variable(config+'_lib')
|
|
|
|
path = lib.full_path().split('/')
|
|
|
|
repaired_path = ''
|
|
|
|
prev = ''
|
|
|
|
|
|
|
|
foreach p : path
|
|
|
|
repaired_path += prev
|
|
|
|
prev = p+'/'
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
load_lib += repaired_path+':'
|
|
|
|
endforeach
|
|
|
|
|
csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
load_lib += ':' + meson.current_build_dir()
|
|
|
|
|
2019-04-23 08:28:58 -07:00
|
|
|
env_mono.set('LD_LIBRARY_PATH', load_lib)
|
2018-10-24 06:08:15 -07:00
|
|
|
|
csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
|
|
|
|
if get_option('dotnet')
|
|
|
|
test('efl-mono-suite',
|
|
|
|
dotnet,
|
|
|
|
args: [join_paths(meson.current_build_dir(), 'efl_sharp_test_suite.dll')],
|
|
|
|
env: env_mono,
|
|
|
|
)
|
|
|
|
else
|
|
|
|
test('efl-mono-suite',
|
|
|
|
efl_mono_suite,
|
|
|
|
env : env_mono
|
|
|
|
)
|
|
|
|
endif
|
2019-11-22 07:01:59 -08:00
|
|
|
|
|
|
|
eolian_mono_helpers_suite = executable('eolian-mono-suite',
|
|
|
|
['eolian_mono_suite.cc'],
|
|
|
|
include_directories : config_dir,
|
|
|
|
dependencies: [check, eolian_cxx, eina_cxx],
|
|
|
|
cpp_args : package_c_args + [
|
|
|
|
'-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"',
|
|
|
|
'-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"']
|
|
|
|
)
|
|
|
|
|
|
|
|
test('eolian-mono-suite', eolian_mono_helpers_suite)
|