PDA

View Full Version : [OPEN] How to add licence text to all-classes.js during build process?



cmeans
2 Nov 2012, 2:00 PM
I'd like to make sure that the all-classes.js file includes Sencha's and my company's licensing info.

Obviously I can manually add it after the build process, but is there an easy way to get it in automatically?

Thanks.

dongryphon
2 Nov 2012, 3:41 PM
I will open this as a Feature Request, but for now you could do this in your build.xml like so:



<target name="-after-page">
<move file="${build.dir}/all-classes.js"
tofile="${build.dir}/all-classes.js2"/>

<concat destfile="${build.dir}/all-classes.js">
<header filtering="no" trimleading="yes">
Copyright ...
</header>
<fileset file="${build.dir}/all-classes.js2"/>
</concat>
</target>


I haven't tested the above, but it should be pretty close. See http://ant.apache.org/manual/ for details.

The "-after-page" target is not (yet) documented in build.xml but "-after-build" would work as well.

cmeans
2 Nov 2012, 4:15 PM
Thanks Don,

That did it. Just needed to add an extra command to clean up the temp file.


<target name="-after-page">
<move file="${build.dir}/all-classes.js"
tofile="${build.dir}/all-classes.js2"/>

<concat destfile="${build.dir}/all-classes.js">
<header filtering="no" trimleading="yes">
/*
Portions Copyright (c) 2006-2012, Sencha Inc.
All rights reserved.
http://www.sencha.com

Portions Copyright (c) 2012 SpatialPoint, LLC.
All rights reserved.
http://www.spatialpoint.com
*/
</header>
<fileset file="${build.dir}/all-classes.js2"/>
</concat>
<delete file="${build.dir}/all-classes.js2" />
</target>