-
Notifications
You must be signed in to change notification settings - Fork 211
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
Adds support for config specific imports #1793
Changes from all commits
2116282
37be3e7
5b2b037
fc64c7d
8c6ad07
d838603
86e89ca
eecc7ab
6e34ded
5d24573
bd18154
d20f8e3
57f0005
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
String get message => 'Hello World from Javascript!'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
String get message => 'Hello World from the VM!'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:test/test.dart'; | ||
|
||
// ignore: uri_does_not_exist | ||
import 'common/message.dart' | ||
// ignore: uri_does_not_exist | ||
if (dart.library.io) 'common/message_io.dart' | ||
// ignore: uri_does_not_exist | ||
if (dart.library.html) 'common/message_html.dart'; | ||
|
||
main() { | ||
test('Message matches expected', () { | ||
if (1.0 is int) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We really need to provide support for this in a better way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ya, its really weird how the |
||
expect(message, contains('Javascript')); | ||
} else { | ||
expect(message, contains('VM')); | ||
} | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
## 0.4.0 | ||
|
||
### Improvements | ||
|
||
- Modules are now platform specific, and config specific imports using | ||
`dart.library.*` constants are supported. | ||
|
||
### Breaking Configuration Changes | ||
|
||
- Module granularity now has to be configured per platform, so instead of | ||
configuring it using the `build_modules|modules` builder, you now need to | ||
configure the builder for each specific platform: | ||
|
||
```yaml | ||
targets: | ||
$default: | ||
build_modules|dartdevc: | ||
options: | ||
strategy: fine | ||
``` | ||
|
||
The supported platforms are currently `dart2js`, `dartdevc`, and `vm`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why don't we support flutter? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it can't be discovered in the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Boo |
||
|
||
### Breaking API Changes | ||
|
||
- Output extensions of builders have changed to include the platform being built | ||
for. | ||
- All the top level file extension getters are now methods that take a | ||
platform and return the extension for that platform. | ||
- Most builders are no longer applied by default, you must manually apply them | ||
using applies_builders in your builder. | ||
- Most builder constructors now require a `platform` argument. | ||
|
||
## 0.3.2 | ||
|
||
- Module strategies are now respected for all packages instead of just the root | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,67 @@ | ||
builders: | ||
modules: | ||
module_library: | ||
import: "package:build_modules/builders.dart" | ||
builder_factories: | ||
- moduleLibraryBuilder | ||
- metaModuleBuilder | ||
- metaModuleCleanBuilder | ||
- moduleBuilder | ||
- unlinkedSummaryBuilder | ||
- linkedSummaryBuilder | ||
build_extensions: | ||
$lib$: | ||
- .meta_module.raw | ||
- .meta_module.clean | ||
.dart: | ||
- .module.library | ||
- .module | ||
- .linked.sum | ||
- .unlinked.sum | ||
is_optional: True | ||
auto_apply: all_packages | ||
is_optional: True | ||
required_inputs: [".dart"] | ||
applies_builders: ["|module_cleanup"] | ||
dartdevc: | ||
import: "package:build_modules/builders.dart" | ||
builder_factories: | ||
- metaModuleBuilderFactoryForPlatform('dartdevc') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [aside] If we had union types I would totally make the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, would clean this up a bunch |
||
- metaModuleCleanBuilderFactoryForPlatform('dartdevc') | ||
- moduleBuilderFactoryForPlatform('dartdevc') | ||
- unlinkedSummaryBuilderForPlatform('dartdevc') | ||
- linkedSummaryBuilderForPlatform('dartdevc') | ||
build_extensions: | ||
$lib$: | ||
- .dartdevc.meta_module.raw | ||
- .dartdevc.meta_module.clean | ||
.dart: | ||
- .dartdevc.module | ||
- .dartdevc.linked.sum | ||
- .dartdevc.unlinked.sum | ||
is_optional: True | ||
auto_apply: none | ||
required_inputs: [".dart", ".module.library"] | ||
applies_builders: ["|module_cleanup"] | ||
dart2js: | ||
import: "package:build_modules/builders.dart" | ||
builder_factories: | ||
- metaModuleBuilderFactoryForPlatform('dart2js') | ||
- metaModuleCleanBuilderFactoryForPlatform('dart2js') | ||
- moduleBuilderFactoryForPlatform('dart2js') | ||
build_extensions: | ||
$lib$: | ||
- .dart2js.meta_module.raw | ||
- .dart2js.meta_module.clean | ||
.dart: | ||
- .dart2js.module | ||
is_optional: True | ||
auto_apply: none | ||
required_inputs: [".dart", ".module.library"] | ||
applies_builders: ["|module_cleanup"] | ||
vm: | ||
import: "package:build_modules/builders.dart" | ||
builder_factories: | ||
- metaModuleBuilderFactoryForPlatform('vm') | ||
- metaModuleCleanBuilderFactoryForPlatform('vm') | ||
- moduleBuilderFactoryForPlatform('vm') | ||
build_extensions: | ||
$lib$: | ||
- .vm.meta_module.raw | ||
- .vm.meta_module.clean | ||
.dart: | ||
- .vm.module | ||
is_optional: True | ||
auto_apply: none | ||
required_inputs: [".dart", ".module.library"] | ||
applies_builders: ["|module_cleanup"] | ||
post_process_builders: | ||
module_cleanup: | ||
import: "package:build_modules/builders.dart" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we always going to need these ignore comments? That's quite annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See dart-lang/sdk#34177