nit.git
6 years agoMerge: curl: basic Unix domain socket support
Jean Privat [Thu, 29 Mar 2018 00:11:31 +0000 (20:11 -0400)]
Merge: curl: basic Unix domain socket support

Support using a Unix socket to send an HTTP request.

~~~
var request = new CurlHTTPRequest("http://localhost/")
request.unix_socket_path = "/tmp/nginx.sock"
var response = request.execute
~~~

@matthmsl Is this what you needed for #2623?

Pull-Request: #2625
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>

6 years agocurl: intro `CurlHTTPRequest::unix_socket_path`
Alexis Laferrière [Sun, 25 Mar 2018 12:49:59 +0000 (08:49 -0400)]
curl: intro `CurlHTTPRequest::unix_socket_path`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agocurl: cleanup, remove a typo and a callback from C to Nit
Alexis Laferrière [Sun, 25 Mar 2018 12:48:59 +0000 (08:48 -0400)]
curl: cleanup, remove a typo and a callback from C to Nit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: Fix regressions in make
Jean Privat [Sat, 3 Mar 2018 21:35:57 +0000 (16:35 -0500)]
Merge: Fix regressions in make

* nitc_0 is rebuild when needed
* tools are spited into two groups to lighten the initial build

Close #2619

Pull-Request: #2620

6 years agomakefile: split tools into 2 groups
Jean Privat [Sat, 3 Mar 2018 19:30:59 +0000 (14:30 -0500)]
makefile: split tools into 2 groups

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agomakefile: force dependency on all .nit file of src
Jean Privat [Sat, 3 Mar 2018 19:30:13 +0000 (14:30 -0500)]
makefile: force dependency on all .nit file of src

It is a good approximation of tool changes I suppose.

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agomakefile: nitc is in ../bin/
Jean Privat [Sat, 3 Mar 2018 19:21:45 +0000 (14:21 -0500)]
makefile: nitc is in ../bin/

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agoMerge: Improve lib/html and nitlight
Jean Privat [Fri, 2 Mar 2018 19:16:56 +0000 (14:16 -0500)]
Merge: Improve lib/html and nitlight

Various improprement in the whole nitlight chain.

Before: nitlight --keep-going -d tmp ../lib/ ../src
* Elapsed (wall clock) time: 28.71
* User time (seconds): 47.25
* System time (seconds): 1.05
* Maximum resident set size (Gbytes): 2.1311

After: nitlight --keep-going -d tmp ../lib/ ../src
* Elapsed (wall clock) time: 22.97 (-20%)
* User time (seconds): 34.42  (-27%)
* System time (seconds): 1.06
* Maximum resident set size (Gbytes): 1.8924 (-11%)

After + new option: nitlight --keep-going -d tmp ../lib/ ../src --no-infobox
* Elapsed (wall clock) time: 10.71 (-63%)
* User time (seconds): 14.49 (-69%)
* System time (seconds): 0.83
* Maximum resident set size (Gbytes): 1.6713 (-20%)

Pull-Request: #2618

6 years agosrc/nitlight: add option --no-infobox
Jean Privat [Fri, 2 Mar 2018 15:40:50 +0000 (10:40 -0500)]
src/nitlight: add option --no-infobox

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agosrc/htmlight: Do not create the whole infobox unless needed
Jean Privat [Fri, 2 Mar 2018 15:40:21 +0000 (10:40 -0500)]
src/htmlight: Do not create the whole infobox unless needed

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agolib/core::Text::html_escape: better implementation.
Jean Privat [Fri, 2 Mar 2018 14:53:37 +0000 (09:53 -0500)]
lib/core::Text::html_escape: better implementation.

But it is shortcut anyway by the implementation in Flat anyway :(

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agolib/html: really implements Writable::write_to
Jean Privat [Fri, 2 Mar 2018 14:51:05 +0000 (09:51 -0500)]
lib/html: really implements Writable::write_to

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agolib/html: use Array as it improve performances
Jean Privat [Fri, 2 Mar 2018 14:50:17 +0000 (09:50 -0500)]
lib/html: use Array as it improve performances

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agoMerge: Intro picnit, the (minimal) Nit package manager
Jean Privat [Thu, 1 Mar 2018 19:04:30 +0000 (14:04 -0500)]
Merge: Intro picnit, the (minimal) Nit package manager

picnit is a command line tool to install Nit packages, it supports the following actions:

* `picnit install <package or git-repository>` Install a package by name or from a git-repository
* `picnit list`    List installed packages
* `picnit upgrade <package>`  Upgrade a package
* `picnit uninstall <package>`  Uninstall a package
* `picnit help [command]`    Show general help message or the help for a command

The Nit loader has been modified to search for packages where picnit puts them.

You can try picnit with:

~~~
picnit install hello_picnit
picnit list
nit hello_picnit
~~~

The install command clones the Git repo to `~/.local/lib/nit/hello_picnit/` where it will be found by all Nit tools. It can then be interpreted directly by nit (as in the above) or imported by any Nit module.

The server offers only static files, the package.ini renamed for the package (as in hello_picnit.ini). For now, the package list is on my server, so if you want me to add a package, just send me a link to the package.ini! You can see the full list of available packages at https://xymus.net/picnit/.

I'll continue testing and improving picnit by moving gamnit out of the Nit repo and rely on picnit to install it.

Current and planned future features:
- [x] Install from git repository.
- [x] Update, list and uninstall installed packages.
- [x] nitc and others use the installed packages.
- [x] Install by package name, using a centralized server to keep the package.inis.
- [ ] Post install/upgrade hooks: to compile something, suggest installing native libs, etc.
- [ ] A command to show data from the package.ini: issue URL, etc.
- [ ] Centralized server support for unapproved packages, moderation, rating, etc.
- [ ] Advanced search: "Did you mean?" and search in doc of all packages
- [ ] Support nested packages, the git.dir option and more than one package per repo.
- [ ] Detect or declare dependencies of each packages and auto install them.
- [ ] Pin version / branch / tag per project.
- [ ] Windows support.

Pull-Request: #2615

6 years agoloader: use NIT_TESTING_TESTSSH to ignore picnit packages when testing
Alexis Laferrière [Thu, 1 Mar 2018 15:00:38 +0000 (10:00 -0500)]
loader: use NIT_TESTING_TESTSSH to ignore picnit packages when testing

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: intro NIT_TESTING_TESTSSH
Alexis Laferrière [Thu, 1 Mar 2018 14:58:28 +0000 (09:58 -0500)]
tests: intro NIT_TESTING_TESTSSH

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: Tests maintenance for macOS
Jean Privat [Thu, 1 Mar 2018 14:42:06 +0000 (09:42 -0500)]
Merge: Tests maintenance for macOS

Update the expected result of `hello_ios` and blacklist two more tests on macOS. Both gettext and mongoc (the failure behind nitweb) are available on macOS, however, they would require some configuration.

Pull-Request: #2617

6 years agoMerge: inkscape_tools: fix Inkscape version detection on Ubuntu
Jean Privat [Thu, 1 Mar 2018 14:42:04 +0000 (09:42 -0500)]
Merge: inkscape_tools: fix Inkscape version detection on Ubuntu

The regex detecting the Inkscape version was too permissive and expected 3 numbers. This made it wrongly match the revision string on Ubuntu where the version string has only 2 numbers:
`Inkscape 0.91 r13725`

Thanks @BlackMinou!

Pull-Request: #2616
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>

6 years agoMerge: Explain failed asserts for easier debugging, error reporting and TDD
Jean Privat [Thu, 1 Mar 2018 14:42:02 +0000 (09:42 -0500)]
Merge: Explain failed asserts for easier debugging, error reporting and TDD

When an assert fails, the program prints the details of the failed expression to the console, above the stacktrace. This change makes it easier and even fun to implement methods by writing the tests first and using nitunit to debug.

The AST rewrite can explain binary comparisons (printing the expected and actual values in a similar way to JUnit's `assertEquals`), `not` and `isa` expressions, as well as the receiver and arguments sent to a method returning `Bool`. It does not explain `and` & `or` expressions as they could cause unwanted side-effects in the current implementation.

Example of a method call:
~~~
var x = 0.0
var y = 1.0
assert x.is_approx(y, 0.5)
~~~

Output:
~~~
Runtime assert: 0.0.is_approx(1.0, 0.5)
Runtime error: Assert failed (a.nit:3)
~~~

Expressions are executed only once by assigning each printed values to a variable. The values are then printed via a superstring, inheriting its automatic call to `to_s`.

Example of a binary comparison with a possible side-effect and protected nullable types:

~~~
fun foo(v: nullable Int): nullable Int do
print "foo"
return v
end

assert foo(null) != null
~~~

Output:

~~~
foo
Runtime assert: null != null
Runtime error: Assert failed (b.nit:6)
~~~

---

I don't like that the phase has so many dependencies, but they appeared to be required by `ASTBuilder` which greatly simplify the code and they also help to deal with nullable types. Future work could probably remove some dependencies and work on the pure AST.

This PR may break the reproducibility of some tests, but I have another PR in the works that could fix that.

Pull-Request: #2541
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

6 years agotests: update Darwin skip list
Alexis Laferrière [Mon, 26 Feb 2018 17:16:32 +0000 (12:16 -0500)]
tests: update Darwin skip list

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: hello_ios now has an empty "assets" folder
Alexis Laferrière [Mon, 26 Feb 2018 17:16:19 +0000 (12:16 -0500)]
tests: hello_ios now has an empty "assets" folder

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoinkscape_tools: fix Inkscape version detection on Ubuntu
Alexis Laferrière [Wed, 21 Feb 2018 17:28:52 +0000 (12:28 -0500)]
inkscape_tools: fix Inkscape version detection on Ubuntu

The regex detecting the Inkscape version was too permissive and expected
3 numbers. This make it wrongly match to the revision string on Ubuntu
where the version string has 2 numbers:

Inkscape 0.91 r13725

Reported-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: test picnit
Alexis Laferrière [Sun, 18 Feb 2018 00:53:53 +0000 (19:53 -0500)]
tests: test picnit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoshare: add picnit manual
Alexis Laferrière [Sat, 17 Feb 2018 23:59:00 +0000 (18:59 -0500)]
share: add picnit manual

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoloader: look for packages installed via picnit
Alexis Laferrière [Sat, 17 Feb 2018 23:23:55 +0000 (18:23 -0500)]
loader: look for packages installed via picnit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agopicnit: install and update Nit packages from Git repos
Alexis Laferrière [Sat, 17 Feb 2018 21:35:02 +0000 (16:35 -0500)]
picnit: install and update Nit packages from Git repos

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: skip tests failing on timeout or file size limit error by ld
Alexis Laferrière [Thu, 5 Oct 2017 12:33:35 +0000 (08:33 -0400)]
tests: skip tests failing on timeout or file size limit error by ld

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitc: explain asserts only if Array is available, for nitcg
Alexis Laferrière [Thu, 5 Oct 2017 12:23:58 +0000 (08:23 -0400)]
nitc: explain asserts only if Array is available, for nitcg

nitcg failed on base.isa.base_isa_vt_gen1.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agorta: visit the superstring created by explain_assert
Alexis Laferrière [Fri, 29 Sep 2017 14:06:52 +0000 (10:06 -0400)]
rta: visit the superstring created by explain_assert

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: Infer more attribute types
Jean Privat [Fri, 16 Feb 2018 16:45:45 +0000 (11:45 -0500)]
Merge: Infer more attribute types

Extend the detection of the static type of attributes from their literal values to support three new cases:

* Simple arrays like `[0, 1, 2]` and `[new Set[Int], new Set[Int]]`. However, it does not accept arrays with an explicit type because we can't subtype/anchor at that point, as far as I know.

* Negative integers and floats. This cheats a bit as the return type of the unary - is defined in the core libary. However this should help 99.9% of the time, in particular for Nit beginners, and a workaround is to declare the attribute static type when defining a different kernel library.

* The `once` keyword.

~~~
class A
       # Now detected
       var i = -1
       var f = -1.0
       var a = [0, 1]
       var o = once [0, 1]

       # These are refused
       var a1 = [0, 1.0, "a"] # Different types
       var a2 = [0, 1: Int] # Can't reliably check subtypes
       var a4 = [1+1] # Expression
       var o1 = once [0, "a"] # Forwarded error
end
~~~

---

You may want to review commit by commit as the first commit is a small refactoring.

Pull-Request: #2614

6 years agoMerge: Intro and use `prompt`, an alternative to `readline`
Jean Privat [Fri, 16 Feb 2018 16:45:44 +0000 (11:45 -0500)]
Merge: Intro and use `prompt`, an alternative to `readline`

The new package `prompt` offers two basic services to create a shell interface. It does not depend on external libraries and it is licensed under Apache 2.0.

The `prompt` API is optionally implemented by the `readline` package which can be used as a drop-in replacement.

This PR uses `prompt` in nitx to remove the dependency on readline. This dependency would prevent us from compiling Nit on platforms that do not offer the native library, and someone could argue that there are possible legal ramifications in which I would not want to ensnare the Nit project. See the past discussion on GNU readline: #2083

Anyone can still mixin readline with nitx using: `nitc nitx.nit -m readline`

This will also fix the Nit Docker image failing to build: https://hub.docker.com/r/nitlang/nit/builds/

Pull-Request: #2613

6 years agoMerge branch 'explain-assert' into master
Alexis Laferrière [Fri, 16 Feb 2018 16:26:25 +0000 (11:26 -0500)]
Merge branch 'explain-assert' into master

6 years agofrontend: fix missing location
Alexis Laferrière [Thu, 28 Sep 2017 14:38:13 +0000 (10:38 -0400)]
frontend: fix missing location

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years ago*: remove newly superfluous static types on attributes
Alexis Laferrière [Thu, 15 Feb 2018 17:58:50 +0000 (12:58 -0500)]
*: remove newly superfluous static types on attributes

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: test the new inferrable attribute types
Alexis Laferrière [Thu, 15 Feb 2018 16:24:21 +0000 (11:24 -0500)]
tests: test the new inferrable attribute types

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agomodel: infer the types of attributes with unary - and once
Alexis Laferrière [Thu, 15 Feb 2018 16:18:45 +0000 (11:18 -0500)]
model: infer the types of attributes with unary - and once

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agomodel: infer the array types of attributes
Alexis Laferrière [Thu, 15 Feb 2018 16:18:27 +0000 (11:18 -0500)]
model: infer the array types of attributes

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agomodel: extract infer_static_type to support recursive calls
Alexis Laferrière [Thu, 15 Feb 2018 14:46:44 +0000 (09:46 -0500)]
model: extract infer_static_type to support recursive calls

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitin: use `prompt`
Alexis Laferrière [Wed, 14 Feb 2018 13:34:01 +0000 (08:34 -0500)]
nitin: use `prompt`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitx: remove dependency on GNU readline
Alexis Laferrière [Wed, 14 Feb 2018 13:25:49 +0000 (08:25 -0500)]
nitx: remove dependency on GNU readline

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitx: exit on EOF
Alexis Laferrière [Wed, 14 Feb 2018 16:11:07 +0000 (11:11 -0500)]
nitx: exit on EOF

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agorealtime: implement the `prompt` service
Alexis Laferrière [Wed, 14 Feb 2018 13:22:58 +0000 (08:22 -0500)]
realtime: implement the `prompt` service

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agolib: intro `prompt`, basic Apache 2.0 service to display a prompt
Alexis Laferrière [Wed, 14 Feb 2018 13:22:37 +0000 (08:22 -0500)]
lib: intro `prompt`, basic Apache 2.0 service to display a prompt

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: nitc: check pkg-config packages availability later
Jean Privat [Fri, 26 Jan 2018 21:12:15 +0000 (16:12 -0500)]
Merge: nitc: check pkg-config packages availability later

The `pkgconfig` annotation tells the compiler to use the `pkg-config` command in order to get the C compiler and linker options required to build the user C code. The availability of each package was tested twice, once at reading the annotation and once in the generated Makefile. This PR moves the first check later, with the generation of the Makefile. There is still two checks, one by the Nit compiler with a prettier output, and one by the Makefile in case it is distributed with the generated C source files.

This fixes an issue we've had when compiling for Android and iOS, where the result of the annotation was not used but still blocked the compilation if the host did not have the package. And leaving the check to the Makefile give a chance to the programmer to tweak it before the C compilation when cross-compiling.

The error message thrown by the Makefile is less user-friendly as we lose the reference to the Nit source file and line number. This should not be much on an issue since it is rarely a programming error, more of a system configuration error, but it could be improved upon if it becomes an issue.

Pull-Request: #2610
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agotests: test_syntax now reports other errors before the pkgconfig error
Alexis Laferrière [Tue, 23 Jan 2018 18:53:28 +0000 (13:53 -0500)]
tests: test_syntax now reports other errors before the pkgconfig error

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitc & niti: move the duplicated pkg-config checks to the pkgconfig module
Alexis Laferrière [Tue, 23 Jan 2018 18:48:32 +0000 (13:48 -0500)]
nitc & niti: move the duplicated pkg-config checks to the pkgconfig module

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: Gamnit on iOS
Jean Privat [Thu, 25 Jan 2018 20:16:37 +0000 (15:16 -0500)]
Merge: Gamnit on iOS

Support iOS as a target for Gamnit games, including:

* GC on iOS and Xcode assets folder support in the compiler.
* iOS view controller and OpenGL view using the GLKit services.
* Loading of assets: sound, texture and text (and thus 3D models and fonts).
* iOS touch event and orientation change support.
* A few bug fix and tweaks to Gamnit.
* Minimal makefile rules to target iOS.

The game `asteronits` works as expected, here it is on iPad (With controls that are way too big):

![screen shot 2018-01-14 at 10 11 17](https://user-images.githubusercontent.com/208057/34918201-187b8b4a-f91d-11e7-86a2-6b891b237316.png)

Limitations:
* By default, the compiler generates an app for the simulator. To compile for a physical device, in practice, I run `nitc -m ios --compile-dir nit_compile` to generate the iOS project and view errors in Nit or in the custom Objective-C code. And then I launch Xcode with `open -a xcode nit_compile/ios/my_project.xcodeproj` to compile and run on a device from there.

* The depth API (3D) does not work on iOS with this PR because of known bugs in the current implementation. I have a rewrite of the depth API that fixes these bugs and bring a much needed performance boost.

* A `Sound` instance can't be played more than once concurrently. This could be improved by using `AVPlayer` as kind of sound channel and an `AVPlayerItem` for each sound instance, instead of the current `AVAudioPlayer`.

* iOS does not support exactly the same format for assets than Android. Sounds in mp3 format should work on both platforms. PNG files work on both platforms but iOS is more picky on the color palette, I've had an issue with a greyscale PNG, RGBA PNG files should be safe.

  You can always use the `app_files` annotation to include platform-specific assets.

* `gamnit::selection` does not work on iOS because we can't read the screen pixels. It should be updated to use an FBO.

* We still need a portable API for locking the screen orientation.

* Compiling Gamnit games for iOS fails at a missing pkg-config package. The package is not used and in can be safely ignored by removing the "pkgconfig" line in `lib/glesv2/glesv2.nit`. I'll need to find a clean fix for this...

Pull-Request: #2605
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>

6 years agoMerge: doc/commands: extract CmdCode superclass
Jean Privat [Thu, 25 Jan 2018 20:16:35 +0000 (15:16 -0500)]
Merge: doc/commands: extract CmdCode superclass

Provides a common super class to factorize code rendering services for doc commands.

Changes:
* renamed `CmdComment::render` to `render_comment` to avoid name conflicts with multiple inheritance
* extracted `CmdCode` command to factorize code related services
* introduced new class `CmdEntityCode`, in place of the old `CmdCode` class
* updated nitx/nitweb clients
* updated tests

Pull-Request: #2609

6 years agoMerge: Remove the packages `glesv1`, `mnit` and `sdl` (1.2), and their clients
Jean Privat [Thu, 25 Jan 2018 20:16:34 +0000 (15:16 -0500)]
Merge: Remove the packages `glesv1`, `mnit` and `sdl` (1.2), and their clients

This PR removes the packages for OpenGL ES 1.0, most of the graphics engine `mnit` and the SDL 1.2 wrapper `sdl`, as well as their clients: crazy_moles, friendz, memory, mnit_ballz, mnit_dino, shoot and the 2D client of Tinks!.

This purge is mainly motivated by the declining support for OpenGL ES 1.0, it is not available on macOS and on some recent GNU/Linux distributions (including on our test servers). Plus, all the libraries have been replaced by well-supported alternatives: `glesv2` for OpenGL ES 2.0, the graphics engine `gamnit` and `sdl2`. The new libraries are even more portable, adding support for Windows and iOS alongside GNU/Linux and Android.

Some of the deleted games were quite good, it is sad to simply let them go. If anyone is willing to put in the work, most of these games can still be updated to `gamnit` by reverting the commit and writing some code!

@privat  Could you somehow lock the APK files on the F-Droid server so the games live on? They all had Android variants except for `shoot`.

Pull-Request: #2611

6 years agoandroid: update the `sensors` module to use gamnit
Alexis Laferrière [Thu, 25 Jan 2018 14:05:16 +0000 (09:05 -0500)]
android: update the `sensors` module to use gamnit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: don't TODO Darwin errors for OpenGL ES 1.0
Alexis Laferrière [Sun, 7 Jan 2018 14:38:48 +0000 (09:38 -0500)]
tests: don't TODO Darwin errors for OpenGL ES 1.0

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoinkscape_tools: remove `mnit` support
Alexis Laferrière [Fri, 12 Jan 2018 03:11:57 +0000 (22:11 -0500)]
inkscape_tools: remove `mnit` support

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoinkscape_tools: delete mnit based test applications
Alexis Laferrière [Fri, 12 Jan 2018 03:09:15 +0000 (22:09 -0500)]
inkscape_tools: delete mnit based test applications

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agolib: clear all references to mnit from memory
Alexis Laferrière [Fri, 12 Jan 2018 03:02:33 +0000 (22:02 -0500)]
lib: clear all references to mnit from memory

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agolib: delete the `sdl` package (there's still SDL2)
Alexis Laferrière [Fri, 12 Jan 2018 02:54:33 +0000 (21:54 -0500)]
lib: delete the `sdl` package (there's still SDL2)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agolib: delete most of the mnit package (keeping input.nit)
Alexis Laferrière [Sun, 7 Jan 2018 14:30:39 +0000 (09:30 -0500)]
lib: delete most of the mnit package (keeping input.nit)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotinks: delete the old 2D mnit client
Alexis Laferrière [Fri, 12 Jan 2018 02:47:53 +0000 (21:47 -0500)]
tinks: delete the old 2D mnit client

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoexamples: delete the `shoot` game
Alexis Laferrière [Sun, 7 Jan 2018 14:50:55 +0000 (09:50 -0500)]
examples: delete the `shoot` game

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agocontrib: delete the friendz game
Alexis Laferrière [Sun, 7 Jan 2018 14:41:31 +0000 (09:41 -0500)]
contrib: delete the friendz game

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agocontrib: delete the memory game
Alexis Laferrière [Sun, 7 Jan 2018 14:28:05 +0000 (09:28 -0500)]
contrib: delete the memory game

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoexamples: delete mnit_ballz
Alexis Laferrière [Sun, 7 Jan 2018 14:26:50 +0000 (09:26 -0500)]
examples: delete mnit_ballz

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoexamples: remove mnit_dino
Alexis Laferrière [Wed, 24 Jan 2018 18:03:39 +0000 (13:03 -0500)]
examples: remove mnit_dino

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agocontrib: remove crazy_moles
Alexis Laferrière [Wed, 24 Jan 2018 18:03:51 +0000 (13:03 -0500)]
contrib: remove crazy_moles

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agocontrib: remove mnit_test
Alexis Laferrière [Sun, 7 Jan 2018 14:26:33 +0000 (09:26 -0500)]
contrib: remove mnit_test

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitc: document the phase detecting the annots `platform` and `pkgconfig`
Alexis Laferrière [Tue, 23 Jan 2018 14:04:04 +0000 (09:04 -0500)]
nitc: document the phase detecting the annots `platform` and `pkgconfig`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agodoc/commands: update tests
Alexandre Terrasa [Mon, 22 Jan 2018 20:24:51 +0000 (15:24 -0500)]
doc/commands: update tests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agodoc/commands: extract `CmdCode` super class
Alexandre Terrasa [Mon, 22 Jan 2018 20:24:38 +0000 (15:24 -0500)]
doc/commands: extract `CmdCode` super class

So we can factorize code related queries even if they are not related to a specific MEntity

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agodoc/commands: rename `CmdComment::render` to `render_comment` to avoid name conflicts
Alexandre Terrasa [Mon, 22 Jan 2018 20:23:01 +0000 (15:23 -0500)]
doc/commands: rename `CmdComment::render` to `render_comment` to avoid name conflicts

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agoMerge: location: fix located_in behavior
Jean Privat [Fri, 19 Jan 2018 18:09:08 +0000 (13:09 -0500)]
Merge: location: fix located_in behavior

Before this PR, asking if `1,12--1,12` was in `1,1--2,1` returned `false`.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2606

6 years agoMerge: Gamnit: rewrite Android lifecycle support
Jean Privat [Fri, 19 Jan 2018 18:09:07 +0000 (13:09 -0500)]
Merge: Gamnit: rewrite Android lifecycle support

Rewrite much of the Android support to better deal with system state changes. This includes handling out of order lifecycle messages, temporarily invalid OpenGL display surfaces, and recreating the OpenGL context when it is released by the system.

In practice, this PR recreates in `gamnit::gamnit_android` a better version than what is in `android::game`. The old `android::game` could probably be removed with `mnit` and a small clean up.

As a bonus:
* Into portable* services to lock the device orientation. (The iOS variant will be in another PR when #2605 is merged.)
* Ask for 4x antialiasing, it should be available on all target platforms.
* Compile Android apps using gcc, it appears to compile a more stable GC. We can probably tweak a few defines to use clang instead.
* Fix numeric version numbers using the local time, causing surprises when compiled in the cloud.

Pull-Request: #2607

6 years agotests: don't use the readlink option -f when not available (macOS)
Alexis Laferrière [Fri, 19 Jan 2018 13:46:02 +0000 (08:46 -0500)]
tests: don't use the readlink option -f when not available (macOS)

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: use en_US.UTF-8 locale on macOS
Alexis Laferrière [Fri, 19 Jan 2018 13:43:38 +0000 (08:43 -0500)]
tests: use en_US.UTF-8 locale on macOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: fix superfluous option in call to xargs, was broken on macOS
Alexis Laferrière [Fri, 19 Jan 2018 13:42:28 +0000 (08:42 -0500)]
tests: fix superfluous option in call to xargs, was broken on macOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: nitce crashes compiling test_platform_ios on the unavailble 'system'
Alexis Laferrière [Thu, 18 Jan 2018 18:32:48 +0000 (13:32 -0500)]
tests: nitce crashes compiling test_platform_ios on the unavailble 'system'

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoios: accept spaces in path to the Nit project
Alexis Laferrière [Thu, 18 Jan 2018 13:56:36 +0000 (08:56 -0500)]
ios: accept spaces in path to the Nit project

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: skip some tests failing weirdly on macOS
Alexis Laferrière [Wed, 17 Jan 2018 21:44:56 +0000 (16:44 -0500)]
tests: skip some tests failing weirdly on macOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agogamnit: import gamnit_android from android19 for a clear linearisation
Alexis Laferrière [Thu, 18 Jan 2018 00:33:44 +0000 (19:33 -0500)]
gamnit: import gamnit_android from android19 for a clear linearisation

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoasteronits, action_nitro & model_viewer: use gamnit::landscape
Alexis Laferrière [Wed, 20 Dec 2017 13:07:58 +0000 (08:07 -0500)]
asteronits, action_nitro & model_viewer: use gamnit::landscape

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agotests: test_platform_ios produces an empty assets folder
Alexis Laferrière [Wed, 17 Jan 2018 21:44:39 +0000 (16:44 -0500)]
tests: test_platform_ios produces an empty assets folder

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoshare: use BASH_SOURCE to reliably detect the script folder
Alexis Laferrière [Wed, 17 Jan 2018 21:44:05 +0000 (16:44 -0500)]
share: use BASH_SOURCE to reliably detect the script folder

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agopthreads: fix thread/gc support on iOS
Alexis Laferrière [Sun, 14 Jan 2018 16:42:06 +0000 (11:42 -0500)]
pthreads: fix thread/gc support on iOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoasteronits, action_nitro & model_view: add makefile rules for iOS
Alexis Laferrière [Mon, 11 Dec 2017 04:19:12 +0000 (23:19 -0500)]
asteronits, action_nitro & model_view: add makefile rules for iOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoiOS: add support for bdgwc/libgc
Alexis Laferrière [Tue, 12 Dec 2017 16:42:48 +0000 (11:42 -0500)]
iOS: add support for bdgwc/libgc

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitc ios: xcode support per file cflags
Alexis Laferrière [Wed, 13 Dec 2017 18:49:35 +0000 (13:49 -0500)]
nitc ios: xcode support per file cflags

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agogamnit: intro basic input event supports for iOS
Alexis Laferrière [Tue, 12 Dec 2017 18:20:11 +0000 (13:20 -0500)]
gamnit: intro basic input event supports for iOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoios: implement app::audio for iOS
Alexis Laferrière [Wed, 20 Dec 2017 22:38:57 +0000 (17:38 -0500)]
ios: implement app::audio for iOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoios: implement TextAsset for iOS
Alexis Laferrière [Fri, 15 Dec 2017 20:47:12 +0000 (15:47 -0500)]
ios: implement TextAsset for iOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agogamnit: intro core gamnit graphics services for iOS
Alexis Laferrière [Mon, 11 Dec 2017 03:32:15 +0000 (22:32 -0500)]
gamnit: intro core gamnit graphics services for iOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agogamnit: move landscape & portrait from the android package to gamnit
Alexis Laferrière [Fri, 15 Dec 2017 19:54:19 +0000 (14:54 -0500)]
gamnit: move landscape & portrait from the android package to gamnit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitc: use GMT as numeric version instead of local time
Alexis Laferrière [Fri, 29 Dec 2017 17:43:44 +0000 (12:43 -0500)]
nitc: use GMT as numeric version instead of local time

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agogamnit: request 4x antialiasing
Alexis Laferrière [Wed, 8 Nov 2017 16:59:43 +0000 (11:59 -0500)]
gamnit: request 4x antialiasing

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agogamnit: rewrite android support
Alexis Laferrière [Tue, 3 Oct 2017 20:15:52 +0000 (16:15 -0400)]
gamnit: rewrite android support

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agogamnit: differentiate create_display and recreate_gamnit from create_gamnit
Alexis Laferrière [Fri, 3 Nov 2017 18:49:28 +0000 (14:49 -0400)]
gamnit: differentiate create_display and recreate_gamnit from create_gamnit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoandroid: add poll_looper_pause
Alexis Laferrière [Sun, 15 Oct 2017 02:18:07 +0000 (22:18 -0400)]
android: add poll_looper_pause

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoandroid: use the gcc toolchain
Alexis Laferrière [Sun, 12 Nov 2017 22:53:25 +0000 (17:53 -0500)]
android: use the gcc toolchain

At this point, using the GCC toolchain compiles a more stable GC.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agolocation: fix located_in behavior
Alexandre Terrasa [Mon, 15 Jan 2018 20:38:03 +0000 (15:38 -0500)]
location: fix located_in behavior

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agoios: intro GLKit services
Alexis Laferrière [Mon, 11 Dec 2017 03:39:04 +0000 (22:39 -0500)]
ios: intro GLKit services

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitc: support iOS assets
Alexis Laferrière [Mon, 11 Dec 2017 04:56:44 +0000 (23:56 -0500)]
nitc: support iOS assets

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoglesv2: alternative include directive for iOS
Alexis Laferrière [Tue, 7 Apr 2015 19:47:02 +0000 (15:47 -0400)]
glesv2: alternative include directive for iOS

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agolib/realtime: use our custom clock_gettime when targetting < iOS 10
Alexis Laferrière [Wed, 13 Dec 2017 16:07:05 +0000 (11:07 -0500)]
lib/realtime: use our custom clock_gettime when targetting < iOS 10

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>