Skip to content
Steven Rombauts edited this page May 2, 2017 · 3 revisions

Welcome to the joomlatools-composer wiki!

Development set up

Before you can make changes and test your development work, you need to make sure Composer will actually install your branch when running it. The following steps show you our preferred way of working on this codebase:

  1. Install the Joomlatools Vagrant box

  2. Fork this repository, then clone your fork and the sample joomlatools/com_helloworld code into the Projects directory:

    cd Projects
    git clone git@github.com:yourname/joomlatools-composer.git
    git clone git@github.com:joomlatools/joomlatools-composer-helloworld.git
    
  3. Create a new branch in the Composer installer project:

    cd joomlatools-composer
    git checkout -b feature/mynewbranch
    
  4. In the sample extension's repository, also create a new branch:

    cd ../joomlatools-composer-helloworld
    git checkout -b feature/mynewbranch
    
  5. The Hello World extension requires the joomlatools/composer package to be able to install. We must change this dependency in composer.json to require our new development branch. Edit the require section so it looks like this:

    "require": {
         "joomlatools/composer": "dev-feature/mynewbranch"
    }
    
  6. Commit these changes into your test branch:

    git commit -m "Change dependency for testing" -- composer.json
    
  7. Now, SSH into the Vagrant box and create a new Joomla installation:

    cd ..
    vagrant ssh
    joomla site:create composer
    
  8. Go to the new site's root directory:

    cd /var/www/composer
    
  9. Finally, we need to tell Composer where to find the new branches before we can install and test them. Edit composer.json and overwrite its contents with this:

    {
     "repositories": [
         {
             "type": "vcs",
             "url": "file:////home/vagrant/Projects/joomlatools-composer"
         },
         {
             "type": "vcs",
             "url": "file:////home/vagrant/Projects/joomlatools-composer-helloworld"
         }
     ],
     "minimum-stability": "dev"
    }
    
  10. You can now install and test your code changes by installing the feature/mynewbranch branch of your local joomlatools/com_helloworld clone:

    composer require joomlatools/composer-helloworld:dev-feature/mynewbranch
    

    This will pull in your local branch of the sample extension com_helloworld, which in turn requires the dev-feature/mynewbranch branch of the Composer plugin.

Happy coding!

Clone this wiki locally