Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Issue 476583003: Allow dart2dart to output one file per library. (Closed)

Created:
6 years, 4 months ago by sigurdm
Modified:
6 years, 3 months ago
CC:
reviews_dartlang.org, Kevin Millikin (Google)
Visibility:
Public.

Description

Allow dart2dart to output one file per library. This is activated by the (undocumented) command line argument --output-type=dart-multi The files will be called $out.dart // main file $out.$lib.dart // from library lib.dart Where $out is what is specified in the --out= argument and $lib is a 'uniqueified' version of the library file name (directory structure is flattened). A library split in parts will be collected into one file. This is still untested. BUG= R=floitsch@google.com, jgruber@google.com, johnniwinther@google.com Committed: https://code.google.com/p/dart/source/detail?r=39694

Patch Set 1 #

Total comments: 28

Patch Set 2 : Address comments #

Patch Set 3 : Insert library-names in generateds libraries. Fix bug of previous upload #

Total comments: 10

Patch Set 4 : Address floitsch's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -41 lines) Patch
M sdk/lib/_internal/compiler/implementation/apiimpl.dart View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/compiler.dart View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart2js.dart View 1 2 chunks +5 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart View 1 2 3 7 chunks +102 lines, -17 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart_backend/dart_backend.dart View 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/deferred_load.dart View 1 2 3 2 chunks +1 line, -17 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/tree/unparser.dart View 1 1 chunk +13 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/util/util.dart View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
sigurdm
6 years, 4 months ago (2014-08-14 12:12:02 UTC) #1
jgruber1
lgtm https://codereview.chromium.org/476583003/diff/1/sdk/lib/_internal/compiler/implementation/apiimpl.dart File sdk/lib/_internal/compiler/implementation/apiimpl.dart (right): https://codereview.chromium.org/476583003/diff/1/sdk/lib/_internal/compiler/implementation/apiimpl.dart#newcode47 sdk/lib/_internal/compiler/implementation/apiimpl.dart:47: dart2dartMultiFile: !hasOption(options, '--output-type=dart'), Why the negative logic? If ...
6 years, 4 months ago (2014-08-15 06:20:53 UTC) #2
Johnni Winther
lgtm https://codereview.chromium.org/476583003/diff/1/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart File sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart (right): https://codereview.chromium.org/476583003/diff/1/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart#newcode29 sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:29: // file. Paraphrase to something like "If `true`, ...
6 years, 4 months ago (2014-08-15 08:07:31 UTC) #3
floitsch
DBC. https://codereview.chromium.org/476583003/diff/1/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart File sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart (right): https://codereview.chromium.org/476583003/diff/1/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart#newcode477 sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:477: names = names.sublist(0, names.length - 1); names is ...
6 years, 4 months ago (2014-08-15 11:59:36 UTC) #4
sigurdm
https://codereview.chromium.org/476583003/diff/1/sdk/lib/_internal/compiler/implementation/apiimpl.dart File sdk/lib/_internal/compiler/implementation/apiimpl.dart (right): https://codereview.chromium.org/476583003/diff/1/sdk/lib/_internal/compiler/implementation/apiimpl.dart#newcode47 sdk/lib/_internal/compiler/implementation/apiimpl.dart:47: dart2dartMultiFile: !hasOption(options, '--output-type=dart'), On 2014/08/15 06:20:53, jgruber wrote: > ...
6 years, 4 months ago (2014-08-15 13:31:42 UTC) #5
floitsch
LGTM. https://chromiumcodereview.appspot.com/476583003/diff/120001/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart File sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/476583003/diff/120001/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart#newcode494 sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:494: for(LibraryElement outputLibrary in userLibraries) { Add comment explaining ...
6 years, 3 months ago (2014-08-28 20:10:07 UTC) #6
sigurdm
Committed patchset #4 (id:140001) manually as 39694 (presubmit successful).
6 years, 3 months ago (2014-08-29 10:45:16 UTC) #7
sigurdm
6 years, 3 months ago (2014-09-03 08:24:16 UTC) #8
Message was sent while issue was closed.
Forgot to send all my "done"s

https://codereview.chromium.org/476583003/diff/120001/sdk/lib/_internal/compi...
File sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
(right):

https://codereview.chromium.org/476583003/diff/120001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:494:
for(LibraryElement outputLibrary in userLibraries) {
On 2014/08/28 20:10:07, floitsch wrote:
> Add comment explaining that you rewrite the import tags here.
Done.
> 
> Move into a different function?
Added a TODO

https://codereview.chromium.org/476583003/diff/120001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:543: //
TODO(sigurdm): Make the unparser output directly into the buffer instead
On 2014/08/28 20:10:06, floitsch wrote:
> Write comment before statement.

Done.

https://codereview.chromium.org/476583003/diff/120001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:548: //
TODO(sigurdm): What to do here? Probably we should get rid of
On 2014/08/28 20:10:06, floitsch wrote:
> Agreed.
> Until then we usually write the main unit into that string.

Done.

https://codereview.chromium.org/476583003/diff/120001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:559:
logResultBundleSizeInfo(topLevelElements);
On 2014/08/28 20:10:07, floitsch wrote:
> Can we do something similar?

Done.

https://codereview.chromium.org/476583003/diff/120001/sdk/lib/_internal/compi...
File sdk/lib/_internal/compiler/implementation/util/util.dart (right):

https://codereview.chromium.org/476583003/diff/120001/sdk/lib/_internal/compi...
sdk/lib/_internal/compiler/implementation/util/util.dart:171: // Adds the result
to usedNames.
On 2014/08/28 20:10:07, floitsch wrote:
> New line before.

Done.

Powered by Google App Engine
This is Rietveld 408576698