Alexis Laferrière [Fri, 7 Nov 2014 01:38:04 +0000 (20:38 -0500)]
jenkins: add the nitester-wrapper script
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 7 Nov 2014 00:54:39 +0000 (19:54 -0500)]
nitester: use a hashed filename for produced xml files to avoid conflicts
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 7 Nov 2014 00:53:12 +0000 (19:53 -0500)]
nitester: fix bug where nodes worked on one more task per packet
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 7 Nov 2014 00:51:03 +0000 (19:51 -0500)]
nitester: support todo and skip exec test results
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 7 Nov 2014 00:48:49 +0000 (19:48 -0500)]
nitester: order tasks per test before engine for a better distribution
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 7 Nov 2014 00:46:45 +0000 (19:46 -0500)]
nitester: set packet size to a single test
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 5 Nov 2014 21:56:50 +0000 (16:56 -0500)]
nitester: do not use nit copy dir, it doesn't affect performance
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 7 Nov 2014 01:10:45 +0000 (20:10 -0500)]
nitester: do not use -j1 because it is not recognised by niti
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 24 Oct 2014 11:32:30 +0000 (07:32 -0400)]
nitester: keep Jenkin's xml files in a common directory
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 7 Nov 2014 00:45:28 +0000 (19:45 -0500)]
tests: reorder listfull.sh to begin with longer tests
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 24 Oct 2014 11:31:26 +0000 (07:31 -0400)]
unitrun: fix use of time command
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 6 Nov 2014 01:03:20 +0000 (20:03 -0500)]
Merge: Java FFI global compilation fix
Fixes:
* Undefined references on unused callbacks with nitg-g
* Duplicated functions on callbacks present in 2 modules
Pull-Request: #879
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 6 Nov 2014 01:02:52 +0000 (20:02 -0500)]
Merge: More manual
This improves the documentation of the other nit tools.
It could be better to read them on the http://nitlanguage.org/tools/ since this PR also enable the synchronization of the manpage on the website.
Documentation of `nit` is copied from http://nitlanguage.org/debugger/
Documentation of `nitunit` is copied from https://github.com/privat/nit/blob/master/src/testing/README
Note: a lot of options are common to the tools because they share the same frontend.
Usually, to simplify the manpages, I only indicated the options specific to the tool.
I am not fond to copy-paste each common options among all the tools, especially when the tool has only one or two original option but more than 30 *inherited* options.
Maybe creatie a `nitcli(7)` manpage that regroup common options and conventions among our tools. (à la `gitcli(7)`) ?
Pull-Request: #880
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 6 Nov 2014 01:02:17 +0000 (20:02 -0500)]
Merge: Use new constructors
Since c_src is regenerated, new-style-constructors are available in lib and tools.
Most of the job was to just to remove useless `init` and sometime adding a `noinit` or a default value to attributes.
Pull-Request: #866
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 5 Nov 2014 19:56:32 +0000 (14:56 -0500)]
nitg/ffi: fix indirect function declaration in C++ FFI
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 3 Nov 2014 07:33:13 +0000 (02:33 -0500)]
tests:update because of line changes in lib
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 3 Nov 2014 07:22:56 +0000 (02:22 -0500)]
contrib: update clients of lib
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 5 Nov 2014 19:52:53 +0000 (14:52 -0500)]
src: update most tools to new constructors
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 5 Nov 2014 16:00:52 +0000 (11:00 -0500)]
man: rewrite the documentation of the other tools
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 20:00:03 +0000 (15:00 -0500)]
man: update nitg because of #873
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 5 Nov 2014 02:21:03 +0000 (21:21 -0500)]
man: add .gitignore
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 16:00:43 +0000 (11:00 -0500)]
man: Makefile produce mdwn for ikiwiki
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 5 Nov 2014 02:17:05 +0000 (21:17 -0500)]
Merge: No auto super in new
Close #877
Pull-Request: #878
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 5 Nov 2014 00:53:21 +0000 (19:53 -0500)]
tests: update other tests related the error message on new
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Tue, 4 Nov 2014 21:45:05 +0000 (16:45 -0500)]
tests: add a test for Java FFI support in global compilation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 4 Nov 2014 21:39:31 +0000 (16:39 -0500)]
nitg/ffi: local functions in C are `static`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 4 Nov 2014 21:41:15 +0000 (16:41 -0500)]
nitg/ffi: fix Java FFI support in nitg-g
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 4 Nov 2014 20:25:26 +0000 (15:25 -0500)]
tests: update base_new to prevent #877
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 20:24:45 +0000 (15:24 -0500)]
typing: prefix instantiation error with `Type Error`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 20:23:27 +0000 (15:23 -0500)]
semantize: do not auto_super_init `new`-factories
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 20:11:20 +0000 (15:11 -0500)]
Merge: neo_doxygen: Introduce a tool to import a Doxygen model.
This tool converts the XML output generated by Doxygen to a Neo4j graph suitable for `neo.nit`.
In summary, the following is imported:
* Namespaces
* Files, generating one module for each file-namespace pair
* Classes, with inheritances
* Members, with signatures and redefinition relationships (when Doxygen provide them)
* Documentation (without formatting for the moment)
Concerning language-specific support, only some Java keywords are correctly interpreted at this point.
Note: `/contrib/neo_doxygen/gen-all.sh` and `/contrib/neo_doxygen/gen-once.sh` call `nx`, so they require PR #744.
Note2: the merge commit updates `neo.nit` to correctly merge with #872
Pull-Request: #867
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 4 Nov 2014 20:08:20 +0000 (15:08 -0500)]
Merge: Pkgconfig
Generalize the usage of pkg-config so that this command is executed by the Makefile and not the nitg compiler.
This will improve the portability of programs when the .nit_compile directory is distributed.
And thus, the initial bootstrap with `c_src`.
This is a first step toward the resolution of #864.
Pull-Request: #874
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 4 Nov 2014 20:07:42 +0000 (15:07 -0500)]
Merge: Improve tool ui
Small fixes to improve the user-interface of tools.
* nit_dir is more robust and display errors if invalid
* option --nit-dir is really needed
* remove useless and buggy --clib-path and NIT_CC_PATH
* nit does not collect options after the program file but let as options for the interpreter
* 3 -v to show class-level information, 4 -v to show property-level information
Pull-Request: #873
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 4 Nov 2014 20:07:40 +0000 (15:07 -0500)]
Merge: Manual: rewrite the man for nitg
If people like it, I may write the manpage for the other tools.
I generated the markdown to http://nitlanguage.org/tools/nitg/ so you could see the rendered result in HTML.
I plan to have pages for the tools automatically synchonized from the files in /share/man.
Pull-Request: #871
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 4 Nov 2014 20:07:17 +0000 (15:07 -0500)]
Merge: neo: Load the graph in chunks and only once.
With this fix, `neo.nit` now takes approximately 2 Gio of memory to load the graph for Apache Xerces.
Fixes #870.
Pull-Request: #872
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean-Christophe Beaupré [Tue, 4 Nov 2014 19:25:20 +0000 (14:25 -0500)]
neo_doxygen: Enhance the display of the progression.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 4 Nov 2014 19:24:14 +0000 (14:24 -0500)]
console: Add sequences for cursor moving and erasing.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Tue, 4 Nov 2014 16:39:14 +0000 (11:39 -0500)]
c_src: update the Maklefile to protect the pkg-config commands
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 16:35:32 +0000 (11:35 -0500)]
ffi/pkgconfig: use the new pkgconfig infrastructure in the Makefile
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 16:28:27 +0000 (11:28 -0500)]
abstract_compiler: check the presence of pkgconfig libraries in the Makefile
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Sat, 1 Nov 2014 04:14:45 +0000 (00:14 -0400)]
neo_doxygen: Check the project’s name.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sun, 2 Nov 2014 22:12:52 +0000 (17:12 -0500)]
neo_doxygen: Make the command user-friendly.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Thu, 30 Oct 2014 20:37:46 +0000 (16:37 -0400)]
neo_doxygen: Import type parameters
Not tested yet.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sun, 2 Nov 2014 21:32:55 +0000 (16:32 -0500)]
neo_doxygen: Import parameters.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sun, 2 Nov 2014 21:13:38 +0000 (16:13 -0500)]
neo_doxygen: Isolate language-specific code.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sun, 2 Nov 2014 21:02:58 +0000 (16:02 -0500)]
neo_doxygen: Import members’ type.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 4 Nov 2014 14:33:25 +0000 (09:33 -0500)]
neo_doxygen: List members.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sun, 2 Nov 2014 22:12:11 +0000 (17:12 -0500)]
neo_doxygen: Add types to the model.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 24 Oct 2014 15:51:03 +0000 (11:51 -0400)]
neo_doxygen: Name class’ type and definition.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 24 Oct 2014 15:47:07 +0000 (11:47 -0400)]
neo_doxygen: Avoid clearing the namespace’s id of a module.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 24 Oct 2014 18:50:23 +0000 (14:50 -0400)]
neo_doxygen: Enhance error handling in shell scripts.
Also, stop `gen-all.sh` on first error.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 24 Oct 2014 14:33:41 +0000 (10:33 -0400)]
neo_doxygen: Add shell scripts to help integration testing.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 4 Nov 2014 17:13:46 +0000 (12:13 -0500)]
neo_doxygen: Introduce a tool to import a Doxygen model.
Import the following:
* Classes
* Namespaces
* Inheritance relationships
* Documentation of classes (not formatted yet)
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 4 Nov 2014 17:09:15 +0000 (12:09 -0500)]
standard: Add tests for `Text.search_last`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 4 Nov 2014 17:12:32 +0000 (12:12 -0500)]
more_collections: Add `DefaultMap`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 4 Nov 2014 17:11:03 +0000 (12:11 -0500)]
standard: Add `Text.search_last`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Tue, 4 Nov 2014 16:27:49 +0000 (11:27 -0500)]
abstract_compiler: use `ExternFiles::pkgconfig` for boehm
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 16:25:34 +0000 (11:25 -0500)]
c_tools: add attribute `ExternFile::pkgconfigs` to stores needed libraries.
Thew will be resolved at the `make` time.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 16:13:59 +0000 (11:13 -0500)]
contrib/online_ide: update signature of `compute_nit_dir`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 13:59:13 +0000 (08:59 -0500)]
tests: update sav/test_toolcontext*
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 13:50:28 +0000 (08:50 -0500)]
toolcontext: hide some really internal options so they do not appears on --help
* --bash-completion
* --stub-man
* --set-dummy-tool
* --no-main
These options are still recognized, bash-completed and in the manpage
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 13:39:13 +0000 (08:39 -0500)]
tests: with niti put the options before the program
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 02:50:40 +0000 (21:50 -0500)]
modelize: 4 -v are needed fo method-level informations
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 02:40:50 +0000 (21:40 -0500)]
nit: use OptionContext flag options_before_rest
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 02:40:20 +0000 (21:40 -0500)]
lib/opts: add flag `options_before_rest`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 02:27:31 +0000 (21:27 -0500)]
toolcontext: re-add --nit-dir option with higer precedence
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 02:26:40 +0000 (21:26 -0500)]
toolcontext: nit_dir is non-nullable
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 02:25:21 +0000 (21:25 -0500)]
compiler: remove --clib-path and NIT_CC_PATH
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 4 Nov 2014 02:11:45 +0000 (21:11 -0500)]
toolcontext: make compute_nit_dir more robust
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 3 Nov 2014 16:21:00 +0000 (11:21 -0500)]
man: rewrite nitg.md
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Mon, 3 Nov 2014 21:35:57 +0000 (16:35 -0500)]
nitdoc: Extend the model to help the importation from Doxygen.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 3 Nov 2014 20:43:06 +0000 (15:43 -0500)]
neo: Really load the graph only once.
This cut memory consumption in half (approximately).
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 3 Nov 2014 20:38:01 +0000 (15:38 -0500)]
neo: Load the graph in chunks.
Fix #870.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Mon, 3 Nov 2014 19:45:05 +0000 (14:45 -0500)]
Merge: Bugfixes for MacOSX
Some hot-bugfixes for MacOSX.
See the individual commits for the details.
Pull-Request: #865
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 3 Nov 2014 18:38:03 +0000 (13:38 -0500)]
man: add nitc as an alias of nitg
So people that does `man nitc` will see something.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 3 Nov 2014 07:51:11 +0000 (02:51 -0500)]
README: add pkg-config as a requirement
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 2 Nov 2014 16:04:28 +0000 (11:04 -0500)]
tests: fix saferun() return value when TIME is not set
Doing stuff after the command execution will temper its return value.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 2 Nov 2014 16:02:56 +0000 (11:02 -0500)]
toolcontext: nit_dir tries another heuristic on PATH if procfs is not available
procfs (/proc/) does not exists on some system (macosx).
Therefore the heuristic used to find nit_dir will fail on those system
when the command is invoked from the PATH.
The solution is to add another heuristic, where the program_name is
manually searched inside the directories of PATH in order to find the
original directory.
Reported-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 2 Nov 2014 16:01:39 +0000 (11:01 -0500)]
bin: nitc does no more rely on procfs
procfs (/proc/) does not exists on some system (macosx).
So use `$BASH_SOURCE` to approximate the original source-file.
Maybe we should just rename back nitg to nitc.
Reported-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 1 Nov 2014 18:06:17 +0000 (14:06 -0400)]
tools: use pkg-config to found libgc
In some platform (macosx+macports), the libgc library is not located at
standard default position.
Fortunately, libgc seems to be registered with pkg-config under most
platforms.
Thus, use pkg-config in the generated makefiles to found the correct
flags and paths.
In c_src, some generated files are manually modified to provide a
working bootstrap under those platforms.
This is only a quick-and-dirty workaround. The real job must be polished
and generalized to solve the issue #864.
Reported-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 3 Nov 2014 14:52:03 +0000 (09:52 -0500)]
doc: remove advanced_options (deprecated by manpages)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 3 Nov 2014 14:51:22 +0000 (09:51 -0500)]
man: improve README when people already have a MANPATH
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 3 Nov 2014 14:49:54 +0000 (09:49 -0500)]
makefile: add `man` rule to build the manpages
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 2 Nov 2014 00:28:37 +0000 (20:28 -0400)]
modelize: new advice for old-style-init
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 2 Nov 2014 00:26:54 +0000 (20:26 -0400)]
lib: use new constructors in some libs used by nit tools
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 1 Nov 2014 19:31:40 +0000 (15:31 -0400)]
lib: update some modules of standard to new constructors
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Sat, 1 Nov 2014 15:58:25 +0000 (11:58 -0400)]
neo: Correct exportation of a signature.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Sat, 1 Nov 2014 14:32:14 +0000 (10:32 -0400)]
Merge: lib/android: hack to fix new_global_ref
awaiting a fix for #845
@privat This might fix some android apps, ballz at least.
Pull-Request: #846
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 31 Oct 2014 12:56:20 +0000 (08:56 -0400)]
version 0.6.10
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 31 Oct 2014 16:55:06 +0000 (12:55 -0400)]
update c_src
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Fri, 10 Oct 2014 17:44:07 +0000 (13:44 -0400)]
lib/android: hacks to fix new_global_ref awaiting a fix for #845
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 31 Oct 2014 11:17:55 +0000 (07:17 -0400)]
Merge: Distribuable compiledir
Unfortunately, Nit is not yet available everywhere.
Therefore, in order to be able to distribute or deploy Nit programs, one easy way is to distribute the generated C code.
This is what we already do with `c_src` that contains modified C code from the compilation of nith.
This PR generalize the approach and allow the compiler to produce some neat and distributable .compile_dir.
Look at the new `mkcsrc` to see how things are simpler now.
Example, you want to disribute `hello_world`:
~~~sh
$ nitg examples/hello_world.nit --semi-global --no-cc --dir hello --compile-dir hello
$ ls -l hello
abstract_collection.sep.0.h
abstract_collection.sep.1.c
array.sep.0.h
array.sep.1.c
c_functions_hash.c
c_functions_hash.h
file_nit.c
file_nit.h
file.sep.0.h
file.sep.1.c
gc_chooser.c
gc_chooser.h
hello_world.classes.0.h
hello_world.classes.1.c
hello_world.main.0.h
hello_world.main.1.c
hello_world.mk
hello_world.sep.0.h
hello_world.sep.1.c
hello_world.types.0.h
hello_world.types.1.c
kernel.sep.0.h
kernel.sep.1.c
Makefile
math_nit.h
math.sep.0.h
math.sep.1.c
nit.common.h
stream.sep.0.h
stream.sep.1.c
string_nit.c
string_nit.h
string.sep.0.h
string.sep.1.c
$ cd hello
$ make
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o hello_world.classes.1.o hello_world.classes.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o hello_world.main.1.o hello_world.main.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o hello_world.sep.1.o hello_world.sep.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o string.sep.1.o string.sep.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o math.sep.1.o math.sep.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o kernel.sep.1.o kernel.sep.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o abstract_collection.sep.1.o abstract_collection.sep.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o array.sep.1.o array.sep.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o file.sep.1.o file.sep.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o stream.sep.1.o stream.sep.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o hello_world.types.1.o hello_world.types.1.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o string_nit.extern.o string_nit.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o file_nit.extern.o file_nit.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -c -o c_functions_hash.extern.o c_functions_hash.c
ccache cc -g -O2 -Wno-unused-value -Wno-switch -DWITH_LIBGC -c -o gc_chooser.extern.o gc_chooser.c
ccache cc -o hello_world hello_world.classes.1.o hello_world.main.1.o hello_world.sep.1.o string.sep.1.o math.sep.1.o kernel.sep.1.o abstract_collection.sep.1.o array.sep.1.o file.sep.1.o stream.sep.1.o hello_world.types.1.o string_nit.extern.o file_nit.extern.o c_functions_hash.extern.o gc_chooser.extern.o -lm -lgc -lunwind
$ ./hello_world
hello world
~~~
Pull-Request: #860
Jean Privat [Fri, 31 Oct 2014 11:17:49 +0000 (07:17 -0400)]
Merge: Attribute block
As promised in #832, here the attribute initialized with a block instead of a simple expression.
The syntax is quite strange but nobody complained in #832.
The final value is returned with a `return` and the `do` block follows optional annotation to look like the definition of methods.
`lazy` and all other annotations on attributes should works as expected.
~~~
class A
var foo: String do return "Hello"
var bar: String is lazy do
return foo + ", world!"
end
end
var a = new A
print a.bar # => hello, world!
~~~
Pull-Request: #858
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Fri, 31 Oct 2014 11:17:46 +0000 (07:17 -0400)]
Merge: Autoinit attributes
Allow `autoinit` on attributes.
This means that the initialization of the attribute is done during the initializer phase.
This will help when the initial value of an attribute depend on the value of another attribute set a the initializer phase.
So that
~~~
class A
var x: String
var y: String = x + " world!"
end
var a = new A("hello") # BOOM! uninitialized x while initializing y
print a.y
~~~
Can become:
~~~
class A
var x: String
var y: String = x + " world!" is autoinit
end
var a = new A("hello")
print a.y # => hello world!
~~~
The inconvenient is that the initialisation markers of attributes become more complex.
Now we have:
* no default value and no special annotation: the setter is collected as an initializer
* no default value and `noinit`: not automatically initialized
* default value and no special annotation: the value is set between the allocation and all initializers
* default value and annotation `lazy`: the value is set at the first access
* *new* default value and annotation `autoinit`: the value is set with all other initializers (other `autoinit`)
For an implementation explanation, the mechanism is a quick hack: `autoinit` means `lazy` + the getter is collector as an initializer. Therefore, when initializers are invoked, the getter will be invoked and the value lazily evaluated.
So the example is equivalent to
~~~
class A
var x: String
var y: String = x + " world!" is lazy
end
var a = ALLOCATE(A)
a.x = "hello" # collected setter for x
a.y # lazy getter for y
a.init
print a.y # => hello world!
~~~
Pull-Request: #857
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 30 Oct 2014 01:58:12 +0000 (21:58 -0400)]
.gitattributes: nodiff all c_src
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 30 Oct 2014 01:51:57 +0000 (21:51 -0400)]
mkcsrc: rewrite a simplified version
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 17:25:09 +0000 (13:25 -0400)]
tests: add base_init_autoinit2.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 17:02:37 +0000 (13:02 -0400)]
modelize: handle `autoinit` on attributes
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 16:58:26 +0000 (12:58 -0400)]
semantize: move noinit attribute to `AAttrPropdef::build_property`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 18:45:08 +0000 (14:45 -0400)]
tests: add base_attr_init_val_block.nit
Signed-off-by: Jean Privat <jean@pryen.org>