Skip to content

Commit

Permalink
Initial Dart backend (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian authored Nov 2, 2023
1 parent 0958a62 commit 72bbae4
Show file tree
Hide file tree
Showing 19 changed files with 2,905 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ example/cpp/docs/source/** linguist-generated=true
example/cpp2/include/** linguist-generated=true
example/js/lib/api/** linguist-generated=true
example/js/lib/docs/source/**
example/dart/lib/** linguist-generated=true

feature_tests/c/include/** linguist-generated=true
feature_tests/c2/include/** linguist-generated=true
Expand All @@ -14,3 +15,4 @@ feature_tests/cpp2/include/** linguist-generated=true
feature_tests/js/api/** linguist-generated=true
feature_tests/js/docs/source/** linguist-generated=true
feature_tests/dotnet/Lib/** linguist-generated=true
feature_tests/dart/lib/** linguist-generated=true
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
with:
crate: cargo-make
version: latest
- uses: dart-lang/setup-dart@v1

- name: Run regeneration
run: cargo make gen
Expand Down
35 changes: 35 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ dependencies = [
"test-wasm-example-app",
"test-wasm-feature",
]
[tasks.test-dart]
category = "Tests"
dependencies = [
"test-dart-example",
"test-dart-example-app",
"test-dart-feature",
]
[tasks.test-example]
category = "Tests"
dependencies = [
Expand All @@ -70,6 +77,7 @@ dependencies = [
"test-c-example",
"test-c2-example",
"test-wasm-example",
"test-dart-example",
]

[tasks.test-feature]
Expand All @@ -78,6 +86,7 @@ dependencies = [
"test-cpp-feature",
"test-cpp2-feature",
"test-wasm-feature",
"test-dart-feature",
]

[tasks.test-cpp-example]
Expand Down Expand Up @@ -221,6 +230,7 @@ dependencies = [
"gen-feature-c2",
"gen-feature-js",
"gen-feature-dotnet",
"gen-feature-dart",
]

[tasks.gen-examples]
Expand All @@ -231,6 +241,7 @@ dependencies = [
"gen-examples-c",
"gen-examples-c2",
"gen-examples-js",
"gen-examples-dart",
]
[tasks.gen-cpp]
category = "Code generation"
Expand Down Expand Up @@ -267,6 +278,12 @@ category = "Code generation"
dependencies = [
"gen-feature-dotnet",
]
[tasks.gen-dart]
category = "Code generation"
dependencies = [
"gen-feature-dart",
"gen-examples-dart",
]



Expand Down Expand Up @@ -370,6 +387,24 @@ exit_on_error true
generate_generic feature_tests dotnet Lib/Generated "" "-l dotnet/dotnet-interop-conf.toml"
'''

[tasks.gen-feature-dart]
category = "Code generation"
script_runner = "@duckscript"
script = '''
exit_on_error true
!include_files ./support/functions.ds
generate_generic feature_tests dart lib
'''

[tasks.gen-examples-dart]
category = "Code generation"
script_runner = "@duckscript"
script = '''
exit_on_error true
!include_files ./support/functions.ds
generate_generic example dart lib
'''

# Build deps

[tasks.build-tool]
Expand Down
279 changes: 279 additions & 0 deletions example/dart/lib/lib.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 72bbae4

Please sign in to comment.