Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync to latest changes #2

Merged
merged 24 commits into from
Apr 8, 2023
Merged

Commits on Mar 27, 2023

  1. Make get and set arguments take identifiers instead of strings

    Refactors `KvParser` to accept some expressions, as long as they don't
    contain a comma at the top level outside any pair of `[]`, `()` or `{}`.
    
    Also tightens up spans in error messages quite a bit.
    ttencate committed Mar 27, 2023
    Configuration menu
    Copy the full SHA
    1b32155 View commit details
    Browse the repository at this point in the history
  2. Merge #203

    203: Make `get` and `set` arguments take identifiers instead of strings r=Bromeon a=ttencate
    
    Refactors `KvParser` to accept some expressions, as long as they don't
    contain a comma at the top level outside any pair of `[]`, `()` or `{}`.
    
    Also tightens up spans in error messages quite a bit.
    
    Prelude for #199.
    
    Co-authored-by: Thomas ten Cate <ttencate@gmail.com>
    bors[bot] and ttencate authored Mar 27, 2023
    Configuration menu
    Copy the full SHA
    c1c2d60 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2a201f5 View commit details
    Browse the repository at this point in the history
  4. Merge #205

    205: Implement #[init(default = ...)] annotation r=Bromeon a=ttencate
    
    Fixes #199
    
    Co-authored-by: Thomas ten Cate <ttencate@gmail.com>
    bors[bot] and ttencate authored Mar 27, 2023
    Configuration menu
    Copy the full SHA
    c6ebd3d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c9af2f3 View commit details
    Browse the repository at this point in the history
  6. Add basic impls of Rect2, Rect2i, Aabb, Plane

    Add `Mul<X>` impls for `Transform2/3D` for the new types
    Add `min/max` functions for `Vector2/3`
    lilizoey committed Mar 27, 2023
    Configuration menu
    Copy the full SHA
    00de6ac View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2023

  1. Merge #180

    180: Add basic impls of `Rect2`, `Rect2i`, `Aabb`, `Plane` r=Bromeon a=sayaks
    
    - adds basic impls of `Rect2`, `Rect2i`, `Aabb`, `Plane`, so that every function/operator is usable (though many through `InnerX`)
    - adds `Mul<X>` impls for `Transform2/3D` for the new types 
    - adds `min/max` functions for `Vector2/3/4`
    
    i did not add `Mul<Transform2/3D>` for these types because they are actually kinda odd in how they work in godot. We could consider adding them later but it seems there are some outstanding issues in godot related to them (such as godotengine/godot#71035) so it'd probably be good to wait and see if anything is changing there. 
    
    min/max is there mainly to make the implementation of `Transform2D * Rect2` and `Transform3D * Aabb` cleaner. But are convenient functions to have in general.
    
    Co-authored-by: Lili Zoey <lili.andersen@nrk.no>
    bors[bot] and lilizoey authored Mar 28, 2023
    Configuration menu
    Copy the full SHA
    08c6594 View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2023

  1. Reuse artifacts; apply Git patch; change C Tag* types to __Gdext* (pr…

    …ivate)
    
    Rename opaque pointer types to highlight their private nature.
    Needs an update in packed_array.rs because it accidentally uses private implementation details.
    Bromeon committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    8b2ca91 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    091b9a7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0a2085b View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2023

  1. Configuration menu
    Copy the full SHA
    fa58910 View commit details
    Browse the repository at this point in the history
  2. Add godot-nightly (bindgen) jobs to CI

    Also update artifacts repo + branch version to "4.0.1"
    Bromeon committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    c639f9a View commit details
    Browse the repository at this point in the history
  3. Move /target/godot-gen -> /$crate/src/gen (the former breaks IDE stat…

    …ic analysis)
    
    A directory /.generated in the repo root seems to _mostly_ work, but on CLion it needs an extra "Cargo sync" in fresh/cleaned projects.
    This creates extra friction that a crate-local `gen` directory doesn't have. Maybe reconsider this once IDEs handle things better.
    Bromeon committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    120a0dd View commit details
    Browse the repository at this point in the history
  4. Always write both .h/.rs headers; check header diff on single linux

    … job; disable version r/w
    Bromeon committed Apr 1, 2023
    Configuration menu
    Copy the full SHA
    c20197f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0493907 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    22e0288 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2023

  1. Merge #211

    211: Prebuilt Godot artifacts r=Bromeon a=Bromeon
    
    Closes #12 
    Closes #107 
    
    From now on, gdext by default fetches pre-generated versions of these files, published in the [`godot4-prebuilt`](https://github.com/godot-rust/godot4-prebuilt) repo:
    * `extension_api.json` (from Godot binary)
    * `gdextension_interface.h` (from Godot binary)
    * `gdextension_interface.rs` (through bindgen -- currently supports 3 platforms)
    
    This has several benefits:
    1. Significantly fewer dependencies, as bindgen is no longer needed, and thus smaller compile times.
    2. Most CI jobs no longer need the Godot binary (clippy, test), speeding up CI _in addition_ to (1).
    3. It's possible to change the Godot API behind gdext without manually rebuilding the artifacts.
    4. Easy comparison between the Godot APIs of different released versions.
    
    
    ### Using a custom Godot binary
    
    It is still possible to generate those files locally like before, through the use of the `custom-godot` feature on the `godot` crate.
    
    This is necessary for any platform/configuration different from the 3 main supported ones (because bindgen generates different Rust bindings), as well as any in-development or modified Godot versions.
    
    
    ### Changing the Godot release
    
    By default, the latest Godot release is used as input to gdext. Switching between different Godot versions is easily possible, although a bit cumbersome.
    
    If you want to use an older version `4.0`, add this to your **workspace** (not sub-crate) `Cargo.toml`:
    ```toml
    # We need to trick Cargo into seeing a different URL; rust-lang/cargo#5478
    [patch."https://github.com/godot-rust/godot4-prebuilt"]
    godot4-prebuilt = { git = "https://github.com//godot-rust/godot4-prebuilt", branch = "4.0"}
    ```
    We're looking into ways to simplify this. In a crates.io release (#2), we would need to rethink this anyway, mapping Godot versions to Rust release versions (which is not trivial).
    
    Co-authored-by: Jan Haller <bromeon@gmail.com>
    bors[bot] and Bromeon authored Apr 2, 2023
    Configuration menu
    Copy the full SHA
    e0d45a3 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2023

  1. Add return values when generating virtual methods

    Fixes #190
    
    Some node methods are expected to return values. The corresponding
    virtual methods, however, do not reflect that.
    
    For instance, this is the virtual method `Node.get_configuration_warnings` before this commit:
    
    ```rust
    fn get_configuration_warnings(&self) {
        unimplemented!()
    }
    ```
    
    This is the same method with this commit:
    
    ```rust
    fn get_configuration_warnings(&self) -> PackedStringArray {
        unimplemented!()
    }
    ```
    
    This commit makes
    `godot_codegen::clas_generator::make_function_definition` and
    `make_return` aware of virtual method. It also adds a test making sure
    we can call a virtual method that has a return value.
    jbarnoud committed Apr 4, 2023
    Configuration menu
    Copy the full SHA
    e81d5d1 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2023

  1. Merge #207

    207: Add return values when generating virtual methods r=Bromeon a=jbarnoud
    
    Fixes #190
    
    Some node methods are expected to return values. The corresponding virtual methods, however, do not reflect that.
    
    For instance, this is the virtual method `Node.get_configuration_warnings` before this commit:
    
    ```rust
    fn get_configuration_warnings(&self) {
        unimplemented!()
    }
    ```
    
    This is the same method with this commit:
    
    ```rust
    fn get_configuration_warnings(&self) -> PackedStringArray {
        unimplemented!()
    }
    ```
    
    This commit adapts what I think is the relevant code from
    `godot_codegen::class_generator::make_method_definition` into `make_virtual_method`.
    
    Note that I am very unfamiliar with most of the code I had to touch here as well as with the project.
    
    Co-authored-by: Jonathan Barnoud <jonathan@barnoud.net>
    bors[bot] and jbarnoud authored Apr 5, 2023
    Configuration menu
    Copy the full SHA
    04c2323 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    39d54b5 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2023

  1. Configuration menu
    Copy the full SHA
    a8a1084 View commit details
    Browse the repository at this point in the history
  2. Merge #217

    217: check.sh: find Godot 4 executable when available as `godot` r=Bromeon a=yannick-was-taken
    
    # The Issue
    
    Some package managers (Arch Linux) install Godot 4.x as `godot` in the PATH. This is currently not correctly dealt with by check.sh, requiring the user to set GODOT4_BIN manually.
    
    # The Solution
    
    If `godot` is available, `check.sh` now inspects the version of that Godot installation, and if 4.x, accepts it gladly, removing the need to manually set GODOT4_BIN.
    
    # Detail
    
    The version check applies the regex `^4\.` to the version returned by `godot --version`. An example version (the one available in Arch Linux's community repo) is `4.0.1.stable.arch_linux`.
    
    Co-authored-by: yannick-was-taken <yannick-was-taken@posteo.de>
    bors[bot] and yannick-was-taken authored Apr 6, 2023
    Configuration menu
    Copy the full SHA
    77ca78d View commit details
    Browse the repository at this point in the history
  3. Contribution guidelines

    Bromeon committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    11f070b View commit details
    Browse the repository at this point in the history
  4. Merge #215

    215: Contribution guidelines, update `.gdextension` configurations r=Bromeon a=Bromeon
    
    Elaborates the contribution process, documents `#[itest]` and unifies the `.gdextension` library entries.
    
    Fixes #208.
    
    Co-authored-by: Jan Haller <bromeon@gmail.com>
    bors[bot] and Bromeon authored Apr 6, 2023
    Configuration menu
    Copy the full SHA
    e3b9ad1 View commit details
    Browse the repository at this point in the history