From f641885a8d3cdb7e074e35060ca66a239af2ee88 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 24 Aug 2020 12:11:17 +0530 Subject: [PATCH] Add support for phing --- __tests__/tools.test.ts | 9 ++++++++- dist/index.js | 4 ++++ src/tools.ts | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/__tests__/tools.test.ts b/__tests__/tools.test.ts index db64bcae..79a62574 100644 --- a/__tests__/tools.test.ts +++ b/__tests__/tools.test.ts @@ -375,7 +375,7 @@ describe('Tools tests', () => { it('checking addTools on linux', async () => { const script: string = await tools.addTools( - 'blackfire, blackfire-player, cs2pr, flex, grpc_php_plugin, php-cs-fixer, phplint, phpstan, phpunit, pecl, phinx, phinx:1.2.3, phive, php-config, phpize, protoc, symfony, wp-cli', + 'blackfire, blackfire-player, cs2pr, flex, grpc_php_plugin, php-cs-fixer, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, php-config, phpize, protoc, symfony, wp-cli', '7.4', 'linux' ); @@ -395,6 +395,9 @@ describe('Tools tests', () => { expect(script).toContain( 'add_tool https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar phpstan' ); + expect(script).toContain( + 'add_tool https://www.phing.info/get/phing-latest.phar phing' + ); expect(script).toContain( 'add_tool https://phar.io/releases/phive.phar phive' ); @@ -432,6 +435,7 @@ describe('Tools tests', () => { 'infection', 'phan', 'phan:2.7.2', + 'phing:1.2.3', 'phinx', 'phive:1.2.3', 'php-config', @@ -479,6 +483,9 @@ describe('Tools tests', () => { expect(script).toContain( 'add_tool https://github.com/phan/phan/releases/latest/download/phan.phar phan' ); + expect(script).toContain( + 'add_tool https://www.phing.info/get/phing-1.2.3.phar phing' + ); expect(script).toContain( 'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs' ); diff --git a/dist/index.js b/dist/index.js index 0a02defc..7c7c8e08 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2106,6 +2106,10 @@ async function addTools(tools_csv, php_version, os_version) { url = github + 'phan/phan/' + uri; script += await addArchive(tool, url, os_version); break; + case 'phing': + url = 'https://www.phing.info/get/phing-' + version + '.phar'; + script += await addArchive(tool, url, os_version); + break; case 'phinx': script += await addPackage(tool, release, 'robmorgan/', os_version); break; diff --git a/src/tools.ts b/src/tools.ts index 2d323a7b..c0e2b044 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -505,6 +505,10 @@ export async function addTools( url = github + 'phan/phan/' + uri; script += await addArchive(tool, url, os_version); break; + case 'phing': + url = 'https://www.phing.info/get/phing-' + version + '.phar'; + script += await addArchive(tool, url, os_version); + break; case 'phinx': script += await addPackage(tool, release, 'robmorgan/', os_version); break;