Javascript aggregation configuration always produce a minimized version. [0.7.0] #439

Closed
barjo opened this Issue Feb 13, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@barjo
Member

barjo commented Feb 13, 2015

For example, the following configuration will produce an output file that has been minimized.
If we skip google closure in the configuration, nothing is processed.

<javascript>
  <aggregations>
    <aggregation>
      <minification>true</minification>
      <files>
        <file>js/Hubu-Root</file>
        <file>js/Utils</file>
        <file>js/AbstractComponent</file>
        <file>js/Hubu-Eventing-Extension</file>
        <file>js/Hubu-Binding-Extension</file>
        <file>js/Hubu-SOC-Mechanism</file>
        <file>js/Hubu-SOC-Extension</file>
        <file>js/Hub</file>
        </files>
        <output>hubu-${project.version}.js</output>
      </aggregation>
  </aggregations>
</javascript>
@barjo

This comment has been minimized.

Show comment
Hide comment
@barjo

barjo Feb 13, 2015

Member

Maybe we could use the PRETTY_PRINT options of the google closure compiler to create the aggregated file without minimizing?

Member

barjo commented Feb 13, 2015

Maybe we could use the PRETTY_PRINT options of the google closure compiler to create the aggregated file without minimizing?

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Feb 13, 2015

Member

Yes, that's a good idea. Are you working on it ?

Member

cescoffier commented Feb 13, 2015

Yes, that's a good idea. Are you working on it ?

@cescoffier cescoffier added the bug label Feb 13, 2015

@cescoffier cescoffier added this to the 0.7.1 milestone Feb 13, 2015

@barjo

This comment has been minimized.

Show comment
Hide comment
@barjo

barjo Feb 13, 2015

Member

I plan to do something like this in the Javascript compiler mojo:

        if(!aggregation.isMinification()){ //Override the pretty print options if minification false
            getLog().info("Minification if false, Compilation Level is set to " + WHITESPACE_ONLY);
            WHITESPACE_ONLY.setOptionsForCompilationLevel(options);
            options.setPrettyPrint(true);
            options.setPrintInputDelimiter(true);
        } else {
            getLog().info("Compilation Level set to " + googleClosureCompilationLevel);
            googleClosureCompilationLevel.setOptionsForCompilationLevel(options);
            options.setPrettyPrint(googleClosurePrettyPrint);
            options.setPrintInputDelimiter(googleClosurePrettyPrint);
        }
Member

barjo commented Feb 13, 2015

I plan to do something like this in the Javascript compiler mojo:

        if(!aggregation.isMinification()){ //Override the pretty print options if minification false
            getLog().info("Minification if false, Compilation Level is set to " + WHITESPACE_ONLY);
            WHITESPACE_ONLY.setOptionsForCompilationLevel(options);
            options.setPrettyPrint(true);
            options.setPrintInputDelimiter(true);
        } else {
            getLog().info("Compilation Level set to " + googleClosureCompilationLevel);
            googleClosureCompilationLevel.setOptionsForCompilationLevel(options);
            options.setPrettyPrint(googleClosurePrettyPrint);
            options.setPrintInputDelimiter(googleClosurePrettyPrint);
        }
@barjo

This comment has been minimized.

Show comment
Hide comment
@barjo

barjo Feb 13, 2015

Member

An other options would be to only do an aggregation in that case, without using the Google Closure Compiler. That would have the advantage to preserve the comment and original syntax. I don't think it's really necessary thought.

Member

barjo commented Feb 13, 2015

An other options would be to only do an aggregation in that case, without using the Google Closure Compiler. That would have the advantage to preserve the comment and original syntax. I don't think it's really necessary thought.

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Feb 13, 2015

Member

I would prefer use Google Closure as it's more homogeneous with the current
way of doing things.

2015-02-13 9:33 GMT+01:00 Jonathan Bardin notifications@github.com:

An other options would be to only do an aggregation in that case, without
using the Google Closure Compiler. That would have the advantage to
preserve the comment and original syntax. I don't think it's really
necessary thought.


Reply to this email directly or view it on GitHub
#439 (comment)
.

Member

cescoffier commented Feb 13, 2015

I would prefer use Google Closure as it's more homogeneous with the current
way of doing things.

2015-02-13 9:33 GMT+01:00 Jonathan Bardin notifications@github.com:

An other options would be to only do an aggregation in that case, without
using the Google Closure Compiler. That would have the advantage to
preserve the comment and original syntax. I don't think it's really
necessary thought.


Reply to this email directly or view it on GitHub
#439 (comment)
.

@barjo barjo closed this in c8302bd Feb 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment