summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-04-23 01:53:53 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-04-23 01:53:53 +0200
commit86d560fea04d7432b54e8b317974bdb141ba33eb (patch)
tree34ebb96fcfa376401e2141fe5ca31460a586dbbf
parentab07ef8c6293713166d4a20aba8cf826b835e35a (diff)
more work on the overall structure
we now have a testsuite, and .eo files in general-test that do cover *all* types that are avaiable from builtins, except uint128 as i cannot make this work....
-rw-r--r--general-test/General-Test.h11
-rw-r--r--general-test/basics.eot47
-rw-r--r--general-test/generator.c129
-rw-r--r--general-test/meson.build40
-rw-r--r--general-test/test_generator.eo98
-rw-r--r--general-test/test_tester.eo65
-rw-r--r--java/compatibility_tests/input_build.xml.in39
-rw-r--r--java/compatibility_tests/meson.build36
-rw-r--r--java/compatibility_tests/tests/CompatibilityTests.java56
-rw-r--r--java/efl-bindings/input_build.xml.in29
-rw-r--r--java/efl-bindings/meson.build37
-rw-r--r--java/efl-bindings/tests/BasicTests.java (renamed from java/test-cases/BasicTests.java)2
-rw-r--r--java/generator.h2
-rw-r--r--java/generator_build.c74
-rw-r--r--java/generator_java.c95
-rw-r--r--java/generator_jni.c21
-rw-r--r--java/jni-bindings-struct-fetch.h16
-rw-r--r--java/jni-bindings.c36
-rw-r--r--java/jni-bindings.h11
-rw-r--r--java/manual-bindings/Application.java (renamed from java/java-files/Application.java)1
-rw-r--r--java/manual-bindings/ApplicationConfig.java.in (renamed from java/java-files/ApplicationConfig.java.in)0
-rw-r--r--java/manual-bindings/Binbuf.java (renamed from java/java-files/Binbuf.java)0
-rw-r--r--java/manual-bindings/EflAccessor.java (renamed from java/java-files/EflAccessor.java)0
-rw-r--r--java/manual-bindings/EflArray.java (renamed from java/java-files/EflArray.java)0
-rw-r--r--java/manual-bindings/EflFuture.java (renamed from java/java-files/EflFuture.java)0
-rw-r--r--java/manual-bindings/EflHash.java (renamed from java/java-files/EflHash.java)0
-rw-r--r--java/manual-bindings/EflIterator.java (renamed from java/java-files/EflIterator.java)0
-rw-r--r--java/manual-bindings/EflList.java (renamed from java/java-files/EflList.java)0
-rw-r--r--java/manual-bindings/Event.java (renamed from java/java-files/Event.java)0
-rw-r--r--java/manual-bindings/EventHandler.java (renamed from java/java-files/EventHandler.java)0
-rw-r--r--java/manual-bindings/EventListener.java (renamed from java/java-files/EventListener.java)0
-rw-r--r--java/manual-bindings/NativeCaller.java (renamed from java/java-files/NativeCaller.java)0
-rw-r--r--java/manual-bindings/NativeObjectCaller.java (renamed from java/java-files/NativeObjectCaller.java)0
-rw-r--r--java/manual-bindings/ReturnType.java (renamed from java/java-files/ReturnType.java)0
-rw-r--r--java/manual-bindings/RwSlice.java (renamed from java/java-files/RwSlice.java)0
-rw-r--r--java/manual-bindings/Slice.java (renamed from java/java-files/Slice.java)0
-rw-r--r--java/manual-bindings/Strbuf.java (renamed from java/java-files/Strbuf.java)0
-rw-r--r--java/manual-bindings/Value.java (renamed from java/java-files/Value.java)0
-rw-r--r--java/manual-bindings/ValueReference.java (renamed from java/java-files/ValueReference.java)0
-rw-r--r--java/manual-bindings/meson.build (renamed from java/java-files/meson.build)0
-rw-r--r--java/meson.build36
-rw-r--r--meson.build5
42 files changed, 776 insertions, 110 deletions
diff --git a/general-test/General-Test.h b/general-test/General-Test.h
new file mode 100644
index 0000000..e4502f7
--- /dev/null
+++ b/general-test/General-Test.h
@@ -0,0 +1,11 @@
1#ifndef GENERAL_TEST_H
2#define GENERAL_TEST_H 1
3
4#include <Eo.h>
5#include <stdint.h>
6
7#include <basics.eot.h>
8#include <test_generator.eo.h>
9
10
11#endif
diff --git a/general-test/basics.eot b/general-test/basics.eot
new file mode 100644
index 0000000..df3d7c5
--- /dev/null
+++ b/general-test/basics.eot
@@ -0,0 +1,47 @@
1struct Test.A;
2
3struct Test.B {
4 f1 : byte;
5 f2 : ubyte;
6 f3 : char;
7 f4 : short;
8 f5 : ushort;
9 f6 : int;
10 f7 : uint;
11 f8 : long;
12 f9 : ulong;
13 f10 : llong;
14 f11 : ullong;
15 f12 : int8;
16 f13 : uint8;
17 f14 : int16;
18 f15 : uint16;
19 f16 : int32;
20 f17 : uint32;
21 f18 : int64;
22 f19 : uint64;
23 //f20 : int128;
24 //f21 : uint128;
25 f22 : size;
26 f23 : ssize;
27 f24 : intptr;
28 f25 : uintptr;
29 f26 : ptrdiff;
30 f27 : time;
31 f28 : float;
32 f29 : double;
33 f30 : bool;
34}
35
36struct Test.C {
37 f31 : slice<ubyte>;
38 f32 : rw_slice<ubyte>;
39 f33 : any_value;
40 f34 : any_value_ref;
41 f35 : binbuf;
42 f36 : event;
43 f37 : mstring;
44 f38 : string;
45 f39 : stringshare;
46 f40 : strbuf;
47}
diff --git a/general-test/generator.c b/general-test/generator.c
new file mode 100644
index 0000000..ef739c8
--- /dev/null
+++ b/general-test/generator.c
@@ -0,0 +1,129 @@
1#include "General-Test.h"
2
3struct _Test_A {
4 int x;
5};
6
7typedef struct
8{
9 Test_A *a;
10} Test_Generator_Data;
11
12EOLIAN static Test_A *
13_test_generator_get_a_instance(Eo *obj, Test_Generator_Data *pd)
14{
15 if (!pd->a)
16 pd->a = calloc(1, sizeof(Test_A));
17 return pd->a;
18}
19
20EOLIAN static Eina_Bool
21_test_generator_verify_a_instance(Eo *obj, Test_Generator_Data *pd, Test_A *val)
22{
23 if (pd->a == val) return EINA_TRUE;
24 return EINA_FALSE;
25}
26
27EOLIAN static Test_B
28_test_generator_max_get(const Eo *obj, Test_Generator_Data *pd)
29{
30 return (Test_B){
31 CHAR_MAX,
32 UCHAR_MAX,
33 CHAR_MAX,
34 SHRT_MAX,
35 USHRT_MAX,
36 INT_MAX,
37 UINT_MAX,
38 LONG_MAX,
39 ULONG_MAX,
40 LLONG_MAX,
41 ULLONG_MAX,
42 INT8_MAX,
43 UINT8_MAX,
44 INT16_MAX,
45 UINT16_MAX,
46 INT32_MAX,
47 UINT32_MAX,
48 INT64_MAX,
49 UINT64_MAX,
50 //skip
51 //skip
52 SIZE_MAX,
53 SSIZE_MAX,
54 INTPTR_MAX,
55 UINTPTR_MAX,
56 PTRDIFF_MAX,
57 LONG_MAX,
58 1.0,
59 1.0,
60 EINA_TRUE
61 };
62}
63
64EOLIAN static Test_B
65_test_generator_min_get(const Eo *obj, Test_Generator_Data *pd)
66{
67 return (Test_B){
68 CHAR_MIN,
69 0,
70 CHAR_MIN,
71 SHRT_MIN,
72 0,
73 INT_MIN,
74 0,
75 LONG_MIN,
76 0,
77 LLONG_MIN,
78 0,
79 INT8_MIN,
80 0,
81 INT16_MIN,
82 0,
83 INT32_MIN,
84 0,
85 INT64_MIN,
86 0,
87 //skip
88 //skip
89 0,
90 0,
91 INTPTR_MIN,
92 0,
93 PTRDIFF_MIN,
94 LONG_MIN,
95 -1.0,
96 -1.0,
97 EINA_FALSE
98 };
99}
100
101EOLIAN static Eina_Bool
102_test_generator_verifier(Eo *obj, Test_Generator_Data *pd, Test_B *val)
103{
104 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f1 == 120, EINA_FALSE);
105 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f2 == 210, EINA_FALSE);
106 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f3 == 122, EINA_FALSE);
107 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f4 == 300, EINA_FALSE);
108 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f5 == 40000, EINA_FALSE);
109 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f6 == 2000000000, EINA_FALSE);
110 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f7 == 4200000000, EINA_FALSE);
111 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f8 == 2140000000, EINA_FALSE);
112 EINA_SAFETY_ON_FALSE_RETURN_VAL(val->f9 == 4290000000, EINA_FALSE);
113 return EINA_TRUE;
114}
115
116EOLIAN static Test_C
117_test_generator_generate_elements(Eo *obj, Test_Generator_Data *pd)
118{
119
120}
121
122EOLIAN static Eina_Bool
123_test_generator_verify_elements(Eo *obj, Test_Generator_Data *pd, Test_C val)
124{
125
126}
127
128
129#include "test_generator.eo.c"
diff --git a/general-test/meson.build b/general-test/meson.build
new file mode 100644
index 0000000..28c8e13
--- /dev/null
+++ b/general-test/meson.build
@@ -0,0 +1,40 @@
1pub_eo_types_files = [
2 'basics.eot'
3]
4
5pub_eo_files = [
6 'test_generator.eo',
7 'test_tester.eo'
8]
9
10pub_eo_file_target = []
11
12foreach eo_file : pub_eo_types_files
13 pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
14 input : eo_file,
15 output : [eo_file + '.h'],
16 depfile : eo_file + '.d',
17 command : eolian_gen + [
18 '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
19 '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
20 '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
21 '-gchd', '@INPUT@'])
22endforeach
23
24foreach eo_file : pub_eo_files
25 pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
26 input : eo_file,
27 output : [eo_file + '.h'],
28 depfile : eo_file + '.d',
29 command : eolian_gen + [
30 '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
31 '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
32 '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
33 '-gchd', '@INPUT@'])
34endforeach
35
36general_test = declare_dependency(
37 include_directories: include_directories('.'),
38 sources: ['generator.c'] + pub_eo_file_target,
39 dependencies: [efl_ui]
40)
diff --git a/general-test/test_generator.eo b/general-test/test_generator.eo
new file mode 100644
index 0000000..27ef464
--- /dev/null
+++ b/general-test/test_generator.eo
@@ -0,0 +1,98 @@
1import basics;
2
3class Test.Generator extends Efl.Object {
4 methods {
5 get_a_instance {
6 [[This will return the instance of a opaque struct
7 @since 1.66
8 ]]
9 return : Test.A @by_ref; [[a opaque pointer]]
10 }
11 verify_a_instance {
12 [[This will verify that the point of a, is equal to the one returned by @.get_a_instance
13 @since 1.66
14 ]]
15 params {
16 val : Test.A @by_ref; [[the reference to verify]]
17 }
18 return : bool;
19 }
20 @property max {
21 [[Get the maximum values from B
22
23 boolean will be true
24 double & float will be 1.0
25 @since 1.66
26 ]]
27 values {
28 max : Test.B; [[The max values]]
29 }
30 get {
31
32 }
33 }
34 @property min {
35 [[Get the maximum values from B
36
37 boolean will be false
38 double & float will be -1.0
39 @since 1.66
40 ]]
41 values {
42 min : Test.B; [[The min values]]
43 }
44 get {
45
46 }
47 }
48 verifier {
49 [[Verify that the values passed in by B are correct & expected.
50
51 f1 120,
52 f2 210,
53 f3 122,
54 f4 300,
55 f5 40000,
56 f6 2000000000,
57 f7 4200000000,
58 f8 2140000000,
59 f9 4290000000,
60 f10
61 f11
62 f12
63 f13
64 f14
65 f15
66 f16
67 f17
68 f18
69 f19
70 f20
71 f21
72 f22
73 f23
74 f24
75 f25
76 f26
77 f27
78 f28 20.051995
79 f29 1.1337
80 f30 false
81 @since 1.66
82 ]]
83 params {
84 val : Test.B @by_ref;
85 }
86 return : bool;
87 }
88 generate_elements {
89 return : Test.C;
90 }
91 verify_elements {
92 params {
93 val : Test.C; [[the elements to verify]]
94 }
95 return : bool; [[ return $true on verification, $false otherwise]]
96 }
97 }
98}
diff --git a/general-test/test_tester.eo b/general-test/test_tester.eo
new file mode 100644
index 0000000..6363db0
--- /dev/null
+++ b/general-test/test_tester.eo
@@ -0,0 +1,65 @@
1import basics;
2
3struct D {
4 acc1 : accessor<int>;
5 acc2 : accessor<Test.A>;
6 acc3 : accessor<Test.Tester>;
7 acc4 : accessor<slice<ubyte>>;
8 acc5 : accessor<rw_slice<ubyte>>;
9 acc6 : accessor<any_value>;
10 acc7 : accessor<any_value_ref>;
11 acc8 : accessor<binbuf>;
12 acc9 : accessor<event>;
13 acc10: accessor<mstring>;
14 acc11: accessor<string>;
15 acc12: accessor<stringshare>;
16 acc13: accessor<strbuf>;
17
18 arr1 : array<int>;
19 arr2 : array<Test.A>;
20 arr3 : array<Test.Tester>;
21 arr4 : array<slice<ubyte>>;
22 arr5 : array<rw_slice<ubyte>>;
23 arr6 : array<any_value>;
24 arr7 : array<any_value_ref>;
25 arr8 : array<binbuf>;
26 arr9 : array<event>;
27 arr10: array<mstring>;
28 arr11: array<string>;
29 arr12: array<stringshare>;
30 arr13: array<strbuf>;
31
32 fut1 : future<int>;
33 fut2 : future<Test.A>;
34 fut3 : future<Test.Tester>;
35 fut4 : future<slice<ubyte>>;
36 fut5 : future<rw_slice<ubyte>>;
37 fut6 : future<any_value>;
38 fut7 : future<any_value_ref>;
39 fut8 : future<binbuf>;
40 fut9 : future<event>;
41 fut10: future<mstring>;
42 fut11: future<string>;
43 fut12: future<stringshare>;
44 fut13: future<strbuf>;
45
46 ite1 : iterator<int>;
47 ite2 : iterator<Test.A>;
48 ite3 : iterator<Test.Tester>;
49 ite4 : iterator<slice<ubyte>>;
50 ite5 : iterator<rw_slice<ubyte>>;
51 ite6 : iterator<any_value>;
52 ite7 : iterator<any_value_ref>;
53 ite8 : iterator<binbuf>;
54 ite9 : iterator<event>;
55 ite10: iterator<mstring>;
56 ite11: iterator<string>;
57 ite12: iterator<stringshare>;
58 ite13: iterator<strbuf>;
59}
60
61class Test.Tester {
62 methods {
63
64 }
65}
diff --git a/java/compatibility_tests/input_build.xml.in b/java/compatibility_tests/input_build.xml.in
new file mode 100644
index 0000000..1d0c939
--- /dev/null
+++ b/java/compatibility_tests/input_build.xml.in
@@ -0,0 +1,39 @@
1<project default="compile">
2 <target name="compile">
3 <mkdir dir="bin"/>
4 <javac srcdir="src" destdir="bin">
5 <classpath>
6 <pathelement location="../efl-bindings/jefl.jar"/>
7 </classpath>
8 </javac>
9 <jar jarfile="jefltest.jar" basedir="bin"/>
10 </target>
11 <target name="test">
12 <property name="collector.dir" value="@TEST_DIR@"/>
13 <property name="collector.class" value="CompatibilityTests"/>
14 <delete>
15 <fileset dir="${collector.dir}" includes="${collector.class}*.class"/>
16 </delete>
17 <javac srcdir="${collector.dir}" destdir="./">
18 <classpath>
19 <pathelement location="jefltest.jar"/>
20 <pathelement location="../efl-bindings/jefl.jar"/>
21 </classpath>
22 </javac>
23 <available file="${collector.dir}/${collector.class}.class" property="hasFailingTests"/>
24 <junit haltonerror="yes" haltonfailure="yes">
25 <classpath>
26 <pathelement location="./"/>
27 <pathelement location="jefltest.jar"/>
28 <pathelement location="../efl-bindings/jefl.jar"/>
29 </classpath>
30 <batchtest todir="${collector.dir}" unless="hasFailingTests">
31 <fileset dir="${collector.dir}" includes="**/*.java" excludes="**/${collector.class}.*"/>
32 <formatter type="failure"/>
33 <formatter type="plain" usefile="false"/>
34 </batchtest>
35 <test name="CompatibilityTests">
36 </test>
37 </junit>
38 </target>
39</project>
diff --git a/java/compatibility_tests/meson.build b/java/compatibility_tests/meson.build
new file mode 100644
index 0000000..72291e0
--- /dev/null
+++ b/java/compatibility_tests/meson.build
@@ -0,0 +1,36 @@
1
2
3java_tcase_generated = custom_target('java-generated',
4 command: [java_generator, '-g', '@OUTDIR@', '-s', meson.current_source_dir(), '-b', meson.current_build_dir(), '-d', '@DEPFILE@', '--test-mode'],
5 depfile : 'depfile.d',
6 output : ['jefl-jni-glue.c', 'build.xml'],
7)
8
9jefl_testcase_so = library('jefltcase',
10 [java_tcase_generated],
11 c_args: '-lm',
12 include_directories: java_include_dir,
13 dependencies : [efl_ui, jni_bindings, general_test],
14)
15
16build_xml_conf = configuration_data()
17
18build_xml_conf.set('TEST_DIR', join_paths(meson.current_source_dir(), 'tests'))
19
20configure_file(
21 input: 'input_build.xml.in',
22 output: 'input_build.xml',
23 configuration: build_xml_conf,
24)
25
26build_comp_test_ant = custom_target('ant_comp_build',
27 build_by_default : true,
28 input: java_generated,
29 command: [ant, '-buildfile', '@OUTDIR@/build.xml'],
30 output: 'jefltest.jar',
31 depends : [build_jar_with_ant, jefl_testcase_so]
32)
33
34test('ant-test-compatibility', ant,
35 args: ['-buildfile', join_paths(meson.current_build_dir(), 'build.xml'), 'test'],
36)
diff --git a/java/compatibility_tests/tests/CompatibilityTests.java b/java/compatibility_tests/tests/CompatibilityTests.java
new file mode 100644
index 0000000..4aaa261
--- /dev/null
+++ b/java/compatibility_tests/tests/CompatibilityTests.java
@@ -0,0 +1,56 @@
1import static org.junit.Assert.assertNotNull;
2import static org.junit.Assert.assertTrue;
3
4import org.junit.After;
5import org.junit.Before;
6import org.junit.Test;
7
8import efl.bindings.Application;
9import test.A;
10import test.Generator;
11
12
13class TestApplication extends Application {
14 @Override
15 public void run() {
16
17 }
18
19 public void builtUp() {
20 prepare();
21 System.load("/home/marcel/git/efl-bindings/build/java/compatibility_tests/libjefltcase.so");
22 }
23 public void dragDown() {
24 cleanup();
25 }
26}
27
28public class CompatibilityTests {
29 private TestApplication t;
30 @Before
31 public void BuiltUp() {
32 t = new TestApplication();
33 t.builtUp();
34 }
35 @After
36 public void DragDown() {
37 t.dragDown();
38 t = null;
39 }
40 @Test
41 public void VerifyOpaque() {
42 Generator g = new Generator();
43 A a = g.getAInstance();
44 assertTrue(g.verifyAInstance(a));
45 }
46 /*@Test
47 public void VerifyMaxBuiltins() {
48 Generator g = new Generator();
49 g.getMax();
50 }
51 @Test
52 public void VerifyMinBuiltins() {
53 Generator g = new Generator();
54 g.getMin();
55 }*/
56}
diff --git a/java/efl-bindings/input_build.xml.in b/java/efl-bindings/input_build.xml.in
new file mode 100644
index 0000000..539aa98
--- /dev/null
+++ b/java/efl-bindings/input_build.xml.in
@@ -0,0 +1,29 @@
1<project default="compile">
2 <target name="compile">
3 <mkdir dir="bin"/>
4 <javac srcdir="src" destdir="bin"/>
5 <jar jarfile="jefl.jar" basedir="bin"/>
6 </target>
7 <target name="test">
8 <property name="collector.dir" value="@TEST_DIR@"/>
9 <property name="collector.class" value="BasicTests"/>
10 <delete>
11 <fileset dir="${collector.dir}" includes="${collector.class}*.class"/>
12 </delete>
13 <javac srcdir="${collector.dir}" destdir="./" classpath="jefl.jar"/>
14 <available file="${collector.dir}/${collector.class}.class" property="hasFailingTests"/>
15 <junit haltonerror="yes" haltonfailure="yes">
16 <classpath>
17 <pathelement location="./"/>
18 <pathelement location="jefl.jar"/>
19 </classpath>
20 <batchtest todir="${collector.dir}" unless="hasFailingTests">
21 <fileset dir="${collector.dir}" includes="**/*.java" excludes="**/${collector.class}.*"/>
22 <formatter type="failure"/>
23 <formatter type="plain" usefile="false"/>
24 </batchtest>
25 <test name="BasicTests">
26 </test>
27 </junit>
28 </target>
29</project>
diff --git a/java/efl-bindings/meson.build b/java/efl-bindings/meson.build
new file mode 100644
index 0000000..2b48fde
--- /dev/null
+++ b/java/efl-bindings/meson.build
@@ -0,0 +1,37 @@
1
2java_generated = custom_target('java-generated',
3 command: [java_generator, '-g', '@OUTDIR@', '-s', meson.current_source_dir(), '-b', meson.current_build_dir(), '-d', '@DEPFILE@'],
4 depfile : 'depfile.d',
5 output : ['jefl-jni-glue.c', 'build.xml'],
6)
7
8jefl_so = library('jefl',
9 [java_generated],
10 c_args: '-lm',
11 include_directories: java_include_dir,
12 dependencies : [efl_ui, jni_bindings],
13 install: true
14)
15
16ant = find_program('ant')
17
18build_jar_with_ant = custom_target('ant_build',
19 build_by_default : true,
20 input: java_generated,
21 command: [ant, '-buildfile', '@OUTDIR@/build.xml'],
22 output: 'jefl.jar'
23)
24
25test('ant-test', ant,
26 args: ['-buildfile', join_paths(meson.current_build_dir(), 'build.xml'), 'test'],
27)
28
29build_xml_conf = configuration_data()
30
31build_xml_conf.set('TEST_DIR', join_paths(meson.current_source_dir(), 'tests'))
32
33configure_file(
34 input: 'input_build.xml.in',
35 output: 'input_build.xml',
36 configuration: build_xml_conf,
37)
diff --git a/java/test-cases/BasicTests.java b/java/efl-bindings/tests/BasicTests.java
index 13f82af..708d7cd 100644
--- a/java/test-cases/BasicTests.java
+++ b/java/efl-bindings/tests/BasicTests.java
@@ -79,7 +79,7 @@ public class BasicTests {
79 public void eventEmitted(EventHandler<Void, Object> eventHandler) { 79 public void eventEmitted(EventHandler<Void, Object> eventHandler) {
80 fired = true; 80 fired = true;
81 } 81 }
82 82
83 } 83 }
84 @Test 84 @Test
85 public void EventTest() { 85 public void EventTest() {
diff --git a/java/generator.h b/java/generator.h
index a6e9478..f1c339f 100644
--- a/java/generator.h
+++ b/java/generator.h
@@ -5,6 +5,8 @@
5 5
6extern const char *goal_directory; 6extern const char *goal_directory;
7extern const char *dep_file; 7extern const char *dep_file;
8extern const char *source_dir;
9extern const char *build_dir;
8 10
9const char* _sanitize_function(const char *name, Eina_Bool first_beeing_capital); 11const char* _sanitize_function(const char *name, Eina_Bool first_beeing_capital);
10const char * _sanitize_type(const char *name); 12const char * _sanitize_type(const char *name);
diff --git a/java/generator_build.c b/java/generator_build.c
index 8c45b94..394dd2a 100644
--- a/java/generator_build.c
+++ b/java/generator_build.c
@@ -8,56 +8,38 @@
8#include <libgen.h> 8#include <libgen.h>
9 9
10#include "generator.h" 10#include "generator.h"
11#define FILE \
12"<project default=\"compile\"> \n\
13 <target name=\"compile\"> \n\
14 <mkdir dir=\"bin\"/> \n\
15 <javac srcdir=\"src\" destdir=\"bin\"/> \n\
16 <jar jarfile=\"jefl.jar\" basedir=\"bin\"/> \n\
17 </target> \n\
18 <target name=\"test\"> \n\
19 <property name=\"collector.dir\" value=\"@SOURCE_DIR@\"/> \n\
20 <property name=\"collector.class\" value=\"BasicTests\"/> \n\
21 <delete> \n\
22 <fileset dir=\"${collector.dir}\" includes=\"${collector.class}*.class\"/> \n\
23 </delete> \n\
24 <javac srcdir=\"${collector.dir}\" destdir=\"./\" classpath=\"jefl.jar\"/> \n\
25 <available file=\"${collector.dir}/${collector.class}.class\" property=\"hasFailingTests\"/> \n\
26 <junit haltonerror=\"yes\" haltonfailure=\"yes\"> \n\
27 <classpath> \n\
28 <pathelement location=\"./\"/> \n\
29 <pathelement location=\"jefl.jar\"/> \n\
30 </classpath> \
31 <batchtest todir=\"${collector.dir}\" unless=\"hasFailingTests\"> \n\
32 <fileset dir=\"${collector.dir}\" includes=\"**/*.java\" excludes=\"**/${collector.class}.*\"/> \n\
33 <formatter type=\"failure\"/> \n\
34 <formatter type=\"plain\" usefile=\"false\"/> \n\
35 </batchtest> \
36 <test name=\"BasicTests\"> \n\
37 </test> \n\
38 </junit> \n\
39 </target> \n\
40</project>"
41 11
42 12static char*
43void 13_select_build_xml(void)
44generate_build(void)
45{ 14{
46 Eina_Strbuf *build_file; 15 Eina_Strbuf *path;
47 Eina_Strbuf *c_file;
48 16
49 build_file = eina_strbuf_new(); 17 path = eina_strbuf_new();
50 18
51 eina_strbuf_append(build_file, FILE); 19 eina_strbuf_append_printf(path, "%s/input_build.xml", build_dir);
52 eina_strbuf_replace_all(build_file, "@SOURCE_DIR@", "../../java/test-cases/"); 20 if (!access(eina_strbuf_string_get(path), R_OK))
53 21 return eina_strbuf_release(path);
54 c_file = eina_strbuf_new(); 22 eina_strbuf_append_printf(path, "%s/input_build.xml", source_dir);
55 eina_strbuf_append_printf(c_file, "%s/build.xml", goal_directory); 23 if (!access(eina_strbuf_string_get(path), R_OK))
56 dep_goal_append(eina_strbuf_string_get(c_file)); 24 return eina_strbuf_release(path);
57 int fd = open(eina_strbuf_release(c_file), O_CREAT | O_TRUNC | O_RDWR, 0700);
58 write(fd, eina_strbuf_string_get(build_file), eina_strbuf_length_get(build_file));
59 close(fd);
60 25
61 eina_strbuf_free(build_file); 26 printf("FAILED TO FIND ANY build.xml\n");
27 abort();
28}
62 29
30void
31generate_build(void)
32{
33 Eina_Strbuf *build_xml_path;
34 char *build_xml = _select_build_xml();
35 Eina_File *f = eina_file_open(build_xml, EINA_FALSE);
36 void *content = eina_file_map_all(f, EINA_FILE_POPULATE);
37
38 build_xml_path = eina_strbuf_new();
39 eina_strbuf_append_printf(build_xml_path, "%s/build.xml", goal_directory);
40 dep_goal_append(eina_strbuf_string_get(build_xml_path));
41 int fd = open(eina_strbuf_release(build_xml_path), O_CREAT | O_TRUNC | O_RDWR, 0700);
42 write(fd, content, strlen(content));
43 close(fd);
44 eina_file_close(f);
63} 45}
diff --git a/java/generator_java.c b/java/generator_java.c
index 5f2795f..6869dc7 100644
--- a/java/generator_java.c
+++ b/java/generator_java.c
@@ -8,13 +8,16 @@
8#include <ctype.h> 8#include <ctype.h>
9#include <math.h> 9#include <math.h>
10#include "generator.h" 10#include "generator.h"
11#include "config.h"
11 12
12static const Eolian_Function *_efl_object_parent_set; 13static const Eolian_Function *_efl_object_parent_set;
13const char *goal_directory, *source_dir, *bin_dir, *dep_file; 14const char *goal_directory, *source_dir, *build_dir, *dep_file;
15static Eina_Bool test_mode = EINA_FALSE;
14 16
15Eina_Bool 17Eina_Bool
16_blacklists(const char *name) 18_blacklists(const char *name)
17{ 19{
20 if (test_mode) return EINA_FALSE;
18 if (eina_str_has_prefix(name, "Efl.")) 21 if (eina_str_has_prefix(name, "Efl."))
19 { 22 {
20 return EINA_FALSE; 23 return EINA_FALSE;
@@ -382,7 +385,10 @@ _add_java_type_expressive(const Eolian_Type *type, Eina_Bool class_types)
382 else if ((ttype == EOLIAN_TYPE_VOID) || 385 else if ((ttype == EOLIAN_TYPE_VOID) ||
383 (ttype == EOLIAN_TYPE_UNKNOWN_TYPE)) 386 (ttype == EOLIAN_TYPE_UNKNOWN_TYPE))
384 { 387 {
385 return "void "; 388 if (class_types)
389 return "Void ";
390 else
391 return "void ";
386 } 392 }
387 else if (ttype == EOLIAN_TYPE_REGULAR) 393 else if (ttype == EOLIAN_TYPE_REGULAR)
388 { 394 {
@@ -428,6 +434,7 @@ _add_java_type_expressive(const Eolian_Type *type, Eina_Bool class_types)
428 MAP(EOLIAN_TYPE_BUILTIN_BOOL, "boolean", "Boolean") 434 MAP(EOLIAN_TYPE_BUILTIN_BOOL, "boolean", "Boolean")
429 MAP(EOLIAN_TYPE_BUILTIN_VOID, "void", "Void") 435 MAP(EOLIAN_TYPE_BUILTIN_VOID, "void", "Void")
430 MAP(EOLIAN_TYPE_BUILTIN_VOID_PTR, "long", "Long") 436 MAP(EOLIAN_TYPE_BUILTIN_VOID_PTR, "long", "Long")
437 MAP(EOLIAN_TYPE_BUILTIN_TIME, "long", "Long")
431#undef MAP 438#undef MAP
432#define MAP(t, string) \ 439#define MAP(t, string) \
433 if (btype == t) \ 440 if (btype == t) \
@@ -442,12 +449,10 @@ _add_java_type_expressive(const Eolian_Type *type, Eina_Bool class_types)
442 MAP(EOLIAN_TYPE_BUILTIN_STRINGSHARE, "String") 449 MAP(EOLIAN_TYPE_BUILTIN_STRINGSHARE, "String")
443 MAP(EOLIAN_TYPE_BUILTIN_SLICE, "efl.bindings.Slice") 450 MAP(EOLIAN_TYPE_BUILTIN_SLICE, "efl.bindings.Slice")
444 MAP(EOLIAN_TYPE_BUILTIN_RW_SLICE, "efl.bindings.RwSlice") 451 MAP(EOLIAN_TYPE_BUILTIN_RW_SLICE, "efl.bindings.RwSlice")
445 MAP(EOLIAN_TYPE_BUILTIN_FUTURE, "efl.bindings.Future")
446 MAP(EOLIAN_TYPE_BUILTIN_BINBUF, "efl.bindings.Binbuf") 452 MAP(EOLIAN_TYPE_BUILTIN_BINBUF, "efl.bindings.Binbuf")
447 MAP(EOLIAN_TYPE_BUILTIN_EVENT, "int") //FIXME 453 MAP(EOLIAN_TYPE_BUILTIN_EVENT, "Long") //FIXME
448 MAP(EOLIAN_TYPE_BUILTIN_STRBUF, "efl.bindings.Strbuf") 454 MAP(EOLIAN_TYPE_BUILTIN_STRBUF, "efl.bindings.Strbuf")
449 MAP(EOLIAN_TYPE_BUILTIN_HASH, "efl.bindings.Hash") 455 MAP(EOLIAN_TYPE_BUILTIN_HASH, "efl.bindings.Hash")
450 MAP(EOLIAN_TYPE_BUILTIN_TIME, "long")
451 MAP(EOLIAN_TYPE_BUILTIN_ANY_VALUE, "efl.bindings.Value") 456 MAP(EOLIAN_TYPE_BUILTIN_ANY_VALUE, "efl.bindings.Value")
452 MAP(EOLIAN_TYPE_BUILTIN_ANY_VALUE_REF, "efl.bindings.ValueReference") 457 MAP(EOLIAN_TYPE_BUILTIN_ANY_VALUE_REF, "efl.bindings.ValueReference")
453#undef MAP 458#undef MAP
@@ -464,6 +469,7 @@ _add_java_type_expressive(const Eolian_Type *type, Eina_Bool class_types)
464 eina_strbuf_free(buf); \ 469 eina_strbuf_free(buf); \
465 return res; \ 470 return res; \
466 } 471 }
472 MAP(EOLIAN_TYPE_BUILTIN_FUTURE, "efl.bindings.EflFuture")
467 MAP(EOLIAN_TYPE_BUILTIN_ITERATOR, "efl.bindings.EflIterator") 473 MAP(EOLIAN_TYPE_BUILTIN_ITERATOR, "efl.bindings.EflIterator")
468 MAP(EOLIAN_TYPE_BUILTIN_LIST, "efl.bindings.EflList") 474 MAP(EOLIAN_TYPE_BUILTIN_LIST, "efl.bindings.EflList")
469 MAP(EOLIAN_TYPE_BUILTIN_ACCESSOR, "efl.bindings.EflAccessor") 475 MAP(EOLIAN_TYPE_BUILTIN_ACCESSOR, "efl.bindings.EflAccessor")
@@ -1550,16 +1556,8 @@ _output_directires_for_dir(Eolian_State *state, const char *dir)
1550static void 1556static void
1551_compile_all_util_classes(Eolian_State *state) 1557_compile_all_util_classes(Eolian_State *state)
1552{ 1558{
1553 Eina_Strbuf *path = eina_strbuf_new(); 1559 _output_directires_for_dir(state, SOURCE_INCLUDE_PATH);
1554 1560 _output_directires_for_dir(state, BIN_INCLUDE_PATH);
1555 eina_strbuf_append_printf(path, "%s/java-files", source_dir);
1556 _output_directires_for_dir(state, eina_strbuf_string_get(path));
1557
1558 eina_strbuf_reset(path);
1559 eina_strbuf_append_printf(path, "%s/java-files", bin_dir);
1560 _output_directires_for_dir(state, eina_strbuf_string_get(path));
1561
1562 eina_strbuf_free(path);
1563} 1561}
1564 1562
1565static void 1563static void
@@ -1612,22 +1610,69 @@ int main(int argc, char const *argv[])
1612 Eolian_State *state; 1610 Eolian_State *state;
1613 eolian_init(); 1611 eolian_init();
1614 1612
1615 if (argc != 5) 1613 for (int i = 1; i < argc; ++i)
1616 { 1614 {
1617 printf("Error, this needs to have exactly 4 argument! goal_directory source_dir bin_dir dep_file\n"); 1615 if (eina_streq(argv[i], "-g"))
1618 exit(-1); 1616 {
1617 i++;
1618 goal_directory = argv[i];
1619 }
1620 else if (eina_streq(argv[i], "-s"))
1621 {
1622 i++;
1623 source_dir = argv[i];
1624 }
1625 else if (eina_streq(argv[i], "-b"))
1626 {
1627 i++;
1628 build_dir = argv[i];
1629 }
1630 else if (eina_streq(argv[i], "-d"))
1631 {
1632 i++;
1633 dep_file = argv[i];
1634
1635 }
1636 else if (eina_streq(argv[i], "--test-mode"))
1637 {
1638 test_mode = EINA_TRUE;
1639 }
1640 else
1641 {
1642 printf("Not understood argument! %s\n", argv[i]);
1643 exit(-1);
1644 }
1645 }
1646 if (test_mode)
1647 {
1648
1649 }
1650 else
1651 {
1652 if (!goal_directory || !source_dir || !build_dir || !dep_file)
1653 {
1654 printf("Argument missing!\n");
1655 exit(0);
1656 }
1619 } 1657 }
1620 goal_directory = argv[1];
1621 source_dir = argv[2];
1622 bin_dir = argv[3];
1623 dep_file = argv[4];
1624 1658
1625 free_stack = eina_array_new(100); 1659 free_stack = eina_array_new(100);
1626 1660
1627 state = eolian_state_new(); 1661 state = eolian_state_new();
1628 eolian_state_system_directory_add(state); 1662
1629 eolian_state_all_eot_files_parse(state); 1663 if (test_mode)
1630 eolian_state_all_eo_files_parse(state); 1664 {
1665 eolian_state_directory_add(state, EO_INCLUDE_DIRECTORY);
1666 eolian_state_directory_add(state, TEST_PATH);
1667 eolian_state_all_eot_files_parse(state);
1668 eolian_state_all_eo_files_parse(state);
1669 }
1670 else
1671 {
1672 eolian_state_system_directory_add(state);
1673 eolian_state_all_eot_files_parse(state);
1674 eolian_state_all_eo_files_parse(state);
1675 }
1631 1676
1632 eolian_state_check(state); 1677 eolian_state_check(state);
1633 1678
diff --git a/java/generator_jni.c b/java/generator_jni.c
index a452388..7750a3d 100644
--- a/java/generator_jni.c
+++ b/java/generator_jni.c
@@ -303,7 +303,7 @@ _get_jni_field_receiver(const Eolian_Type *type)
303 MAP(EOLIAN_TYPE_BUILTIN_UINT64, "UINT64") 303 MAP(EOLIAN_TYPE_BUILTIN_UINT64, "UINT64")
304 MAP(EOLIAN_TYPE_BUILTIN_INT128, "INT128") 304 MAP(EOLIAN_TYPE_BUILTIN_INT128, "INT128")
305 MAP(EOLIAN_TYPE_BUILTIN_UINT128, "UINT128") 305 MAP(EOLIAN_TYPE_BUILTIN_UINT128, "UINT128")
306 MAP(EOLIAN_TYPE_BUILTIN_MSTRING, "STRING"); 306 MAP(EOLIAN_TYPE_BUILTIN_MSTRING, "MSTRING");
307 MAP(EOLIAN_TYPE_BUILTIN_STRING, "STRING") 307 MAP(EOLIAN_TYPE_BUILTIN_STRING, "STRING")
308 MAP(EOLIAN_TYPE_BUILTIN_STRINGSHARE, "STRING") 308 MAP(EOLIAN_TYPE_BUILTIN_STRINGSHARE, "STRING")
309 MAP(EOLIAN_TYPE_BUILTIN_SLICE, "SLICE") 309 MAP(EOLIAN_TYPE_BUILTIN_SLICE, "SLICE")
@@ -1367,10 +1367,19 @@ _compile_all_enum_jni_glue(Eolian_State *state, Eina_Strbuf *jni_glue)
1367static void 1367static void
1368_compile_all_includes(Eolian_State *state, Eina_Strbuf *jni_glue) 1368_compile_all_includes(Eolian_State *state, Eina_Strbuf *jni_glue)
1369{ 1369{
1370 Eina_Iterator *iter = eolian_state_eo_file_paths_get(state); 1370 Eina_Iterator *iter;
1371 Eina_Strbuf *includes = eina_strbuf_new(); 1371 Eina_Strbuf *includes = eina_strbuf_new();
1372 char *path; 1372 char *path;
1373 1373
1374 iter = eolian_state_eot_file_paths_get(state);
1375 EINA_ITERATOR_FOREACH(iter, path)
1376 {
1377 dep_file_append(path);
1378 eina_strbuf_append_printf(includes, "#include <%s.h>\n", basename(path));
1379 }
1380 eina_iterator_free(iter);
1381
1382 iter = eolian_state_eo_file_paths_get(state);
1374 EINA_ITERATOR_FOREACH(iter, path) 1383 EINA_ITERATOR_FOREACH(iter, path)
1375 { 1384 {
1376 dep_file_append(path); 1385 dep_file_append(path);
@@ -1384,15 +1393,9 @@ _compile_all_includes(Eolian_State *state, Eina_Strbuf *jni_glue)
1384 } 1393 }
1385 eina_iterator_free(iter); 1394 eina_iterator_free(iter);
1386 1395
1387 iter = eolian_state_eot_file_paths_get(state);
1388 EINA_ITERATOR_FOREACH(iter, path)
1389 {
1390 dep_file_append(path);
1391 eina_strbuf_append_printf(includes, "#include <%s.h>\n", basename(path));
1392 }
1393 eina_strbuf_append(jni_glue, "#include <jni-bindings.h>\n\n"); 1396 eina_strbuf_append(jni_glue, "#include <jni-bindings.h>\n\n");
1394 eina_strbuf_append_buffer(jni_glue, includes); 1397 eina_strbuf_append_buffer(jni_glue, includes);
1395 eina_iterator_free(iter); 1398
1396} 1399}
1397 1400
1398void 1401void
diff --git a/java/jni-bindings-struct-fetch.h b/java/jni-bindings-struct-fetch.h
index f58510a..25c11fa 100644
--- a/java/jni-bindings-struct-fetch.h
+++ b/java/jni-bindings-struct-fetch.h
@@ -19,6 +19,10 @@
19 GOAL = (*env)->GetLongField(env, jobj, fid); 19 GOAL = (*env)->GetLongField(env, jobj, fid);
20#define STRUCT_FETCH_ULONG(env, jobj, fid, GOAL) \ 20#define STRUCT_FETCH_ULONG(env, jobj, fid, GOAL) \
21 GOAL = (*env)->GetLongField(env, jobj, fid); 21 GOAL = (*env)->GetLongField(env, jobj, fid);
22#define STRUCT_FETCH_LLONG(env, jobj, fid, GOAL) \
23 GOAL = (*env)->GetLongField(env, jobj, fid);
24#define STRUCT_FETCH_ULLONG(env, jobj, fid, GOAL) \
25 GOAL = (*env)->GetLongField(env, jobj, fid);
22#define STRUCT_FETCH_INT8(env, jobj, fid, GOAL) \ 26#define STRUCT_FETCH_INT8(env, jobj, fid, GOAL) \
23 GOAL = (*env)->GetByteField(env, jobj, fid); 27 GOAL = (*env)->GetByteField(env, jobj, fid);
24#define STRUCT_FETCH_UINT8(env, jobj, fid, GOAL) \ 28#define STRUCT_FETCH_UINT8(env, jobj, fid, GOAL) \
@@ -34,11 +38,11 @@
34#define STRUCT_FETCH_INT64(env, jobj, fid, GOAL) \ 38#define STRUCT_FETCH_INT64(env, jobj, fid, GOAL) \
35 GOAL = (*env)->GetLongField(env, jobj, fid); 39 GOAL = (*env)->GetLongField(env, jobj, fid);
36#define STRUCT_FETCH_UINT64(env, jobj, fid, GOAL) \ 40#define STRUCT_FETCH_UINT64(env, jobj, fid, GOAL) \
37 _long_from_big_int(env, (*env)->GetObjectField(env, jobj, fid), sizeof(uint64_t), EINA_FALSE, &GOAL); 41 GOAL = _long_from_big_int(env, (*env)->GetObjectField(env, jobj, fid), sizeof(uint64_t), EINA_FALSE);
38#define STRUCT_FETCH_INT128(env, jobj, fid, GOAL) \ 42#define STRUCT_FETCH_INT128(env, jobj, fid, GOAL) \
39 _long_from_big_int(env, (*env)->GetObjectField(env, jobj, fid), sizeof(int128_t), EINA_TRUE, &GOAL); 43 GOAL = _long_from_big_int(env, (*env)->GetObjectField(env, jobj, fid), sizeof(int128_t), EINA_TRUE);
40#define STRUCT_FETCH_UINT128(env, jobj, fid, GOAL) \ 44#define STRUCT_FETCH_UINT128(env, jobj, fid, GOAL) \
41 _long_from_big_int(env, (*env)->GetObjectField(env, jobj, fid), sizeof(uint128_t), EINA_FALSE, &GOAL); 45 GOAL = _long_from_big_int(env, (*env)->GetObjectField(env, jobj, fid), sizeof(uint128_t), EINA_FALSE);
42 46
43#define STRUCT_FETCH_FLOAT(env, jobj, fid, GOAL) \ 47#define STRUCT_FETCH_FLOAT(env, jobj, fid, GOAL) \
44 GOAL = (*env)->GetFloatField(env, jobj, fid); 48 GOAL = (*env)->GetFloatField(env, jobj, fid);
@@ -55,9 +59,9 @@
55 GOAL = (*env)->GetStringUTFChars(env, (jstring) (*env)->GetObjectField(env, jobj, fid), 1); 59 GOAL = (*env)->GetStringUTFChars(env, (jstring) (*env)->GetObjectField(env, jobj, fid), 1);
56 60
57#define STRUCT_FETCH_SLICE(env, jobj, fid, GOAL) \ 61#define STRUCT_FETCH_SLICE(env, jobj, fid, GOAL) \
58 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid)); 62 GOAL = _eina_slice_from_jobject(env, (*env)->GetObjectField(env, jobj, fid));
59#define STRUCT_FETCH_RW_SLICE(env, jobj, fid, GOAL) \ 63#define STRUCT_FETCH_RW_SLICE(env, jobj, fid, GOAL) \
60 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid)); 64 GOAL = _eina_rw_slice_from_jobject(env, (*env)->GetObjectField(env, jobj, fid));
61 65
62#define STRUCT_FETCH_ACCESSOR(env, jobj, fid, GOAL) \ 66#define STRUCT_FETCH_ACCESSOR(env, jobj, fid, GOAL) \
63 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid)); 67 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid));
@@ -66,7 +70,7 @@
66 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid)); 70 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid));
67 71
68#define STRUCT_FETCH_VALUE(env, jobj, fid, GOAL) \ 72#define STRUCT_FETCH_VALUE(env, jobj, fid, GOAL) \
69 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid)); 73 GOAL = _eina_value_from_jobject(env, (*env)->GetObjectField(env, jobj, fid));
70 74
71#define STRUCT_FETCH_VALUE_REFERENCE(env, jobj, fid, GOAL) \ 75#define STRUCT_FETCH_VALUE_REFERENCE(env, jobj, fid, GOAL) \
72 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid)); 76 GOAL = _fetch_opaque_struct_from_jobject(env, (*env)->GetObjectField(env, jobj, fid));
diff --git a/java/jni-bindings.c b/java/jni-bindings.c
index b57e61c..ca4d517 100644
--- a/java/jni-bindings.c
+++ b/java/jni-bindings.c
@@ -324,3 +324,39 @@ _big_int_from_long(JNIEnv *env, unsigned long long int from, size_t size, Eina_B
324 jmethodID constructor = (*env)->GetMethodID(env, klass, "<init>", "(I[B)V"); 324 jmethodID constructor = (*env)->GetMethodID(env, klass, "<init>", "(I[B)V");
325 return (*env)->NewObject(env, klass, constructor, (jint) signedness, byte_representation); 325 return (*env)->NewObject(env, klass, constructor, (jint) signedness, byte_representation);
326} 326}
327
328Eina_Value
329_eina_value_from_jobject(JNIEnv *env, jobject jobj)
330{
331 //FIXME
332}
333
334jobject
335_jobject_from_eina_value(JNIEnv *env, Eina_Value value)
336{
337 //FIXME
338}
339
340Eina_Slice
341_eina_slice_from_jobject(JNIEnv *env, jobject jobj)
342{
343 //FIXME
344}
345
346jobject
347_jobject_from_eina_slice(JNIEnv *env, Eina_Slice eina_slice)
348{
349 //FIXME
350}
351
352Eina_Rw_Slice
353_eina_rw_slice_from_jobject(JNIEnv *env, jobject jobj)
354{
355 //FIXME
356}
357
358jobject
359_jobject_from_eina_rw_slice(JNIEnv *env, Eina_Rw_Slice eina_slice)
360{
361 //FIXME
362}
diff --git a/java/jni-bindings.h b/java/jni-bindings.h
index 4f327a7..fa55a09 100644
--- a/java/jni-bindings.h
+++ b/java/jni-bindings.h
@@ -41,6 +41,17 @@ jobject _create_builtin_type_addr_stack(JNIEnv *env, const char *class_name, con
41unsigned long long _long_from_big_int(JNIEnv *env, jobject bigint, size_t size, Eina_Bool signedness); 41unsigned long long _long_from_big_int(JNIEnv *env, jobject bigint, size_t size, Eina_Bool signedness);
42jobject _big_int_from_long(JNIEnv *env, unsigned long long from, size_t size, Eina_Bool signedness); 42jobject _big_int_from_long(JNIEnv *env, unsigned long long from, size_t size, Eina_Bool signedness);
43 43
44//used for eina_value
45Eina_Value _eina_value_from_jobject(JNIEnv *env, jobject jobj);
46jobject _jobject_from_eina_value(JNIEnv *env, Eina_Value value);
47
48//used for eina_slice
49Eina_Slice _eina_slice_from_jobject(JNIEnv *env, jobject jobj);
50jobject _jobject_from_eina_slice(JNIEnv *env, Eina_Slice eina_slice);
51
52//used for eina_slice rw
53Eina_Rw_Slice _eina_rw_slice_from_jobject(JNIEnv *env, jobject jobj);
54jobject _jobject_from_eina_rw_slice(JNIEnv *env, Eina_Rw_Slice eina_slice);
44#include "jni-bindings-struct-fetch.h" 55#include "jni-bindings-struct-fetch.h"
45#include "jni-bindings-jni-to-native.h" 56#include "jni-bindings-jni-to-native.h"
46#include "jni-bindings-native-to-jni.h" 57#include "jni-bindings-native-to-jni.h"
diff --git a/java/java-files/Application.java b/java/manual-bindings/Application.java
index 56af19d..2e8fec1 100644
--- a/java/java-files/Application.java
+++ b/java/manual-bindings/Application.java
@@ -24,7 +24,6 @@ public abstract class Application {
24 } 24 }
25 25
26 public void launch() { 26 public void launch() {
27
28 run(); 27 run();
29 efl.App.getAppMain().begin(); 28 efl.App.getAppMain().begin();
30 } 29 }
diff --git a/java/java-files/ApplicationConfig.java.in b/java/manual-bindings/ApplicationConfig.java.in
index 61579ea..61579ea 100644
--- a/java/java-files/ApplicationConfig.java.in
+++ b/java/manual-bindings/ApplicationConfig.java.in
diff --git a/java/java-files/Binbuf.java b/java/manual-bindings/Binbuf.java
index 07d0477..07d0477 100644
--- a/java/java-files/Binbuf.java
+++ b/java/manual-bindings/Binbuf.java
diff --git a/java/java-files/EflAccessor.java b/java/manual-bindings/EflAccessor.java
index 7ae7c32..7ae7c32 100644
--- a/java/java-files/EflAccessor.java
+++ b/java/manual-bindings/EflAccessor.java
diff --git a/java/java-files/EflArray.java b/java/manual-bindings/EflArray.java
index 9d7b458..9d7b458 100644
--- a/java/java-files/EflArray.java
+++ b/java/manual-bindings/EflArray.java
diff --git a/java/java-files/EflFuture.java b/java/manual-bindings/EflFuture.java
index 193e76e..193e76e 100644
--- a/java/java-files/EflFuture.java
+++ b/java/manual-bindings/EflFuture.java
diff --git a/java/java-files/EflHash.java b/java/manual-bindings/EflHash.java
index 63c1c26..63c1c26 100644
--- a/java/java-files/EflHash.java
+++ b/java/manual-bindings/EflHash.java
diff --git a/java/java-files/EflIterator.java b/java/manual-bindings/EflIterator.java
index e79a0f1..e79a0f1 100644
--- a/java/java-files/EflIterator.java
+++ b/java/manual-bindings/EflIterator.java
diff --git a/java/java-files/EflList.java b/java/manual-bindings/EflList.java
index 83b3dd4..83b3dd4 100644
--- a/java/java-files/EflList.java
+++ b/java/manual-bindings/EflList.java
diff --git a/java/java-files/Event.java b/java/manual-bindings/Event.java
index 976e53e..976e53e 100644
--- a/java/java-files/Event.java
+++ b/java/manual-bindings/Event.java
diff --git a/java/java-files/EventHandler.java b/java/manual-bindings/EventHandler.java
index 8bbf3ef..8bbf3ef 100644
--- a/java/java-files/EventHandler.java
+++ b/java/manual-bindings/EventHandler.java
diff --git a/java/java-files/EventListener.java b/java/manual-bindings/EventListener.java
index b9ae59a..b9ae59a 100644
--- a/java/java-files/EventListener.java
+++ b/java/manual-bindings/EventListener.java
diff --git a/java/java-files/NativeCaller.java b/java/manual-bindings/NativeCaller.java
index c78b03b..c78b03b 100644
--- a/java/java-files/NativeCaller.java
+++ b/java/manual-bindings/NativeCaller.java
diff --git a/java/java-files/NativeObjectCaller.java b/java/manual-bindings/NativeObjectCaller.java
index 7017d23..7017d23 100644
--- a/java/java-files/NativeObjectCaller.java
+++ b/java/manual-bindings/NativeObjectCaller.java
diff --git a/java/java-files/ReturnType.java b/java/manual-bindings/ReturnType.java
index 7ea3f7d..7ea3f7d 100644
--- a/java/java-files/ReturnType.java
+++ b/java/manual-bindings/ReturnType.java
diff --git a/java/java-files/RwSlice.java b/java/manual-bindings/RwSlice.java
index 8faad6f..8faad6f 100644
--- a/java/java-files/RwSlice.java
+++ b/java/manual-bindings/RwSlice.java
diff --git a/java/java-files/Slice.java b/java/manual-bindings/Slice.java
index 47b85b9..47b85b9 100644
--- a/java/java-files/Slice.java
+++ b/java/manual-bindings/Slice.java
diff --git a/java/java-files/Strbuf.java b/java/manual-bindings/Strbuf.java
index 8ffa950..8ffa950 100644
--- a/java/java-files/Strbuf.java
+++ b/java/manual-bindings/Strbuf.java
diff --git a/java/java-files/Value.java b/java/manual-bindings/Value.java
index 4e512d0..4e512d0 100644
--- a/java/java-files/Value.java
+++ b/java/manual-bindings/Value.java
diff --git a/java/java-files/ValueReference.java b/java/manual-bindings/ValueReference.java
index 768fdf6..768fdf6 100644
--- a/java/java-files/ValueReference.java
+++ b/java/manual-bindings/ValueReference.java
diff --git a/java/java-files/meson.build b/java/manual-bindings/meson.build
index 70148f9..70148f9 100644
--- a/java/java-files/meson.build
+++ b/java/manual-bindings/meson.build
diff --git a/java/meson.build b/java/meson.build
index fd61a33..b3d3cbd 100644
--- a/java/meson.build
+++ b/java/meson.build
@@ -1,4 +1,5 @@
1conf = configuration_data() 1conf = configuration_data()
2generator_config = configuration_data()
2 3
3java_include_dir = include_directories('/usr/lib/jvm/java-13-openjdk/include/', '/usr/lib/jvm/java-13-openjdk/include/linux/') 4java_include_dir = include_directories('/usr/lib/jvm/java-13-openjdk/include/', '/usr/lib/jvm/java-13-openjdk/include/linux/')
4 5
@@ -7,32 +8,25 @@ java_generator = executable('java-generator',
7 dependencies : [eolian, cc.find_library('m')], 8 dependencies : [eolian, cc.find_library('m')],
8) 9)
9 10
10java_generated = custom_target('java-generated', 11jni_bindings = declare_dependency(
11 command: [java_generator, '@OUTDIR@', meson.current_source_dir(), meson.current_build_dir(), '@DEPFILE@'], 12 include_directories: include_directories('.'),
12 depfile : 'depfile.d', 13 sources: 'jni-bindings.c',
13 output : ['jefl-jni-glue.c', 'build.xml'],
14) 14)
15 15
16jefl_so = library('jefl', 16subdir('efl-bindings')
17 ['jni-bindings.c', java_generated], 17
18 c_args: '-lm',
19 include_directories: java_include_dir,
20 dependencies : [dependency('efl-ui')],
21 install: true
22)
23conf.set_quoted('JEFL_FULL_PATH', join_paths(get_option('prefix'), get_option('libdir'), 'libjefl.so')) 18conf.set_quoted('JEFL_FULL_PATH', join_paths(get_option('prefix'), get_option('libdir'), 'libjefl.so'))
24conf.set_quoted('JEFL_TREE_PATH', jefl_so.full_path()) 19conf.set_quoted('JEFL_TREE_PATH', jefl_so.full_path())
25 20
26ant = find_program('ant') 21generator_config.set_quoted('SOURCE_INCLUDE_PATH', join_paths(meson.current_source_dir(), 'manual-bindings'))
22generator_config.set_quoted('BIN_INCLUDE_PATH', join_paths(meson.current_build_dir(), 'manual-bindings'))
23generator_config.set_quoted('TEST_PATH', join_paths(meson.source_root(), 'general-test'))
24generator_config.set_quoted('EO_INCLUDE_DIRECTORY', join_paths(eolian.get_variable(pkgconfig : 'prefix'), 'share', 'eolian', 'include', 'eo-1'))
27 25
28build_jar_with_ant = custom_target('ant_build', 26subdir('manual-bindings')
29 build_by_default : true, 27subdir('compatibility_tests')
30 input: java_generated,
31 command: [ant, '-buildfile', '@OUTDIR@/build.xml'],
32 output: 'jefl.jar'
33)
34subdir('java-files')
35 28
36test('ant-test', ant, 29configure_file(
37 args: ['-buildfile', join_paths(meson.current_build_dir(), 'build.xml'), 'test'], 30 output: 'config.h',
31 configuration: generator_config,
38) 32)
diff --git a/meson.build b/meson.build
index 1bff221..0bf20a5 100644
--- a/meson.build
+++ b/meson.build
@@ -4,7 +4,10 @@ project('efl-bindings',
4) 4)
5 5
6eolian = dependency('eolian') 6eolian = dependency('eolian')
7 7eolian_gen = [find_program('eolian_gen')]
8efl_ui = dependency('efl-ui')
8cc = meson.get_compiler('c') 9cc = meson.get_compiler('c')
9 10
11
12subdir('general-test')
10subdir('java') 13subdir('java')