Граф коммитов

107 Коммитов

Автор SHA1 Сообщение Дата
Ben Dean-Kawamura f3bb050617 Changing uniffi_meta version to 0.19.0
This isn't published yet, but the all the Cargo.toml files need to agree
on a version.
2022-06-16 11:23:55 -04:00
Ben Dean-Kawamura c1f27860cb Merge branch 'release-v0.19.x' 2022-06-16 11:01:30 -04:00
Ben Dean-Kawamura d25c09e8dc (cargo-release) version 0.19.0 2022-06-16 10:01:38 -04:00
Mark Hammond 16ac8d6937
Allow Rust, Python and Kotlin keywords to be used as identifier names. (#1237) 2022-06-16 16:31:58 +10:00
Jonas Platte 2bd1f73ce2 Add #[uniffi::export] attribute with support for non-impl functions 2022-06-15 13:24:17 -04:00
Mark Hammond bb2039f077
Pin to clap 3.1 and modernize some aspects of clap usage. (#1273) 2022-06-14 10:26:57 +02:00
Mike Hommey 58445ae74f Upgrade weedle2 to nom 6 2022-06-07 13:40:37 +09:00
Jonas Platte 0daf22cf7b
Upgrade to Rust 2021 2022-05-27 12:32:59 +02:00
Jonas Platte cfc1804f38
Further improve fs / path code (#1238)
* Sort dependencies of uniffi_bindgen and uniffi_macros
* Upgrade cargo_metadata to 0.14
* Remove unused lifetime
* Enforce UTF-8 paths everywhere
* Use fs_err for consistently useful fs-related error messages
2022-05-23 15:39:00 +10:00
Jan-Erik Rediger 62d18db369
Merge pull request #1232 from mozilla/release-v0.18.x 2022-05-06 14:16:03 +02:00
Jan-Erik Rediger 7c72d84069 Require at least clap v3.1
3.0 to <=3.0.14 do not work
It will fail with something like this:

    error[E0405]: cannot find trait `CommandFactory` in crate `clap`
       --> uniffi_bindgen/src/lib.rs:499:10
        |
    499 | #[derive(Parser)]
        |          ^^^^^^ not found in `clap`
        |
        = note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)

This seems to have been fixed in 3.1
Changelog is here: https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#310---2022-02-16
2022-05-05 17:45:31 +02:00
Jan-Erik Rediger e73af4cc9b (cargo-release) version 0.18.0 2022-05-05 15:52:36 +02:00
Jan-Erik Rediger 4006fcb041
Merge pull request #1223 from badboy/vendored-weedle2
Vendor complete weedle2 codebase into this repository
2022-04-28 11:10:51 +02:00
bendk cb32f0d29f
Upgrading heck to v0.4 (#1224) 2022-04-22 12:56:54 -04:00
Jan-Erik Rediger d0c62fc869 Use locally-vendored weedle2 2022-04-22 13:20:04 +02:00
Jan-Erik Rediger 2eea7aedf9 Allow record types with arbitrary key types
NOTE: No bindings implementation has been done. It still all defaults to
strings.

Uses a fork of weedle, released as weedle2,
with one additional commit to allow arbitrary types in record keys:
90031e37d4
2022-04-22 10:40:48 +02:00
Mark Hammond b62225822e
Update to clap v3 using derive macros (#1211) 2022-04-14 07:56:55 +10:00
Ben Dean-Kawamura 4298d5ddb1 Update to Askama 0.11
The new Askama version adds refererences in less places.  This required
a few changes:
 - `&dyn fmt::Display` args get change to `&str`
 - Enum literals (`Type::String`) need a `.borrow()` appended to them if
   they get passed to a filter function.
 - Method calls that then get filtered, (`something.type_()|type_name`)
   need a `.borrow()` appended to them.  In a some cases, this can also
   be fixed by having the template code use a field from the template
   struct directly rather than via a method call.
 - Arguments captured in matches also need a `.borrow()` if they get
   passed to a filter function.

Fixed some incorrect whitespace handling code that was only working
because of Askama bugs that were fixed in this version.

Updated the Rust versions to match the policy for Firefox 97.  Askama
requires a newer minimum version, because it uses the `bool_to_option`
feature.
2022-03-08 10:24:58 -05:00
Ben Dean-Kawamura 32a87e848e (cargo-release) version 0.17.0 2022-02-03 11:40:42 -05:00
Tarik Eshaq f4f9fcd3fb
(cargo-release) version 0.16.0 (#1141) 2021-12-15 21:00:50 -07:00
Mark Hammond 2308a05cc0
Release v0.15.2 (#1116) 2021-11-25 11:36:45 +11:00
Mark Hammond d42a1ac541
Release v0.15.x (#1111)
* Add a few more change entries for 0.15

* (cargo-release) version 0.15.1
2021-11-24 08:18:12 +11:00
Ben Dean-Kawamura d6dc1d1189 (cargo-release) version {{version}} 2021-10-27 15:50:51 -04:00
jhugman 653719ff4d
Unit of Code: Refactor kotlin backend to use the language oracle pattern (#993)
* Unit of code: separate kotlin backend in to several managable files

Introduce seam within mod filter

Introduce oracle and fallback code type. Tests pass

Pass around an oracle in the most disgusting way

Split out first modules into files, and passing tests

Extracted enum

Extracted fallback code type

Simplify CodeType trait

Changed name to LanguageOracle. Added formatting for FFIType

Add methods, but nothing for it for adding definitions to CodeType implementations

Handover comments

Convert String to use the pattern. Edited lower+lift machinery in one file

Enum declaration now being generated from its own file

Unfortunately, I've had to rip out

```
{% if member.contains_unsigned_types(ci) %}@ExperimentalUnsignedTypes{% endif %}
```

and

```
{%- if ci.type_contains_object_references(field.type_()) -%}
```

from the Kotlin templates. This is because we can no longer depend on the component interface being available to the templates.

I expect this will be difficult to fix without another pass, and this seems awkward because the is backend specific.

Object working too with almost no changes to templates

Re-add contains_object_references

Re-add contains_unsigned_types

Convert Records

Primitive macro working with primitive boolean

Convert numbers, booleans, strings and floats in to CodeTypes

Fixup other tests / clippy

Convert optional, sequence and map

Convert optional, sequence and map Part II

Convert errors

Tidy / cargo fmt

Convert callback interfaces Part I

Convert callback interfaces Part II

Tidy unsigned types in compounds

Converted Timestamp and Duration

Remove legacy filters and fallbacks (!)

cargo fmt

Delegate imports out to the CodeTypes and Members themselves

Moved helper code and member declarations into a declaration_code method

Rename StringReturn to String

FFI Function tidy

Convert top level functions

Rename unsigned_type_annotation macro

Tighten up visibility of Kotlin objects

Move differential set up of objects and callback interfaces from Helpers.kt to object and callback_interface files

Remove unnecessary type_identifier method from MemberDeclaration

Add better docs

Rename MemberDeclation to CodeDeclaration

Rename LanguageOracle to CodeOracle

Fix typos

Self-review

Remove file of dead code

Remove requirement for implementing unneeded CodeType methods

* Address tarikeshaq nits

* Address reviewer comments I

* Address reviewer comments II

* Remove unsigned types annotations

Cargo fmt
2021-09-02 17:19:38 +01:00
Sammy Khamis ddbffc8c4d
(cargo-release) version v0.14.0 (#1038) 2021-08-18 09:38:24 -10:00
Ryan Kelly 8b800cb4d4 (cargo-release) version v0.13.1 2021-08-10 12:12:02 +10:00
Ryan Kelly d606439014 (cargo-release) version v0.13.0 2021-08-10 09:01:03 +10:00
Ryan Kelly 8f64208dc9 (cargo-release) version v0.12.0 2021-06-14 17:24:05 +10:00
Sammy Khamis a395e7f10a (cargo-release) version v0.11.0 2021-06-03 14:45:55 -10:00
Ryan Kelly f7c4517bb6 (cargo-release) version v0.10.0 2021-05-26 12:28:57 +10:00
rml 9b15fda592 Update cargo-metadata dependency
cargo-metadata 0.11 to 0.13
2021-05-22 18:38:16 +01:00
Ryan Kelly e27bb16de9 (cargo-release) version v0.9.0 2021-05-21 12:13:34 +10:00
James Hugman ccfbd3b98f
(cargo-release) version 0.8.0 2021-03-05 19:24:39 +00:00
Ryan Kelly 19fb3fde33 (cargo-release) version v0.7.2 2021-02-25 16:00:41 +11:00
Ryan Kelly 19a50b436f (cargo-release) version v0.7.1 2021-02-19 12:36:25 +11:00
Ryan Kelly 934bc022be
Remove version pin of `funty`, which is no longer required. (#394)
The latest release of `nom` seems to have fixed the dependency
issue so this is no longer required.
2021-02-19 11:12:30 +11:00
Ryan Kelly 4b40798e98 Pin `funty` dependency, as a workaround for some dependency bustage.
This is basically copying the upstream fix proposed for `nom`, until we
get a new release with the fix included.

Ref https://github.com/Geal/nom/pull/1286/
2021-02-15 12:18:14 +11:00
Ryan Kelly 566872537f Update to the latest release of weedle.
The new version of weedle tracks an update in the WebIDL spec [1]
that renamed `void` to `undefined`, which makes sense for the web but
is a bit of a pain for us. To avoid churning consumers of uniffi,
this commit adds some special-case handling for the identifier `void`
in return position. You can tell that the special-casing works
by the fact that this doesn't require changes to any of our tests,
many of which use the `void` syntax.

[1] Ref https://github.com/rustwasm/weedle/pull/43
2021-02-09 10:10:15 +11:00
Dan Mosedale 75866b589a
(cargo-release) version v0.7.0 (#377) 2021-01-25 08:44:00 -08:00
Ryan Kelly 0b753a7c5f (cargo-release) version v0.6.1 2020-12-09 12:19:02 +11:00
Ryan Kelly 3e356624dc (cargo-release) version v0.6.0 2020-12-09 10:15:31 +11:00
Ryan Kelly ee76960e66
Prepare v0.5.0 2020-11-09 15:39:59 +11:00
Ryan Kelly eeba64136c
Compatibility tweaks for Rust v1.43.0
The version of Rust in mozilla-central is currently pinned to v1.43.0,
so we need to make sure we're compatible with it as well.
2020-11-09 14:31:25 +11:00
Ryan Kelly 6c7d76a4dd
Merge branch 'main' into nibssd-85 2020-11-06 09:57:34 +11:00
Ryan Kelly 4bcd458a78
Update cargo_metadata dependency. 2020-11-05 12:38:25 +11:00
Ryan Kelly 1e58889947
Prepare v0.4.0 2020-10-27 09:29:27 +11:00
Andrei Oprea 1280a2ebf4 Update dependencies 2020-10-21 16:29:22 +02:00
Dan Mosedale 3a4cd2af2a Fixes Cargo warning about license-file use (#322) 2020-10-12 11:32:30 -07:00
Dan Mosedale 8f4412efa2 Add missing license field to Cargo.toml files, fixes #320 2020-10-10 10:57:56 -07:00
Edouard Oger e6492efe86
Bump version to 0.3.0 2020-10-01 11:36:39 -04:00
Lina Cambridge d938bfb227
Generate Firefox Desktop front-end bindings with WebIDL (#255); r=@rfk, @nnethercote
This commit adds a backend that generates bindings for Firefox
front-end code. The bindings are written in WebIDL. For more details,
please see the comments in the `gecko_js` module, as well as the
ADR.

Closes #11.

Co-authored-by: Dan Mosedale <dmose2@gmail.com>
2020-09-30 00:35:45 -07:00
Edouard Oger 32f1ac2d4c
Bump versions 2020-09-23 14:23:57 -04:00
jhugman c0226df0f1
No bug - fixup warnings in cargo test (#288) r=lina!
* License and license-file warnings

* withUnsafeBytes warning
2020-09-22 16:45:07 +01:00
jhugman 2da8cfc476
Add toml file to configure package_name for kotlin binding (#273) r=lina
* 258 — Add toml file to configure kotlin binding.

* Move uniiffi.toml to package directory

* Working with serde/merge_with in kotlin only

* Working with python and swift

* Standardize on config, ci ordering in arg lists

* cargo fmt

* Address reviewer comments
2020-09-21 22:40:01 +01:00
Ryan Kelly 970b515457
Make experimental Kotlin features optional for consumers.
Previously, we were using two experimental features of Kotlin,
in different ways:

* Unsigned types, both as API-level types and for some internal
  helpers.
* The `buildMap` function, for easily building a Map.

Both of these were emitted as part of the generated Kotlin code,
regardless of whether the component actually needed them.

In the first case, consumers would get a warning that they need
to opt-in to using experimental unsigned types, even if the API
they were consuming did not use any unsigned types.

In the second case, we were silently opting in to an experimental
API, meaning that consumers might find the generated code broken
by a future Kotlin release without any warning.

This commit removes default-on experimental Kotlin APIs. Now,
the only time Kotlin consumers will hear about experimental APIs
is if they're using a component with unsigned integers in its
public API, in which case they will need to explicitly opt in
(and hence will be aware of the potential for bustage if the
feature gets removed or changed in future Kotlin releases).

The key here was to refactor the ways the `ComponentInterface`
deals with types, so that we can inspect the set of types that
are actually used by the interface and emit only the code required
for those types. This is encapsulated in a new `TypeUniverse`
struct whose job is to maintain that whole-interface view of the
set of types in use.
2020-09-18 17:46:49 +10:00
Ryan Kelly f65aff7a59
Metadata cleanups for publishing on crates.io. 2020-09-11 10:02:04 +10:00
Edouard Oger 226754527e
Refactor uniffi structure 2020-08-06 21:45:03 -04:00