Skip to content

Commit

Permalink
Merge pull request #19 from fuzzybinary/fetch_dart
Browse files Browse the repository at this point in the history
feat: Fetch dart from the artifacts of `dart_shared_library`
  • Loading branch information
fuzzybinary authored Oct 14, 2024
2 parents f361ccb + f22de56 commit 2f6b9f7
Show file tree
Hide file tree
Showing 33 changed files with 1,641 additions and 4,665 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
- run: dart pub get
working-directory: ./tools/binding_generator
- run: dart pub get
working-directory: ./tools/fetch_dart
- name: Fetch latest dart_shared_library
run: |
dart ./tools/fetch_dart/bin/fetch_dart.dart --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Shared Library
run: |
cmake -DCMAKE_BUILD_TYPE=Release . -B "build"
Expand All @@ -45,9 +52,17 @@ jobs:
continue-on-error: false
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- uses: actions/download-artifact@v3
with:
path: artifacts
- run: dart pub get
working-directory: ./tools/fetch_dart
- name: Fetch latest dart_shared_library
run: |
dart ./tools/fetch_dart/bin/fetch_dart.dart --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Create extension"
run: |
mkdir -p out/extension
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ src/cpp/.build
build/
**/.DS_Store
src/dart/godot_dart_build/.dart_tool
*.TMP
src/dart_dll/bin/*
src/dart_dll/include/*
15 changes: 11 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ The rest of this document helps me / you understand how to build the extension.

### Updating the Dart SDK

Currently, the Dart SDK dynamic libraries are included in the repo, currently using Dart 3.5. You can
update this by building the
The Dart SDK dynamic libraries must be downloaded before you can work with this repo. There is a Dart
script to do this in `tools/fetch_dart`.

```bash
# From the root of the repo:
dart ./tools/fetch_dart/bin/fetch_dart.dart
```

You can manually update the version of dart by building the
[dart_shared_library](https:/fuzzybinary/dart_shared_library) repo
and copying files to `src/dart_skk/bin` directory. Alternately, you can get the artifacts compiled
from the Github action on each release.
and adding the `--local` parameter to the script. Note this will only copy the
current platform's dynamic library to the destination.

### Updating FFI Bindings

Expand Down
4 changes: 2 additions & 2 deletions example/2d_tutorial/main.tscn

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion example/2d_tutorial/src/lib/hud.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class Hud extends CanvasLayer {
showMessage('Game Over');

var messageTimer = getNodeT<Timer>('MessageTimer');
// TODO: Generate constants for object signals
await toSignal(messageTimer!, 'timeout');

var message = getNodeT<Label>('Message');
Expand Down
4 changes: 2 additions & 2 deletions example/2d_tutorial/src/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ packages:
path: "../../../src/dart/godot_dart"
relative: true
source: path
version: "0.1.1"
version: "0.3.0"
godot_dart_build:
dependency: "direct dev"
description:
path: "../../../src/dart/godot_dart_build"
relative: true
source: path
version: "0.1.0"
version: "0.2.0"
graphs:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/2d_tutorial/src/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
publish_to: none

environment:
sdk: '>=3.0.0 <4.0.0'
sdk: '>=3.2.0 <4.0.0'

dependencies:
ffi: ^2.0.1
Expand Down
Loading

0 comments on commit 2f6b9f7

Please sign in to comment.