This repository has been archived by the owner on Jul 17, 2022. It is now read-only.
Adding support for ClosureBuilder and DepsWriter python tools #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Should be pretty self-explanatory. This improves support for Google Closure by incorporating the closurebuild.py and depswriter.py scripts into gradle tasks.
Details:
Builder:
In addition to simply combining the required files in order, you can also use the build task to compile the javascript code(task.compile = true, which is the default). Rather that passing the compiler jar file to closurebuilder, this dynamically creates a minifyJs task in order to reuse compiler options specified in the closure extension.
Library:
A 'getClosure' task is added which can retrieve the closure library (which contains the python scripts). The location for where to download the library is 'project.closure.library.location'. If that location exists, the getClosure task is skipped.
Extensions:
I changed the ClosureCompilerExtension to a ClosureExtension, which is completely backwards compatible in the DSL, but seperates the library and compiler configuration while containing them all inside the ClosureExtension.
Example:
I was not entirely clear on how the tests were organized, so I simply created a notepad.gradle config file for the added notepad.js file. If everything looks reasonable, I can commit changes to the Readme.md, too, but I wanted to get some feedback on things, first.