Results 1 to 9 of 9

Thread: Tweaked 'Copy source to the following directory'

  1. #1
    Ext JS Premium Member watrboy00's Avatar
    Join Date
    Aug 2007
    Location
    Minneapolis, MN
    Posts
    473

    Default Tweaked 'Copy source to the following directory'

    So today while I was at work I got to thinking that its a takes a lot of effort to run all these separate JS Builder projects just to generate a complete Ext JS build with the required JavaScript and accompanying resources as well as a build of my website's JavaScript and accompanying resources.

    Now I know what you are all thinking....wow you must be lazy a whole whopping 2 clicks per jsb project?!?! Well I am a programmer and I am very lazy!

    So in my nature to be completely lazy as possible I decided to tackle this and add a new attribute for the jsb source.

    Attribute: 'output'

    Example:
    Code:
    <file name="YOUR SOURCE FILE" output="true" path="YOUR OUTPUT PATH RELATIVE TO THE BUILD SETTINGS OUTPUT DIRECTORY" />
    I add this attribute in because the 'Copy source to the following directory' build settings didn't quite work the way I wanted it to. Obviously I use JS Builder to minify my css and js source to move it to a production enviorment but it would be nice to only copy the needed files over to the output directory instead of all them (IE all the images used in the css but not the source css or js). Remember we are combinding compressing multiple files down to just one. I don't need all the files that were used in building the minified file...just the end result.

    Having this new attribute allows you to output images to the output directory just like a target would but without having to specify a build target. Now instead of having a JSB for CSS, Images, and JavaScript you can have just on JSB that does it all.

    So now in my production environment I have the following directory sturcture pre-build...

    .
    ..css
    ..images
    ..resources
    ..scripts

    in which case my jsb project takes the files from the css, images, and scripts folders and outputs them to the resources folder. On post build I just do a delete command of the css, images, and scripts folders and I am left with the resources folder only containing just the minified css & js as well as the required images for them. No cleanup of unneeded files on the server when I am all done.

    I've attached two zip files...one a setup file for the new exe of JS Builder and a sample JSB project showing usage. Just drop an ext js source in a folder named 'ext' and place the sample jsb in the same root folder as the ext and build on.

    I can post the solution as well if anyone would like.

    Enjoy!
    Attached Files Attached Files
    Eric Berens
    Intranet Systems Manager @ Best Buy
    You should follow me on twitter here.

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996

    Default

    What's different here than just making a batch file to do what you want?

  3. #3
    Ext JS Premium Member watrboy00's Avatar
    Join Date
    Aug 2007
    Location
    Minneapolis, MN
    Posts
    473

    Default

    Had a batch file...just was two files I had to maintain over just one. If I am using JS Builder already then there is no need for me to make a bat file just to copy files.
    Eric Berens
    Intranet Systems Manager @ Best Buy
    You should follow me on twitter here.

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996

    Default

    6 or 1/2 dozen maybe, yeah just maintain one file, but which file, a jsb file or a bat file. Seems more universally customizable to impose your will in a bat file. I have the bat file autogenerate docs, clean up some directories, etc. Granted your suggestion affords the option to do either.

  5. #5
    Ext JS Premium Member watrboy00's Avatar
    Join Date
    Aug 2007
    Location
    Minneapolis, MN
    Posts
    473

    Default

    On my latest team we are upgrading to Team Server which will automate really a lot of this for me on its own in which case I won't need to have bat files and what not.

    Granted to your point a bat file provides more flexibility in what you can actually do but for what I 'currently' deal with the only un-automated process is copying images from a one directory to another.

    Plus modifying the source was like maybe 10 lines of code to add the flexibility and really only took a couple minutes once I figure out where everything was in the solution.

    Each has their use...people can use as they see fit. Just a minor tweak.
    Eric Berens
    Intranet Systems Manager @ Best Buy
    You should follow me on twitter here.

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996

    Default

    You might consider either updating the wiki entry or pointing a link back here for interested parties.
    http://extjs.com/learn/Tutorial:Buil...t_Automation_2

    Really, I think all wiki entries should have a linked forum post dedicated to discussing a particular wiki entry anyway.

  7. #7
    Ext JS Premium Member watrboy00's Avatar
    Join Date
    Aug 2007
    Location
    Minneapolis, MN
    Posts
    473

    Default

    Yea I will look into updating the wiki. Down at the conference right now so if I get some time I will do it then.
    Eric Berens
    Intranet Systems Manager @ Best Buy
    You should follow me on twitter here.

  8. #8
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996

    Default

    Quote Originally Posted by watrboy00 View Post
    Yea I will look into updating the wiki. Down at the conference right now so if I get some time I will do it then.
    Gasp. Surely you could find something more entertaining to do while at the conference!!!!

  9. #9
    Ext JS Premium Member watrboy00's Avatar
    Join Date
    Aug 2007
    Location
    Minneapolis, MN
    Posts
    473

    Default

    Yea....haven't spent much time in the room. Laptop has been off pretty much the entire conference. Other more entertaining things have come up!
    Eric Berens
    Intranet Systems Manager @ Best Buy
    You should follow me on twitter here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •