从AppEngine部署中删除不需要的上传 [英] Removing unwanted uploads from AppEngine deployment

查看:152
本文介绍了从AppEngine部署中删除不需要的上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个GWT / AppEngine项目,并注意到我所有的GWT Java类最终都是以 WEB-INF / classes / 项目包/ / client / 的编译形式> appcfg分期目录的文件夹。这不仅为每个部署创建了一堆不需要的上传数据,而且我也宁愿不与世界共享这些文件。



有没有办法从上传中排除这些文件? Eclipse中的一个设置是惊人的,但是当然,appengine-web.xml中的一个条目也可以这样做。

解决方案

您可以使用Ant完成此操作,并通过让您的类受到刺激而提供的性能优势。



1)从eclipse运行gwt编译



2)运行类似下面的ant任务(使用Ant视图轻松完成eclipse):

 < property name =staging.dirvalue =war/> 

< property name =classes.dirvalue =$ {staging.dir} / WEB-INF / classes/>

< target name =jarClasses>
< delete file =$ {staging.dir} /WEB-INF/lib/classes.jar/>
< echo> $ {staging.dir} /WEB-INF/lib/classes.jar DELETED< / echo>
< jar destfile =$ {staging.dir} /WEB-INF/lib/classes.jarbasedir =$ {classes.dir}
excludes =$ {classes.dir} /projectpackage/client/*.*\"/>
< echo> $ {staging.dir} /WEB-INF/lib/classes.jar JARRED< / echo>
< delete dir =$ {classes.dir}/>
< echo> $ {classes.dir} DELETED< / echo>
< / target>

3)使用appcfg.sh(或Windows版本)进行上传


I am working on a GWT/AppEngine project and noticed that all my GWT java classes end up in compiled form in the WEB-INF/classes/projectpackage/client/ folder of the appcfg staging directory. Not only does this create a bunch of unwanted upload-data for every deploy, but I also really would rather not share these files with the world.

Is there a way to exclude these files from the upload? A setting in Eclipse would be amazing, but, of course, an entry in appengine-web.xml would do the trick just as well...

解决方案

You can accomplish this using Ant with the added performance benefit given by having your classes jarred.

1) run a gwt compile from eclipse

2) run something like the ant task below (easily done with eclipse using the Ant view):

 <property name="staging.dir" value="war" />

 <property name="classes.dir" value="${staging.dir}/WEB-INF/classes" />

    <target name="jarClasses">
       <delete file="${staging.dir}/WEB-INF/lib/classes.jar" />
       <echo> ${staging.dir}/WEB-INF/lib/classes.jar DELETED </echo>
       <jar destfile="${staging.dir}/WEB-INF/lib/classes.jar" basedir="${classes.dir}"
           excludes="${classes.dir}/projectpackage/client/*.*"/>
       <echo> ${staging.dir}/WEB-INF/lib/classes.jar JARRED </echo>
       <delete dir="${classes.dir}" />
       <echo> ${classes.dir} DELETED </echo>
    </target>

3) do the upload using appcfg.sh (or windows version)

这篇关于从AppEngine部署中删除不需要的上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆