.NET .ctor are not inherited but `init*` methods are in ObjC, we now
mark as `NS_UNAVAILABLE` the ctors that are not available.
Also this commit introduces `objcgenerator-helpers.cs` which its main
intention is to move the small ObjC related functions like
`GetSignatures` or `GetUnavailableParentCtors` to avoid
polluting too much `objcgenerator.cs` readability
* [tests][objc] Build debug tests into a subdirectory as well.
This cleans up the current directory quite a bit.
Also modify the cli/perf tests a little bit to be able to run the
debug/release versions in parallel.
* [tests][objc] Don't fail to create directory if directory already exists.
* [tests][objc-cli] Make sure libmanaged.dylib is built before xctest.
Since the corresponding xcode project builds libmanaged.dylib if it's not
already built (by executing make), we may end up with two make process trying
to build the same target simultaneously, which breaks everything.
* Better name for setter only properties, e.g.
- [query set_Secret: 1];
+ [query setSecret: 1];
* Second method argument should be lowercased, e.g. `second`
[Methods_Parameters concatFirst:@"first" second:@"second"]
* Reduce some code duplication, to avoid fixing things multiple times, e.g.
* Unify the signatures generation for ObjC and Mono;
* Unify the parameter marshaling code (the one for methods was missing a lot)
* Simplify `ImplementMethod` arguments
* [objc][generator] Use metadata token lookup when building release
where release is non-debug.
https://github.com/mono/Embeddinator-4000/issues/82
* [tests] Run test-cli and perf-cli in release (non debug) mode
It's similar to XI/XM NSObjectFlag - we need a different road to call
the base classes without calling managed code twice (e.g. the Super
and Base tests for exceptions).
Note: `init` is not always exposed, so we cannot trust it blindly.
This allow the same "internal" `initWithSuper` to be re-used to return
instance of types being bound (e.g. a `+create` without a `-init`).
* [tests] [objc-cli] Improve a few Makefile targets to have correct dependencies.
* [objc] Generate a dealloc method that handles object destruction.
* [objc] Fix a memory leak when searching for assemblies.
`mono_embeddinator_search_assembly` returns a string that must be freed, so
free it.
* [objc][tests] Add leak tests.
* [tests][objc] Try running leaks with sudo if we don't have a controlling terminal.
Otherwise this happens on Jenkins:
> leaks[33383]: [fatal] unable to ask for permission to examine process; run tool using sudo, or without redirecting stdin and stderr.
* [objc] Fix chained init methods and avoid chaining dealloc.
In an init method we must only create the managed object if a derived class
hasn't already created it.
Also we must only dealloc once in the inheritance hierarchy.
This also handle the case of setter-only properties (generated as a
set* method).
Unit tests added for existing methods (previously not generated)
Replace PR https://github.com/mono/Embeddinator-4000/pull/63
E.g. `public class SuperUnique : Unique {}`
This raise an interesting issue (to be solved later) since ObjC and .NET
semantics differs for init*/.ctor. A test case (with a FIXME) is added.
and I now recall why headers were a bad idea:
./bindings.h:75:39: error: attempting to use the forward class 'Constructors_Unique' as superclass of 'Constructors_SuperUnique'
so the ordering of forwarders had to be altered a bit.
Also remove the NSAutoreleasePool code, the current code doesn't build with
ARC, and in any case it's the consumer's responsibility to ensure there's an
NSAutoreleasePool on the stack.
Remove the 'libmanaged' target from the Xcode test project, and instead link
with the libmanaged.dylib that the embeddinator compiles. This ensures we're
not compiling with different compiler flags in the Xcode project.
This also requires adding an rpath to the built library so that the test
executable can find it.
Also add makefile target to run the Xcode test project from the command line.
This allows debugging the generated code with Xcode as well as
running the native unit tests with XCTest (which might not be the
best tool but it's good to support).
This commit requires a addition to mono_embeddinator so we can
override where the assemblies are loaded from - we cannot assume
they will be with the executable (e.g. plugin) and we hit this
case with Xcode unit tests.