Skip to content

Commit 1b102ea

Browse files
authored
Split packages on Travis (#307)
* Run each package in it's on Travis job * Check dartfmt of each package * Only build on the master branch * Cache packages * dartfmt all files
1 parent 0e22b45 commit 1b102ea

File tree

6 files changed

+29
-31
lines changed

6 files changed

+29
-31
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,18 @@ dart:
44
- dev
55
- stable
66

7+
env:
8+
- PKG=build_test
9+
- PKG=build
10+
- PKG=build_runner
11+
- PKG=build_barback
12+
713
script: ./tool/travis.sh
14+
15+
# Only building master means that we don't run two builds for each pull request.
16+
branches:
17+
only: [master]
18+
19+
cache:
20+
directories:
21+
- $HOME/.pub-cache

build/lib/src/builder/build_step.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ abstract class BuildStep implements AssetReader, AssetWriter {
4949
/// Future since the runner will be responsible for waiting until all outputs
5050
/// are written.
5151
@override
52-
Future writeAsString(AssetId id, FutureOr<String> contents, {Encoding encoding: UTF8});
52+
Future writeAsString(AssetId id, FutureOr<String> contents,
53+
{Encoding encoding: UTF8});
5354

5455
@Deprecated('Use `canRead` instead')
5556
Future<bool> hasInput(AssetId id);

build_barback/test/analyzer/resolver_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ class TestBuilder extends Builder {
303303
TestBuilder(this.validator);
304304

305305
@override
306-
final buildExtensions = const {'': const ['.unused']};
306+
final buildExtensions = const {
307+
'': const ['.unused']
308+
};
307309

308310
@override
309311
Future build(BuildStep buildStep) async {

build_runner/lib/src/generate/watch_impl.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ class WatchImpl {
126126
}
127127

128128
_logger.info('Starting next build');
129-
_currentBuild =
130-
_buildImpl.runBuild(updates: updatedInputs);
129+
_currentBuild = _buildImpl.runBuild(updates: updatedInputs);
131130
_currentBuild.then((result) {
132131
// Terminate the watcher if the build script is updated, there is no
133132
// need to continue listening.

build_runner/test/asset/file_based_test.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@ void main() {
3636

3737
test('can check for existence of any application package files', () async {
3838
expect(await reader.canRead(makeAssetId('basic_pkg|hello.txt')), isTrue);
39-
expect(await reader.canRead(makeAssetId('basic_pkg|lib/hello.txt')),
40-
isTrue);
41-
expect(await reader.canRead(makeAssetId('basic_pkg|web/hello.txt')),
42-
isTrue);
39+
expect(
40+
await reader.canRead(makeAssetId('basic_pkg|lib/hello.txt')), isTrue);
41+
expect(
42+
await reader.canRead(makeAssetId('basic_pkg|web/hello.txt')), isTrue);
4343

4444
expect(await reader.canRead(makeAssetId('basic_pkg|a.txt')), isFalse);
45-
expect(
46-
await reader.canRead(makeAssetId('basic_pkg|lib/a.txt')), isFalse);
45+
expect(await reader.canRead(makeAssetId('basic_pkg|lib/a.txt')), isFalse);
4746
});
4847

4948
test('can check for existence of package dependency files in lib',

tool/travis.sh

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,8 @@
77
# Fast fail the script on failures.
88
set -e
99

10-
pushd build_test
10+
pushd $PKG
1111
pub upgrade
12-
dartanalyzer --fatal-warnings lib/build_test.dart
13-
popd
14-
15-
pushd build
16-
pub upgrade
17-
dartanalyzer --fatal-warnings lib/build.dart
18-
pub run test
19-
popd
20-
21-
pushd build_runner
22-
pub upgrade
23-
dartanalyzer --fatal-warnings lib/build_runner.dart
24-
pub run test
25-
popd
26-
27-
pushd build_barback
28-
pub upgrade
29-
dartanalyzer --fatal-warnings lib/build_barback.dart
30-
pub run test
31-
popd
12+
dartanalyzer --fatal-warnings .
13+
echo Any unformatted files?
14+
dartfmt -n --set-exit-if-changed .

0 commit comments

Comments
 (0)