Comments (11)
++
it'll need a fresh build of the closure compiler jar.. but dont see why not.
also you can now do inline base64 sourcemaps, fwiw.. http://trac.webkit.org/changeset/111389
from ant-build-script.
+++
I'm planning on playing catch up with issues here next week. I'm heading to India and there's only so much reading/sleeping I can do on the plane and in airports. I'll add this on the front of my queue since it's cool
from ant-build-script.
Rob, I've already played around a little bit with it. Will see what I can do until next week. Nothing pushed yet, but it will appear here.
Have a good flight and a lot of fun (I was in India in January, it's beautiful :))
from ant-build-script.
Thanks! I'm really excited for the trip. Both to see India itself and then to meet a bunch of people. I'll be meeting many Indian Sapient colleagues in person for the first time and then will also be presenting to a bunch of people from outside Sapient so it will be a great intro to the tech community in the NCR region.
Definitely let me know how it goes with the feature.
from ant-build-script.
After playing around a little bit yesterday I had the feeling I came up with the commits over here.
Problems I currently have: The file is not copied to the publish folder but remains in intermediate. Furthermore I had the impression that scripts are not concatenated correctly.
My test was: build from three scripts (plugins.js, somescript.js, script.js), all scripts were minified, somescript.js was not concatenated.
This may be because of changes I made or because of the new Closure Compiler version. I'll try to look into it again, but I wanted to share this so that you can look into it, if you want to.
from ant-build-script.
I started to look into this. We just solved the script concatenation holy grail, so I don't really want to revisit how we're doing it any time soon. This might be harder than just plugging in the latest version of Closure Compiler. The default way to generate one of these relies on concatenation in Closure Compiler. We're not doing that so... back to the drawing board. I really want this as a feature though so we'll have to sort it out somehow.
from ant-build-script.
Revisit.
from ant-build-script.
Revisited.
So... this is weird and I don't have a straightforward answer. @drublic your code works and could be built off of except for one diabolical issue- the issue that has me stumped (so far.)
Your code:
<apply executable="java" parallel="false">
<fileset dir="${dir.source}/${dir.js}" excludes="${file.js.bypass}, **/*.min.js" includes="**/*.js">
<exclude name="${dir.js}/otherscripts-concat.js"/>
<exclude name="${dir.js}/scripts-concat.js"/>
</fileset>
<arg line="-jar"/>
<arg path="./${dir.build.tools}/${tool.compiler}"/>
<arg line="--js"/>
<srcfile/>
<arg line="--compilation_level" />
<arg value="${scripts.compilation.level}" />
<arg line="--warning_level" />
<arg value="${scripts.compilation.warninglevel}" />
<arg line="--create_source_map" />
<arg value="${basedir}/${dir.intermediate}/${dir.js}/source_map.js.map" />
<arg line="--source_map_format=V3"/>
<arg line="--js_output_file" />
<mapper type="glob" from="*.js" to="${basedir}/${dir.intermediate}/${dir.js}/*.js"/>
<targetfile/>
</apply>
...creates a single map file source_map.js.map
that maps to (in my testbed) plugins.js
my understanding is that it should produce one _.js.map file for _each* file in the directory so that every file is mapped to a corresponding source JS when people inspect the code. I think this would work correctly concatenated as long as the source files were available to browse on the server. The problem is, there's no way (that I've seen) to do the same kind of filename mapping seen in the <mapper>
element as a value for the --create_source_map
argument. You can't have multiple mappers in an <apply>
and I've tried some tricks with outputting things to stdout and using a <redirector>
to send it to a properly mapped file (which in effect allows for two <mappers>
per <apply>
. that didn't work. I'd really like to get this in, but I'm not sure how to do it just yet.
Dear Github people, I am open to suggestions.
from ant-build-script.
Updating: Unless someone else comes in with a heroic pull request I'm pushing this out to a later release. I can do this using the <for>
task and the list generated by the findAttribute class, but it will take some surgery on the whole minification and concatenation workflow. I will also need to make it configurable. It's going to take a little planning and there's not guarantee that it's going to work the way I expect so I'm pushing it out.
Still holding out hope for a hero :)
from ant-build-script.
so that every file is mapped to a corresponding source JS when people inspect the code
@roblarsen do you eventually concatenate the minified files for which a mapsource has been produced? I am having a problem when doing that as the sourcemaps become invalid for the produced concatenated file...
irrelevant: i guess you don't consider integrating grunt ha?
from ant-build-script.
old... and I'm not going to revisit this myself.
from ant-build-script.
Related Issues (20)
- Change docs to address confusion HOT 2
- Can't copy minified js directory over to publish HOT 2
- Concatenation after minifying and ADVANCED_OPTIMIZATIONS HOT 5
- Image Optimization Broken on Linux/Mac HOT 9
- Minifying any unconcatenated css files... FileNotFoundException HOT 2
- The gem-sass.jar throws an exception with Foundation 4 HOT 3
- Image Optimization HOT 5
- Rework Image Optimization HOT 15
- CSS reference not updating w/php includes on build HOT 6
- Mavericks Upgrade: Busted Macports for Ant HOT 2
- Unicode characters being inserted between css imports upon concatenation. HOT 5
- css-references not updating in html-file HOT 17
- working with sass stylesheets HOT 1
- problem with advpng and java.. HOT 5
- set language_in option for closure compiler? HOT 6
- Port to NodeJs HOT 1
- css does not minify/concat correctly when using default main.css HOT 7
- ant validate only validates single page HOT 1
- JS files vanished in publish/ directory HOT 1
- How to use this build script outside my project? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ant-build-script.