Skip to content

Commit

Permalink
fix(aft): Submodule libgit2dart
Browse files Browse the repository at this point in the history
Adds workaround for dart-lang/pub#3563 which requires using Flutter's `dart` command if a package lists a Flutter SDK constraint even if the package does not depend on Flutter.
  • Loading branch information
dnys1 committed Dec 18, 2022
1 parent ae1ff5c commit 40c1ad0
Show file tree
Hide file tree
Showing 15 changed files with 138 additions and 24 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/aft.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# Generated with aft. To update, run: `aft generate workflows`
name: aft
on:
push:
branches:
- main
- stable
- next
paths:
- 'packages/aft/**/*.dart'
pull_request:
paths:
- 'packages/aft/**/*.dart'
- 'packages/aft/**/*.yaml'
- 'packages/aft/lib/**/*'
- 'packages/aft/test/**/*'
- '.github/workflows/dart_vm.yaml'
- '.github/workflows/dart_native.yaml'
- '.github/workflows/aft.yaml'
schedule:
- cron: "0 0 * * 0" # Every Sunday at 00:00
defaults:
Expand All @@ -24,12 +19,29 @@ permissions: read-all

jobs:
test:
uses: ./.github/workflows/dart_vm.yaml
with:
working-directory: packages/aft
native_test:
if: ${{ github.event_name == 'push' }}
needs: test
uses: ./.github/workflows/dart_native.yaml
with:
working-directory: packages/aft
name: Test
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0

- name: Git Submodules
run: git submodule update --init

- name: Setup Dart
uses: dart-lang/setup-dart@196f54580e9eee2797c57e85e289339f85e6779d # main
with:
sdk: stable

- name: Get Packages
working-directory: packages/aft
run: |
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563)
( cd /external/libgit2dart; git apply ../libgit2dart.patch )
dart pub upgrade
sudo apt-get install libgit2-dev
dart run libgit2dart:setup
- name: Run Tests
working-directory: packages/aft
run: dart test
2 changes: 1 addition & 1 deletion .github/workflows/amplify_authenticator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- '.github/workflows/flutter_vm.yaml'
- '.github/workflows/amplify_authenticator.yaml'
schedule:
- cron: '0 0 * * 0' # Every Sunday at 00:00
- cron: "0 0 * * 0" # Every Sunday at 00:00
defaults:
run:
shell: bash
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/dart_dart2js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ jobs:
sdk: ${{ matrix.sdk }}

- name: Setup aft
run: dart pub global activate -spath packages/aft
run: |
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563)
( cd packages/aft/external/libgit2dart; git apply ../libgit2dart.patch )
dart pub global activate -spath packages/aft
- name: Setup Firefox
if: ${{ matrix.browser == 'firefox' }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/dart_ddc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ jobs:
sdk: ${{ matrix.sdk }}

- name: Setup aft
run: dart pub global activate -spath packages/aft
run: |
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563)
( cd packages/aft/external/libgit2dart; git apply ../libgit2dart.patch )
dart pub global activate -spath packages/aft
- name: Setup Firefox
if: ${{ matrix.browser == 'firefox' }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/dart_native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ jobs:
sdk: stable

- name: Setup aft
run: dart pub global activate -spath packages/aft
run: |
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563)
( cd packages/aft/external/libgit2dart; git apply ../libgit2dart.patch )
dart pub global activate -spath packages/aft
- name: Bootstrap
id: bootstrap
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/dart_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ jobs:
sdk: ${{ matrix.sdk }}

- name: Setup aft
run: dart pub global activate -spath packages/aft
run: |
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563)
( cd packages/aft/external/libgit2dart; git apply ../libgit2dart.patch )
dart pub global activate -spath packages/aft
- name: Bootstrap
id: bootstrap
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/smoke_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ jobs:
- name: Git Checkout
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0

- name: Git Submodules
run: git submodule update --init

- name: Setup Dart
uses: dart-lang/setup-dart@196f54580e9eee2797c57e85e289339f85e6779d # main
with:
sdk: stable

- name: Link Packages
run: |
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563)
( cd packages/aft/external/libgit2dart; git apply ../libgit2dart.patch )
dart pub global activate -spath packages/aft
aft link
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
path = packages/smithy/goldens/smithy
url = https://github.com/awslabs/smithy.git
branch = main
[submodule "packages/aft/external/libgit2dart"]
path = packages/aft/external/libgit2dart
url = https://github.com/SkinnyMind/libgit2dart.git
1 change: 1 addition & 0 deletions aft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies:
# Packages to ignore in all repo operations.
ignore:
- synthetic_package
- libgit2dart

# Strongly connected components which should have version bumps happen
# in unison, i.e. a version bump to one package cascades to all.
Expand Down
1 change: 1 addition & 0 deletions packages/aft/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ analyzer:
public_member_api_docs: ignore
exclude:
- '**/*.g.dart'
- external/
1 change: 1 addition & 0 deletions packages/aft/external/libgit2dart
Submodule libgit2dart added at 34d492
29 changes: 29 additions & 0 deletions packages/aft/external/libgit2dart.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/pubspec.yaml b/pubspec.yaml
index 5acda72..2831e58 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -8,7 +8,6 @@ homepage: https://github.com/SkinnyMind/libgit2dart

environment:
sdk: ">=2.18.0 <3.0.0"
- flutter: ">=3.3.0"

dependencies:
args: ^2.3.0
@@ -23,16 +22,6 @@ dev_dependencies:
lints: ^2.0.0
test: ^1.20.0

-flutter:
- plugin:
- platforms:
- linux:
- pluginClass: Libgit2dartPlugin
- macos:
- pluginClass: Libgit2dartPlugin
- windows:
- pluginClass: Libgit2dartPlugin
-
ffigen:
output: "lib/src/bindings/libgit2_bindings.dart"
headers:
4 changes: 1 addition & 3 deletions packages/aft/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ dependencies:
http: ^0.13.0
json_annotation: ^4.7.0
libgit2dart:
git:
url: https://github.com/SkinnyMind/libgit2dart
ref: d55742d6d7725fa190df0caf3c1cbe60b7b481aa
path: external/libgit2dart
markdown: ^5.0.0
meta: ^1.7.0
path: any
Expand Down
47 changes: 47 additions & 0 deletions packages/aft/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: aft
on:
push:
branches:
- main
- stable
- next
paths:
- 'packages/aft/**/*.dart'
pull_request:
paths:
- 'packages/aft/**/*.dart'
schedule:
- cron: "0 0 * * 0" # Every Sunday at 00:00
defaults:
run:
shell: bash
permissions: read-all

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0

- name: Git Submodules
run: git submodule update --init

- name: Setup Dart
uses: dart-lang/setup-dart@196f54580e9eee2797c57e85e289339f85e6779d # main
with:
sdk: stable

- name: Get Packages
working-directory: packages/aft
run: |
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563)
( cd /external/libgit2dart; git apply ../libgit2dart.patch )
dart pub upgrade
sudo apt-get install libgit2-dev
dart run libgit2dart:setup
- name: Run Tests
working-directory: packages/aft
run: dart test
5 changes: 5 additions & 0 deletions packages/aws_sdk/smoke_test/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ jobs:
- name: Git Checkout
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0

- name: Git Submodules
run: git submodule update --init

- name: Setup Dart
uses: dart-lang/setup-dart@196f54580e9eee2797c57e85e289339f85e6779d # main
with:
sdk: stable

- name: Link Packages
run: |
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563)
( cd packages/aft/external/libgit2dart; git apply ../libgit2dart.patch )
dart pub global activate -spath packages/aft
aft link
Expand Down

0 comments on commit 40c1ad0

Please sign in to comment.