Building

** NOTE- This may be the last time I ever write in the goddam wordpress edit box. Just lost the last 15 minutes of writing. I’m gonna get atompub working in emacs if it kills me.

Spent some time today trying to automate some of the steps in prototyping. First off, the YUI Compressor is a great utility to have running locally. Dropped into a directory, created a bash alias for both css and js minifying so I can run it like cssmin main.css > main.min.css, and I’m off and running.

Jumped from there into creating a project template, with the common files I need so I can make new projects start faster. I usually have the following folders:

  • css
  • js
  • img
  • php – this holds actual php pages. Default file is called functions.php, and generates the DOCTYPE, etc. I guess these could be includes instead, but I usually just use a heredoc to insert them with an echo.
  • inc – this holds includes and/or functions
  • html – static html copies of the pages in the php directory, so a local server is not needed when someone else looks at the prototype.

At the project root is an index.html file that serves as a navigation for the whole project. It should point to both the php and the html files just in case.

Then started thinking about what I really need, which is a script to do all the following things depending on what step I’m at.

If I’m just starting out:

  1. Export the above structure from my repository.
  2. Name the top level folder from the user input.
  3. Add the new project back to the repository.

If I want to do a build to release to others (lost the rest of the post here), I’ll probably want to make sure all the files are under version control, add them if not, create the static html pages from the php pages (curl while looking for 404 errors?), change links to point to those pages, update the index page with the new ones, commit it all in and then export it to a temp directory where it gets zipped up, and then mail it off to the names listed in config file somewhere.

Overall, building the project should be automatic.

No Comments

Post a Comment

You must be logged in to post a comment.