Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Dart 2.13 #315

Merged
merged 9 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/dart_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ jobs:
run: dart pub run dependency_validator -i build_runner,build_test,build_web_compilers,meta
if: always() && steps.install.outcome == 'success'

# TODO: Uncomment this, and remove the Dart 2.7.2 format step in the Workiva Build Dockerfile
# once we are able to bump the lower bound of SDK.
# - name: Verify formatting
# run: dart format --output=none --line-length=120 --set-exit-if-changed .
# if: always() && ${{ matrix.sdk }} == 'stable' && steps.install.outcome == 'success'
- name: Verify formatting
run: dart format --output=none --line-length=120 --set-exit-if-changed .
if: always() && ${{ matrix.sdk }} == 'stable' && steps.install.outcome == 'success'

- name: Analyze project source
run: dart analyze
Expand Down
58 changes: 3 additions & 55 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,4 @@
FROM drydock-prod.workiva.net/workiva/dart_build_image:1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can remove all of this - afaik, we at least need a stage that runs pub get so that workiva-build can scrape the pubspec.lock for auditing and dep tracking purposes


# Chrome install adapted from https://github.com/Workiva/dart_unit_test_image/blob/master@%7B13-01-2021%7D/Dockerfile
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \
apt-get -qq update && apt-get install -y google-chrome-stable && \
mv /usr/bin/google-chrome-stable /usr/bin/google-chrome && \
sed -i --follow-symlinks -e 's/\"\$HERE\/chrome\"/\"\$HERE\/chrome\" --no-sandbox/g' /usr/bin/google-chrome

# TODO: Remove this and instead run it within the github actions CI on the stable channel once SDK lower bound is >=2.9.3
RUN dartfmt --line-length=120 --dry-run --set-exit-if-changed .

# TODO: Remove these test runs once SDK lower bound is >=2.9.3
RUN pub run build_runner test --release -- --preset dart2js --exclude-tags=dart-2-7-dart2js-variadic-issues
RUN pub run build_runner test -- --preset dartdevc

# We need 2.9.2 to verify the Chrome MemoryInfo workaround: https://github.com/cleandart/react-dart/pull/280
# TODO remove the workaround as well as this config once SDK lower bound is >=2.9.3
FROM google/dart:2.9.2
RUN dart --version

# Don't allow the dart package to be updated via apt
RUN apt-mark hold dart

# Update image - required by aviary
RUN apt-get update -qq && \
apt-get dist-upgrade -y && \
apt-get autoremove -y && \
apt-get clean all
# Install deps for Chrome install
RUN apt-get install -y \
build-essential \
curl \
git \
make \
parallel \
wget \
&& rm -rf /var/lib/apt/lists/*

# Chrome install adapted from https://github.com/Workiva/dart_unit_test_image/blob/master@%7B13-01-2021%7D/Dockerfile
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \
apt-get -qq update && apt-get install -y google-chrome-stable && \
mv /usr/bin/google-chrome-stable /usr/bin/google-chrome && \
sed -i --follow-symlinks -e 's/\"\$HERE\/chrome\"/\"\$HERE\/chrome\" --no-sandbox/g' /usr/bin/google-chrome

WORKDIR /build/
ADD . /build/

RUN pub get
# Run DDC tests to verify Chrome workaround
RUN pub run build_runner test -- --preset dartdevc
# Run dart2js tests that fail in 2.7
RUN pub run build_runner test --release -- --preset dart2js --tags=dart-2-7-dart2js-variadic-issues

FROM google/dart:2.13
COPY pubspec.yaml .
RUN dart pub get
FROM scratch
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dev_dependencies:
args: ^1.5.1
build_runner: ^1.6.5
build_test: ^0.10.8
build_web_compilers: ^2.1.4
build_web_compilers: ^2.12.0
dependency_validator: ^1.2.0
matcher: ^0.12.5
mockito: ">=4.1.1 <6.0.0"
Expand Down
6 changes: 5 additions & 1 deletion test/lifecycle_test/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ mixin LifecycleTestHelper on Component {
'context': context,
});

var lifecycleCallback = props == null ? staticProps == null ? null : staticProps[memberName] : props[memberName];
var lifecycleCallback = props == null
? staticProps == null
? null
: staticProps[memberName]
: props[memberName];
if (lifecycleCallback != null) {
return Function.apply(
lifecycleCallback,
Expand Down