Skip to content

Commit

Permalink
With #3577 solved, there is no need for building a PHAR that is not s…
Browse files Browse the repository at this point in the history
…coped
  • Loading branch information
sebastianbergmann committed Jul 3, 2019
1 parent 4426adc commit c8afbd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 47 deletions.
1 change: 1 addition & 0 deletions ChangeLog-8.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes of the PHPUnit 8.3 release series are documented in this fil

### Changed

* Implemented [#2015](https://github.com/sebastianbergmann/phpunit/issues/2015): Prefix all code bundled in PHAR distribution with random/unique namespace
* Implemented [#3503](https://github.com/sebastianbergmann/phpunit/issues/3503): The error handler has been refactored to longer rely on global state
* Implemented [#3521](https://github.com/sebastianbergmann/phpunit/issues/3521): The `@errorHandler` annotation, which controlled a feature that was not documented and did not work correctly, has no effect anymore
* Implemented [#3522](https://github.com/sebastianbergmann/phpunit/issues/3522): The `TestCase::setUseErrorHandler()` method, which controlled a feature that was not documented and did not work correctly, has been deprecated and no effect anymore
Expand Down
53 changes: 6 additions & 47 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,49 +121,15 @@
</exec>
</target>

<target name="signed-scoped-phar" depends="scoped-phar" description="Create signed scoped PHAR archive of PHPUnit and all its dependencies">
<exec executable="gpg" failonerror="true">
<arg value="--local-user"/>
<arg value="[email protected]"/>
<arg value="--armor"/>
<arg value="--detach-sign"/>
<arg path="${basedir}/build/phpunit-scoped-library-${version}.phar"/>
</exec>

<exec executable="gpg" failonerror="true">
<arg value="--local-user"/>
<arg value="[email protected]"/>
<arg value="--armor"/>
<arg value="--detach-sign"/>
<arg path="${basedir}/build/phpunit-scoped-${version}.phar"/>
</exec>
</target>

<target name="phar" depends="-phar-prepare,-phar-determine-version" description="Create PHAR archive of PHPUnit and all its dependencies">
<antcall target="-phar-build">
<param name="type" value="release"/>
<param name="scoped" value="false"/>
</antcall>
</target>

<target name="phar-nightly" depends="-phar-prepare" description="Create PHAR archive of PHPUnit and all its dependencies (nightly)">
<antcall target="-phar-build">
<param name="type" value="nightly"/>
<param name="scoped" value="false"/>
</antcall>
</target>

<target name="scoped-phar" depends="-phar-prepare,-phar-determine-version" description="Create scoped PHAR archive of PHPUnit and all its dependencies">
<antcall target="-phar-build">
<param name="type" value="release"/>
<param name="scoped" value="true"/>
</antcall>
</target>

<target name="scoped-phar-nightly" depends="-phar-prepare" description="Create scoped PHAR archive of PHPUnit and all its dependencies (nightly)">
<antcall target="-phar-build">
<param name="type" value="nightly"/>
<param name="scoped" value="true"/>
</antcall>
</target>

Expand All @@ -172,7 +138,6 @@
<mkdir dir="${basedir}/build/phar-scoped"/>

<copy file="${basedir}/phpunit.xsd" tofile="${basedir}/build/phar/phpunit.xsd"/>
<copy file="${basedir}/phpunit.xsd" tofile="${basedir}/build/phar-scoped/phpunit.xsd"/>

<exec executable="${basedir}/build/phar-manifest.php" output="${basedir}/build/phar/manifest.txt" failonerror="true"/>

Expand Down Expand Up @@ -385,7 +350,7 @@
<arg value="${type}"/>
</exec>

<exec if:true="${scoped}" executable="${basedir}/tools/php-scoper" taskname="php-scoper">
<exec executable="${basedir}/tools/php-scoper" taskname="php-scoper">
<arg value="add-prefix" />
<arg value="--no-ansi" />
<arg value="--force" />
Expand All @@ -408,12 +373,10 @@
<arg value="--hash" />
<arg value="SHA-1" />
<arg value="--output" />
<arg if:true="${scoped}" path="${basedir}/build/phpunit-scoped-library-${_version}.phar" />
<arg unless:true="${scoped}" path="${basedir}/build/phpunit-library-${_version}.phar" />
<arg path="${basedir}/build/phpunit-library-${_version}.phar" />
<arg value="--template" />
<arg path="${basedir}/build/library-phar-autoload.php.in" />
<arg if:true="${scoped}" path="${basedir}/build/phar-scoped" />
<arg unless:true="${scoped}" path="${basedir}/build/phar" />
<arg path="${basedir}/build/phar-scoped" />
</exec>

<copy file="${basedir}/build/binary-phar-autoload.php.in" tofile="${basedir}/build/binary-phar-autoload.php"/>
Expand All @@ -427,19 +390,15 @@
<arg value="--hash" />
<arg value="SHA-1" />
<arg value="--output" />
<arg if:true="${scoped}" path="${basedir}/build/phpunit-scoped-${_version}.phar" />
<arg unless:true="${scoped}" path="${basedir}/build/phpunit-${_version}.phar" />
<arg path="${basedir}/build/phpunit-${_version}.phar" />
<arg value="--template" />
<arg path="${basedir}/build/binary-phar-autoload.php" />
<arg if:true="${scoped}" path="${basedir}/build/phar-scoped" />
<arg unless:true="${scoped}" path="${basedir}/build/phar" />
<arg path="${basedir}/build/phar-scoped" />
</exec>

<chmod if:true="${scoped}" file="${basedir}/build/phpunit-scoped-${_version}.phar" perm="ugo+rx"/>
<chmod unless:true="${scoped}" file="${basedir}/build/phpunit-${_version}.phar" perm="ugo+rx"/>
<chmod file="${basedir}/build/phpunit-${_version}.phar" perm="ugo+rx"/>

<delete dir="${basedir}/build/phar"/>
<delete dir="${basedir}/build/phar-scoped"/>
<delete file="${basedir}/build/binary-phar-autoload.php"/>
</target>

Expand Down

0 comments on commit c8afbd8

Please sign in to comment.