Skip to content
John James Jacoby edited this page Aug 12, 2020 · 3 revisions

Sugar Calendar development utilizes a task runner called Grunt.

Grunt does the repetitive and time-consuming work that we would prefer not to do on our own.

Tasks

Below is a brief description of each Grunt task.

default or update

Command Line: grunt or grunt default or grunt update

Run this whenever any assets (JavaScript, CSS, PHP) have changed.

This task performs the following sub-tasks:

  • bump
  • cssmin:ltr
  • rtlcss
  • cssmin:rtl
  • i18n
  • makepot

standardize

Command Line: grunt standardize

Run this when you need to add the "standard" files to your Sugar Calendar checkout.

build

Command Line: grunt build or grunt build --standard

Run this when you need to generate a sugar-calendar.zip file to deliver to someone, like when deploying a new version to WordPress.org or SugarCalendar.com.

This task performs the following sub-tasks:

  • clean:build
    • if standard standardize
  • update
  • copy:bootstrap
  • copy:contents
  • replace:build_bootstrap_php
    • if standard replace:build_bootstrap_php & replace:build_pot_name
  • compress
    • if standard clean:standard_after_build & makepot

i18n

Command Line: grunt i18n

Run this when you want to check and update text domains for translatable strings

This task performs the following sub-tasks:

  • addtextdomain
  • force:checktextdomain

bump

Command Line: grunt bump

Run this when you want to align version numbers across all files that reference the current version.

This task performs the following sub-tasks:

  • replace:readme_md
  • replace:readme_txt
  • replace:bootstrap_php
  • replace:loader_php

Sub Tasks

These tasks are ran by other primary tasks.

rtlcss

Command Line: grunt rtlcss

Run this when you need to generate right-to-left CSS from your left-to-right CSS

cssmin

Command Line: grunt cssmin

Run this when you need to minify all registered CSS assets. New files need to be added to this manually.

checktextdomain

Command Line: grunt checktextdomain

Run this when you need to check that all strings have the correct text domains for internationalization.

makepot

Command Line: grunt makepot

Run this when you need to generate a new sugar-calendar.pot dictionary for internationalization.

compress

Command Line: grunt compress

Run this to compress the built files into a sugar-calendar.zip file.

clone-standard

Command Line: grunt clone-standard

Run this to clone the Standard files into the /standard/ directory

Internally, this task runs:

  • clean:standard_before_clone
  • gitclone:standard
  • clean:standard_after_clone

Multi Tasks

These tasks wrap multiple other tasks and should not be ran by themselves.

replace

Command Line: grunt replace

These tasks perform various string replacements.

clean

Command Line: grunt clean

These tasks clean up temporary files and directories.

copy

Command Line: grunt copy

These tasks copy files, typically into the build directory.