Craft is a CMS by Pixel & Tonic, built for people who like to take their time and do things right. You can read more about Craft at craftcms.com.
This repo contains the source code, resources, a custom build script and other utilities.
Craft has a custom build script that does the following:
- Optionally runs any unit tests found in Source/craft/app/tests/
- Copies all files from Source/ into a build directory
- Deletes some unneeded files and folders from the build directory
- Compiles all Sass files within craft/app/resources/css/ and deletes them
- Merges all Javascript files within craft/app/resources/js/classes/ into craft.js and deletes the classes/ folder
- Optionally creates compressed versions of all Javascript files within craft/app/resources/js/ within a new js/compressed/ folder
- Prepends header comments onto all Craft PHP and JS files
- Parses all Craft PHP files for a few tokens (e.g. “@@@version@@@”)
- Creates a list of all Craft classes that should be autoload-able, and saves it in craft/app/etc/config/common.php
- Optionally copies the final craft/app/ folder to a destination of your choosing, and sets app/etc/console/yiic.php’s permissions to 777
To set up your OS X environment to build Craft, follow these instructions:
-
Install Sass by opening Terminal and entering:
gem install sass -
Open ~/.bash_profile in a text editor and add the following:
# Craft Utils environment variables export CRAFT_REPO_PATH=/path/to/Craft export CRAFT_PHP_PATH=/Applications/MAMP/bin/php/php5.3.20/bin/php export CRAFT_PHPINI_PATH=/Applications/MAMP/bin/php/php5.3.20/conf/php.ini export CRAFT_SASS_PATH=/usr/local/bin/sass export PATH=$CRAFT_REPO_PATH/Utils:$PATH(Set
CRAFT_REPO_PATH,CRAFT_PHP_PATH, andCRAFT_SASS_PATHto the actual paths of your Craft repo, PHP executable, and Sass executable.) -
Give the build script executable permissions by entering the following in Terminal:
cd /path/to/Craft/Utils chmod 777 buildcraft -
Restart Terminal, and try entering:
buildcraftYou should see a bunch of text fly by. Craft is being built!
Now that your environment is set up, you can build Craft at any time by entering buildcraft in Terminal.
The build script supports the following options:
--runtests– Set to ‘1’ to have the build script run any tests before it starts building--destdir– Defines the directory that Craft should be built into. Defaults to a Build/ folder within the repo, which is .gitignore’d--build– The build number to be saved in craft/app/Info.php--version– The version number to be saved in craft/app/Info.php--compressjs– Set to ‘1’ to have the build script compress all of the Javascript files in craft/app/resources/js/--copyappdir– A path that the build script should copy the craft/app/ folder to once everything else is done
Note: Java is required for Javascript compression. If you omit --compressjs, you will need to add the following to your Craft install’s craft/config/general.php file:
'useCompressedJs' => false,
- If a link is acting as a button, give it a role="button" attribute to avoid confusing screen-readers.
- Use HTML5 "placeholder" attributes for input and text fields.
- Make sure to use tags.