Skip to content

Commit

Permalink
[RELEASE] Set version to 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiYang committed Oct 5, 2018
2 parents 9211984 + ab2eda1 commit 2996671
Show file tree
Hide file tree
Showing 17 changed files with 239 additions and 33 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ jobs:
- stage: test
php: 7.2
env: TYPO3_VERSION=~9.4.0
- stage: test
php: 7.2
env: TYPO3_VERSION=~9.5.0
14 changes: 12 additions & 2 deletions Classes/Backend/ToolbarItems/ProjectVersionSlot.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@

namespace KamiYang\ProjectVersion\Backend\ToolbarItems;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

use KamiYang\ProjectVersion\Facade\LocalizationUtilityFacade;
use KamiYang\ProjectVersion\Service\ProjectVersionService;
use TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem;
Expand All @@ -13,8 +25,6 @@

/**
* Class ProjectVersionSlot
*
* @author Jan Stockfisch <[email protected]>
*/
final class ProjectVersionSlot implements SingletonInterface
{
Expand Down
28 changes: 26 additions & 2 deletions Classes/Configuration/ExtensionConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@

namespace KamiYang\ProjectVersion\Configuration;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

use KamiYang\ProjectVersion\Enumeration\ProjectVersionModeEnumeration;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\StringUtility;

/**
* Class ExtensionConfiguration
*
* @author Jan Stockfisch <[email protected]>
*/
final class ExtensionConfiguration implements SingletonInterface
{
Expand Down Expand Up @@ -42,6 +52,11 @@ final class ExtensionConfiguration implements SingletonInterface
*/
private static $gitFormat = '';

/**
* @var string
*/
private static $staticVersion = '';

/**
* Fetch absolute version filename.
*
Expand Down Expand Up @@ -76,13 +91,22 @@ public static function getGitFormat(): string
return self::$gitFormat;
}

/**
* @return string
*/
public static function getStaticVersion(): string
{
return self::$staticVersion;
}

public function __construct()
{
self::$configuration = $this->getExtensionConfigurationFromGlobals();

self::$versionFilePath = $this->resolveVersionFilePath();
self::$mode = self::$configuration['mode'];
self::$gitFormat = self::$configuration['gitFormat'];
self::$staticVersion = self::$configuration['staticVersion'];
}

/**
Expand Down
14 changes: 12 additions & 2 deletions Classes/Enumeration/GitCommandEnumeration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@

namespace KamiYang\ProjectVersion\Enumeration;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

/**
* Class GitCommandEnumeration
*
* @author Jan Stockfisch <[email protected]>
*/
final class GitCommandEnumeration
{
Expand Down
15 changes: 13 additions & 2 deletions Classes/Enumeration/ProjectVersionModeEnumeration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@

namespace KamiYang\ProjectVersion\Enumeration;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

/**
* Class ProjectVersionModeEnumeration
*
* @author Jan Stockfisch <[email protected]>
*/
final class ProjectVersionModeEnumeration
{
const FILE = '0';
const GIT = '1';
const GIT_FILE_FALLBACK = '2';
const STATIC_VERSION = '3';
}
14 changes: 12 additions & 2 deletions Classes/Facade/CommandUtilityFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@

namespace KamiYang\ProjectVersion\Facade;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

use TYPO3\CMS\Core\Utility\CommandUtility;

/**
* Class CommandUtilityFacade
*
* @author Jan Stockfisch <[email protected]>
*/
class CommandUtilityFacade
{
Expand Down
13 changes: 12 additions & 1 deletion Classes/Facade/LocalizationUtilityFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@

namespace KamiYang\ProjectVersion\Facade;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

/**
Expand All @@ -12,7 +24,6 @@
*
* @see \TYPO3\CMS\Extbase\Utility\LocalizationUtility
* @internal
* @author Jan Stockfisch <[email protected]>
*/
class LocalizationUtilityFacade
{
Expand Down
13 changes: 12 additions & 1 deletion Classes/Facade/SystemEnvironmentBuilderFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@

namespace KamiYang\ProjectVersion\Facade;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;

/**
Expand All @@ -11,7 +23,6 @@
*
* @see \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder
* @internal
* @author Jan Stockfisch <[email protected]>
*/
class SystemEnvironmentBuilderFacade
{
Expand Down
14 changes: 12 additions & 2 deletions Classes/Service/ProjectVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@

namespace KamiYang\ProjectVersion\Service;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

use TYPO3\CMS\Core\SingletonInterface;

/**
* Class ProjectVersion
*
* @author Jan Stockfisch <[email protected]>
*/
class ProjectVersion implements SingletonInterface
{
Expand Down
25 changes: 23 additions & 2 deletions Classes/Service/ProjectVersionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@

namespace KamiYang\ProjectVersion\Service;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

use KamiYang\ProjectVersion\Configuration\ExtensionConfiguration;
use KamiYang\ProjectVersion\Enumeration\GitCommandEnumeration;
use KamiYang\ProjectVersion\Enumeration\ProjectVersionModeEnumeration;
Expand All @@ -13,8 +25,6 @@

/**
* Class ProjectVersionService
*
* @author Jan Stockfisch <[email protected]>
*/
class ProjectVersionService implements SingletonInterface
{
Expand All @@ -35,6 +45,9 @@ public function getProjectVersion(): ProjectVersion
$projectVersion = GeneralUtility::makeInstance(ProjectVersion::class);

switch (ExtensionConfiguration::getMode()) {
case ProjectVersionModeEnumeration::STATIC_VERSION:
$this->setStaticVersion($projectVersion);
break;
case ProjectVersionModeEnumeration::GIT:
$this->setVersionFromGit($projectVersion);
break;
Expand Down Expand Up @@ -114,6 +127,14 @@ protected function isGitAvailable(): bool
$returnCode === 0;
}

/**
* @param \KamiYang\ProjectVersion\Service\ProjectVersion $projectVersion
*/
private function setStaticVersion(ProjectVersion $projectVersion)
{
$projectVersion->setVersion(ExtensionConfiguration::getStaticVersion());
}

/**
* Resolve version by common VERSION-file.
*
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ First make sure you match the requirements:

| Requirement | Version |
| --- | --- |
| TYPO3 | \>=8.7.0 \<=8.7.19 &#124;&#124; >=9.4.0 <9.5 |
| TYPO3 | \>=8.7 <9.6 |
| php | \>= 7.0 |

### Composer
Expand Down Expand Up @@ -89,15 +89,14 @@ The new configuration screen will look like this:
- [x] Upload extension to packagist.org
- [x] Upload extension to TER
- [x] Support TYPO3 v9.4
- [ ] Support TYPO3 v9 LTS
- [x] Support TYPO3 v9 LTS
- [x] Achieve overall test coverage above 95%
- [x] Configure [TravisCI](https://travis-ci.org/KamiYang/project_version)
- [x] Configure [StyleCI](https://github.styleci.io/repos/134700322)
- [x] Configure [Coveralls](https://coveralls.io/github/KamiYang/project_version)
- [ ] Automate release to TER using [Travis-CI](https://travis-ci.org/) and [helhum/ter-client](https://github.com/helhum/ter-client)
- [x] Static VERSION value via extension configuration

### Milestone for v0.6.0
- Automated release management and upload to TER.
- Ability to "hardcode" static project version via the TYPO3 backend

## Note
Expand Down
14 changes: 12 additions & 2 deletions Tests/Unit/Backend/ToolbarItems/ProjectVersionSlotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@

namespace KamiYang\ProjectVersion\Tests\Unit\Backend\ToolbarItems;

/*
* This file is part of the ProjectVersion project.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* For the full copyright and license information, please read
* LICENSE file that was distributed with this source code.
*/

use KamiYang\ProjectVersion\Backend\ToolbarItems\ProjectVersionSlot;
use KamiYang\ProjectVersion\Facade\LocalizationUtilityFacade;
use KamiYang\ProjectVersion\Service\ProjectVersion;
Expand All @@ -14,8 +26,6 @@

/**
* Class ProjectVersionSlotTest
*
* @author Jan Stockfisch <[email protected]>
*/
class ProjectVersionSlotTest extends UnitTestCase
{
Expand Down
Loading

0 comments on commit 2996671

Please sign in to comment.