acquia / blt

Acquia's toolset for automating Drupal 8 and 9 development, testing, and deployment.
https://docs.acquia.com/blt/
GNU General Public License v2.0
442 stars 394 forks source link

DrupalConsoleTask.php #1237

Closed cosmicdreams closed 7 years ago

cosmicdreams commented 7 years ago

Hey I noticed that phing/phingincludes/DrushTask.php seems to provide a blueprint for how one would extend BLT to support executing DrupalConsole commands.

I suppose you could live a happy life with just relying upon to get the job done but I was wondering.... If I wanted to have a <drupalconsole> phing statement to use in blt. What are the files that I would need to author in order to make that happen?

geerlingguy commented 7 years ago

Use case to back the above feature request: there are a number of Drupal 8 modules (Entity Pilot Git) in this case) which only provide Drupal Console commands, and no equivalent for Drush.

We'd like to add a custom BLT phing task that calls one of the Entity Pilot Git commands, but to do this we currently could only use exec or something similar, since there's no way to call out to Drupal Console from BLT/Phing.

cosmicdreams commented 7 years ago

Oh looks like phing/build.xml is involved. It establishes the name of the statement tag and basically includes the custom task.

grasmash commented 7 years ago

@cosmicdreams you got it!

cosmicdreams commented 7 years ago

So... two files then? nice.

cosmicdreams commented 7 years ago

Hey @grasmash : looks like <taskdef> would allow me to point to any class, even if it's not in BLT. Would it allow me to point to my own class that is outside of BLT? Maybe then I can make this project specific until it works then submit a patch.

grasmash commented 7 years ago

Yes. In fact, you can even create a separate project with the Phing task file and distribute it on Packagist. That might be the best solution.

To be honest, I'd like to avoid committing this to BLT. Ive found that console changes very frequently, and subsequently creates a maintenance burden. Perhaps that will subside with time.