Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build phar with box and bump dependency versions #372

Closed
wants to merge 6 commits into from
Closed

Build phar with box and bump dependency versions #372

wants to merge 6 commits into from

Conversation

jakzal
Copy link
Contributor

@jakzal jakzal commented May 2, 2019

re #371 #364

Advantages of dropping legacy PHP versions:

  • less maintenance burden

Advantages of box:

  • standardised way to build phar files
  • it's faster
  • possibility to scope phar classes (not part of this PR)

Disadvantages of box:

  • it diverges from the ant build system set up for this project. It only makes sense if everything else is migrated over and the ant setup is removed (it seems to be unmaintained).

.travis.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
@@ -1,5 +1,7 @@
<?xml version="1.0"?>
<phpunit bootstrap="src/test/php/PDepend/bootstrap.php">
<phpunit bootstrap="src/test/php/PDepend/bootstrap.php"
beStrictAboutTestsThatDoNotTestAnything="false"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's loads of tests with no assertions, but one thing at a time.

@codecov-io
Copy link

codecov-io commented May 2, 2019

Codecov Report

Merging #372 into master will increase coverage by 1.35%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #372      +/-   ##
============================================
+ Coverage     87.88%   89.24%   +1.35%     
  Complexity     3105     3105              
============================================
  Files           202      202              
  Lines          8939     8728     -211     
============================================
- Hits           7856     7789      -67     
+ Misses         1083      939     -144
Impacted Files Coverage Δ Complexity Δ
src/main/php/PDepend/Util/ImageConvert.php 78.78% <0%> (-3.04%) 11% <0%> (ø)
...ource/Language/PHP/PHPTokenizerHelperVersion52.php 92.59% <0%> (-2.15%) 9% <0%> (ø)
src/main/php/PDepend/TextUI/Runner.php 76.66% <0%> (-2.03%) 25% <0%> (ø)
src/main/php/PDepend/Source/AST/ASTClass.php 11.11% <0%> (-1.94%) 20% <0%> (ø)
src/main/php/PDepend/TextUI/ResultPrinter.php 60.52% <0%> (-1.02%) 19% <0%> (ø)
src/main/php/PDepend/TextUI/Command.php 85.87% <0%> (-0.69%) 74% <0%> (ø)
src/main/php/PDepend/Report/Summary/Xml.php 97.43% <0%> (-0.24%) 32% <0%> (ø)
...ain/php/PDepend/Source/AST/AbstractASTCallable.php 97.14% <0%> (-0.23%) 41% <0%> (ø)
...main/php/PDepend/Source/AST/ASTCompilationUnit.php 98.18% <0%> (-0.16%) 27% <0%> (ø)
src/main/php/PDepend/Report/Overview/Pyramid.php 97.82% <0%> (-0.14%) 29% <0%> (ø)
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb7a53b...b89e6b9. Read the comment docs.

@emirb
Copy link
Contributor

emirb commented May 5, 2019

cc @manuelpichler @ravage84

theofidry
theofidry previously approved these changes May 5, 2019
default: build

build: install test
.PHONY: build

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more standard to put the phone before, but that's just CS anyway...

ln -sf ../vendor/bin/phpunit tools/phpunit

tools/box:
curl -Ls https://github.com/humbug/box/releases/download/3.7.0/box.phar -o tools/box && chmod +x tools/box

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for those targets I would add touch $@ to avoid the target to get outdated. You sometimes have cases where the target timestamp is not updated properly otherwise making the whole Makefile usage more flimsy.

This comment applies to the other Makefile targets

"base-path": "build/phar",
"output": "../pdepend.phar",
"compression": "GZ",
"directories": ["src/bin", "src/main", "vendor"],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that this could be improve (but I would suggest to do that in another PR)

cp -r src/bin src/main build/phar/src
cp -r composer.json LICENSE build/phar

cd build/phar && composer config platform.php 7.1 && composer update --no-dev -o -a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the platform needs to be a specific version, e.g. 7.1.3. -o -a are overkill since -a implies -o and Box will take care of dumping the autoloader in authoritative mode anyway (so doing it here results in the autoloader being dumped twice)

@kylekatarnls kylekatarnls changed the base branch from master to 3.x July 26, 2019 07:01
Copy link
Member

@kylekatarnls kylekatarnls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed settings to use environment variable instead of hard coded tokens, then resolved the conflict on .travis.yml

I think we should even pick PHP 7.2 as minimum level of the next major PDepend, like for PHPMD, and this could start as soon as version 2 with PHP 5.3 would support properly PHP 7.0 to 7.3. Seems more logical to me to first fully support a PHP level before jumping to it. That's why I switched the base branch to 3.x but it's not engraved in stone, we can debate.

"symfony/dependency-injection": "^2.3.0|^3|^4",
"symfony/filesystem": "^2.3.0|^3|^4",
"symfony/config": "^2.3.0|^3|^4"
"php": "^7.1,<7.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPMD 3 will be ^7.2, I think we should align. And I think we should also target PHP 7.4 for the next major release of PDepend.

},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.7",
"squizlabs/php_codesniffer": "^2.0.0"
"phpunit/phpunit": "^7.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we PHP ^7.2, PHPUnit can be ^8.0

@tvbeek tvbeek mentioned this pull request Nov 1, 2019
5 tasks
@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants