如何将闭包编译器配置为在 Google App Engine Java 上运行
我怀疑我需要在某处添加 Ant 任务,但是在哪里呢?
I suspect I need to add an Ant task somewhere, but where?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我怀疑我需要在某处添加 Ant 任务,但是在哪里呢?
I suspect I need to add an Ant task somewhere, but where?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
我不确定您是否能够做到这一点...App Engine 对于您可以使用的类有一个白名单,并且我认为如果您可以发送其闭包编译器,那么闭包编译器很可能对您的情况有用输出到文件,这是不允许的。
您可能想要做的是拥有自己的本地开发环境,在其中使用 Google Closure 编译器进行开发,然后将生成的输出部署到 App Engine 云服务。
或者,如果您确实打算在 AppEngine 上动态调用编译器,请执行一些 JavaScript 元编程或类似的操作,那么您可能会面临一些有趣的调试和调整以使其正常工作。我假设您可以将自己挂接到编译器上,以在内存中获取预期的输出,而不是输出到文件,然后将其注入到您提供的内容中。
但是没有 Ant 文件会神奇地为您完成此操作,甚至不会在 AppEngine 上为您“运行”闭包编译器。我认为您对这些技术是什么以及意味着什么有点困惑。
I'm not sure you'll be able to do that... App Engine has a whitelist for the classes that you are allowed to use, and I assume the Closure Compiler would most probably be useful in your case if you can send its output to files, which won't be allowed.
What you probably want to do is have your own local development environment where you develop using the Google Closure Compiler and then deploy the resulting output to your App Engine cloud service.
Or, if you really intent to call the compiler on the fly on AppEngine, do do some JavaScript meta-programming or something along these lines, then you'll probably facing some fun debugging and tweaking to get it to work. I would assume you could hook yourself onto the compiler to get the intended output in-memory instead of outputting to a file, and then inject it into your served content.
But no Ant file will magically do this for you, and even "run" the closure compiler for you on AppEngine. I think you are a bit confused as to what these technologies are and imply.