-
Notifications
You must be signed in to change notification settings - Fork 97
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
FLUID-5978: Infusion build distributions #760
Conversation
Creates a "dist" directory containing pre-built versions of infusion based on configuration defined in the distributions grunt task. Note: that dist only contains files that are processed by a builid. Other files should be sourced from the src directory. Still need to copy over the css files generated by Stylus.
|
||
var concatTask = options.compress ? "uglify:" : "concat:"; | ||
var tasks = [ | ||
"clean:build", |
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.
Thanks, @jobara - this pull looks generally good. Whilst we are touching the build scripts in this area, I thought it might be appropriate to fix up our clean:build strategy a little more:
Since we merged in #720 I feel we've gone from deleting too much build junk to deleting too little. We now accumulate an entire copy of the all the frameworks's JS source in build/ after a build, even though it is all included within one of the build files themselves.
Could we perhaps have a clean:postBuild task which, say, deletes something like build/src/**.js - these redundant files are very confusing in an IDE, since as well as having one copy of all the framework's source per project that depends on it, we are now likely to double this by each of those copies now having an extra copy within build/src - Cheers
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.
@amb26 we could do that, but not all of the js files are actually part of the concatenated file. For example the compatibility files included with the Uploader. I can think of the following three options, please let me know what you think.
- Leave things as is
- Delete the build directory again ( with the dist directory, I don't think @waharnum's use case is still necessary. were there others? )
- Attempt to reuse the file list that was used to do the concatenation to facilitate the deletion.
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.
The third option would be nice, if it didn't seem to involve too much work - otherwise we could just leave things are they are
After a build, the js files incuded in the single concatenated js file are removed from the build directory. After distributions are built, other build files/resources are removed (i.e. build directory, stylus generated files, etc.)
@amb26 I believe I have option 3 working and also did some cleanup after distributions are built. This is ready for more review. |
Thanks, @jobara - this looks great! Now that we are using the prepublish lifecycle script, we should now make sure to update your pull fluid-project/fluid-publish#5 so that it executes this step (if it exists in package.json) before publishing artefacts to npm. |
Adding a grunt task and prepublish script for building a dist directory.
https://issues.fluidproject.org/browse/FLUID-5978