Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.32 KB

DEVELOPMENT.md

File metadata and controls

49 lines (37 loc) · 1.32 KB

Development notes

Setting up development copy of the project

# Clone the project.
git clone https://github.com/Chi-teck/drupal-code-generator

# Change working directory.
cd drupal-code-generator

# Install dependencies.
composer install

# Run generator.
bin/dcg

To make dcg available in any system location append this line to your .bashrc file: alias dcg-dev=/path/to/to/drupal-code-generator/bin/dcg Then after you have logged out and in the dcg development version will be accessible through dcg-dev command.

Testing

Install PHPUnit globally:

composer global require "phpunit/phpunit"

Make sure you have ~/.composer/vendor/bin in your PATH:

export PATH=~/.composer/vendor/bin:$PATH

The following alias may help you run tests and check code style from any location:

alias dcg-test="(cd /path/to/drupal-code-generator && phpunit && phpcs -p --standard=./phpcs.xml)"

Running tests against generated code

/path/to/drupal-code-generator/scripts/run-sut-tests.php

Building PHAR executable

  1. Install Box 2.
  2. Navigate to the directory where Drupal Code Generator was installed.
  3. Run the following command: box build (use -v option if you need verbose output).
  4. Test the generated archive: php dcg.phar --version.