Skip to content

Commit

Permalink
Merge pull request #122 from wiredashio/nnbd
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy authored Mar 1, 2021
2 parents 0450c01 + 7625648 commit 4dedba2
Show file tree
Hide file tree
Showing 74 changed files with 743 additions and 1,263 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Nightly

on:
workflow_dispatch:
schedule:
# Every night at 03:00
- cron: '0 3 * * *'
Expand Down Expand Up @@ -28,8 +29,8 @@ jobs:
image: cirrusci/flutter:beta
steps:
- uses: actions/[email protected]
with:
ref: beta
with:
ref: beta
- name: Download dependencies
run: sudo --preserve-env=PATH env flutter packages get
- name: Analyze
Expand All @@ -43,8 +44,8 @@ jobs:
image: cirrusci/flutter:dev
steps:
- uses: actions/[email protected]
with:
ref: dev
with:
ref: dev
- name: Download dependencies
run: sudo --preserve-env=PATH env flutter packages get
- name: Analyze
Expand Down
79 changes: 63 additions & 16 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,71 @@ on:
pull_request:
push:
branches:
- master
- stable
- beta
- dev

jobs:
build:
pr-stable:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ["stable", "beta", "dev", "master"]
container:
image: cirrusci/flutter:${{ matrix.version }}
image: cirrusci/flutter:stable
if: github.base_ref == 'stable' || github.ref == 'refs/heads/stable'
steps:
- uses: actions/[email protected]
- name: Download dependencies
run: sudo --preserve-env=PATH env flutter packages get
- name: Check formatting
run: sudo --preserve-env=PATH env dartfmt --dry-run --set-exit-if-changed lib
- name: Analyze
run: sudo --preserve-env=PATH env dartanalyzer --fatal-infos --fatal-warnings lib
- name: Test
run: sudo --preserve-env=PATH env flutter test --no-sound-null-safety
- uses: actions/[email protected]
- name: Download dependencies
run: sudo --preserve-env=PATH env flutter packages get
- name: Check formatting
run: sudo --preserve-env=PATH env dartfmt --dry-run --set-exit-if-changed lib
- name: Analyze
run: sudo --preserve-env=PATH env dartanalyzer --fatal-infos --fatal-warnings lib
- name: Test
run: sudo --preserve-env=PATH env flutter test --no-sound-null-safety

pr-beta:
runs-on: ubuntu-latest
container:
image: cirrusci/flutter:beta
if: github.base_ref == 'beta' || github.ref == 'refs/heads/beta'
steps:
- uses: actions/[email protected]
- name: Download dependencies
run: sudo --preserve-env=PATH env flutter packages get
- name: Check formatting
run: sudo --preserve-env=PATH env dartfmt --dry-run --set-exit-if-changed lib
- name: Analyze
run: sudo --preserve-env=PATH env flutter analyze --fatal-infos --fatal-warnings lib
- name: Test
run: sudo --preserve-env=PATH env flutter test --no-sound-null-safety

pr-dev:
runs-on: ubuntu-latest
container:
image: cirrusci/flutter:dev
if: github.base_ref == 'dev' || github.ref == 'refs/heads/dev'
steps:
- uses: actions/[email protected]
- name: Download dependencies
run: sudo --preserve-env=PATH env flutter packages get
- name: Check formatting
run: sudo --preserve-env=PATH env dartfmt --dry-run --set-exit-if-changed lib
- name: Analyze
run: sudo --preserve-env=PATH env flutter analyze --fatal-infos --fatal-warnings lib
- name: Test
run: sudo --preserve-env=PATH env flutter test --no-sound-null-safety

pr-master:
runs-on: ubuntu-latest
container:
image: cirrusci/flutter:master
if: github.base_ref == 'dev' || github.ref == 'refs/heads/dev'
steps:
- uses: actions/[email protected]
- name: Download dependencies
run: flutter packages get
- name: Check formatting
run: dartfmt --dry-run --set-exit-if-changed lib
- name: Analyze
run: flutter analyze --fatal-infos --fatal-warnings lib
- name: Test
run: flutter test --no-sound-null-safety
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.6.0 - Nullsafety
* Migrate the sdk to nullsafety. No breaking changes except for raising the Dart SDK to 2.12.0-0.

## 0.5.0 - SingletonFlutterWindow
* *Breaking* Replace references to `ui.Window` with the new `SingletonFlutterWindow` [`flutter/pull/69617`](https://github.com/flutter/flutter/pull/69617)
* Raise minimum Flutter version to `1.24.0-8.0.pre.341` where the breaking change was introduced
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ name: your_flutter_app
dependencies:
flutter:
sdk: flutter
wiredash: ^0.4.0
wiredash: ^0.6.0
```
### 3. Wrap your root widget with Wiredash
Expand Down
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Commit changes
- Tag release `vX.Y.Z` and push it
- `pub publish`
- Update/Move the `stable`, `beta` and `dev` branches
- Copy paste release notes into github release
- Update latest SDK version in `console`
- Announce release on Twitter 🎉
4 changes: 2 additions & 2 deletions example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818
channel: stable
revision: 79b49b9e1057f90ebf797725233c6b311722de69
channel: dev

project_type: app
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.10.0
COCOAPODS: 1.10.1
10 changes: 5 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void main() {
}

class WiredashExampleApp extends StatefulWidget {
const WiredashExampleApp({Key key}) : super(key: key);
const WiredashExampleApp({Key? key}) : super(key: key);

@override
_WiredashExampleAppState createState() => _WiredashExampleAppState();
Expand Down Expand Up @@ -93,7 +93,7 @@ class _WiredashExampleAppState extends State<WiredashExampleApp> {
}

class _HomePage extends StatelessWidget {
const _HomePage({Key key}) : super(key: key);
const _HomePage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -115,7 +115,7 @@ class _HomePage extends StatelessWidget {
/// Wiredash.of(context).show()
/// Since the `Wiredash` widget is at the root of the widget tree this
/// method can be accessed from anywhere in the code.
onPressed: Wiredash.of(context).show,
onPressed: Wiredash.of(context)!.show,
child: Icon(Icons.feedback_outlined),
),
);
Expand All @@ -134,8 +134,8 @@ class _HomePage extends StatelessWidget {

class _DetailsPage extends StatelessWidget {
const _DetailsPage({
Key key,
@required this.index,
Key? key,
required this.index,
}) : super(key: key);

final int index;
Expand Down
2 changes: 1 addition & 1 deletion example/macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
2 changes: 1 addition & 1 deletion example/macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
76 changes: 17 additions & 59 deletions example/macos/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,74 +9,32 @@ project 'Runner', {
'Release' => :release,
}

def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
end

def pubspec_supports_macos(file)
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return false;
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
File.foreach(file_abs_path) { |line|
return true if line =~ /^\s*macos:/
}
return false
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
ephemeral_dir = File.join('Flutter', 'ephemeral')
symlink_dir = File.join(ephemeral_dir, '.symlinks')
symlink_plugins_dir = File.join(symlink_dir, 'plugins')
system("rm -rf #{symlink_dir}")
system("mkdir -p #{symlink_plugins_dir}")
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end

# Flutter Pods
generated_xcconfig = parse_KV_file(File.join(ephemeral_dir, 'Flutter-Generated.xcconfig'))
if generated_xcconfig.empty?
puts "Flutter-Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
generated_xcconfig.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join(symlink_dir, 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'FlutterMacOS', :path => File.join(symlink, File.basename(p[:path]))
end
}

# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join(symlink_plugins_dir, p[:name])
File.symlink(p[:path], symlink)
if pubspec_supports_macos(File.join(symlink, 'pubspec.yaml'))
pod p[:name], :path => File.join(symlink, 'macos')
end
}
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
24 changes: 4 additions & 20 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
PODS:
- FlutterMacOS (1.0.0)
- path_provider (0.0.1)
- path_provider_macos (0.0.1):
- FlutterMacOS
- shared_preferences (0.0.1)
- shared_preferences_macos (0.0.1):
- FlutterMacOS
- wiredash (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`)
- path_provider (from `Flutter/ephemeral/.symlinks/plugins/path_provider/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
- shared_preferences (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences/macos`)
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`)
- wiredash (from `Flutter/ephemeral/.symlinks/plugins/wiredash/macos`)

EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral/.symlinks/flutter/darwin-x64
path_provider:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider/macos
:path: Flutter/ephemeral
path_provider_macos:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
shared_preferences:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences/macos
shared_preferences_macos:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos
wiredash:
:path: Flutter/ephemeral/.symlinks/plugins/wiredash/macos

SPEC CHECKSUMS:
FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9
path_provider: e0848572d1d38b9a7dd099e79cf83f5b7e2cde9f
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b
shared_preferences: 9fec34d1bd906196a4da48fcf6c3ad521cc00b8d
shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e
wiredash: 6716c78d9f6a953c9a2bb95105145f58e5fc955e

PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c

COCOAPODS: 1.10.0
Loading

0 comments on commit 4dedba2

Please sign in to comment.