I'm trying to "build" my project using Closure Library; Sadly, after many tests I can't build something without problems. My project is a library, so I haven't got an entry point or anything like that, most of the code is made of objects and functions for the user.
I've got a project like that:
- build
- build.sh
- compiler.jar
- libs
- closure-library
- src
My build.sh file:
java -jar compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file out.js `find ../src/ -name '*.js'`
With this command line I've got the error:goog.require('goog.vec.Vec2');; So I think I need to include google closure library in this line, right?
So, I've tried to change my build.sh to something like that (added closure-library folder):
java -jar compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file out.js `find ../src/ ../libs/closure-library/closure/ -name '*.js'`
With this script, I've got many error from the closure library like that:
../libs/closure-library/closure/goog/i18n/datetimeformat_test.js:572: ERROR - This style of octal literal is not supported in strict mode.
var date = new Date(Date.UTC(2015, 11 - 1, 01, 11, 0, 1));
And my resulting file (out.js) haven't got all my library's functions. I'm not sure to understand where is the problem.
- Did I really have to include google closure in the build part?
- I'm working on a Javascript library so I haven't got an entry point and all the code must be included in the resulting file. So, how can I do that?
Thanks for your time!
Edit:
I've tried something different: removing all lines like "goog.require('goog.vec.Mat4');" from my library. The build is done successfully but my simulation didn't work anymore: Cannot read property 'Mat4' of undefined