-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
281 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
version: "{branch}-{build}" | ||
build: false | ||
platform: x64 | ||
clone_folder: c:\projects\project | ||
clone_depth: 1 | ||
|
||
cache: | ||
- C:\ProgramData\chocolatey\bin -> .appveyor.yml | ||
- C:\ProgramData\chocolatey\lib -> .appveyor.yml | ||
- C:\tools\php -> .appveyor.yml | ||
- C:\tools\composer -> .appveyor.yml | ||
- '%LOCALAPPDATA%\Composer\files -> composer.json' | ||
|
||
## Build matrix for lowest and highest possible targets | ||
environment: | ||
matrix: | ||
- php: 7.0 | ||
- php: 7.1 | ||
- php: 7.2 | ||
|
||
init: | ||
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;C:\tools\composer;%PATH% | ||
- SET COMPOSER_NO_INTERACTION=1 | ||
- SET ANSICON=121x90 (121x90) | ||
- SET saxonb-path=C:\ProgramData\chocolatey\bin\SaxonHE\bin\Transform.exe | ||
|
||
## Install PHP and composer, and run the appropriate composer command | ||
install: | ||
# php | ||
- ps: | | ||
# Check if installation is cached | ||
if (!(Test-Path c:\tools\php)) { | ||
appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') | ||
Get-ChildItem -Path c:\tools\php | ||
cd c:\tools\php | ||
copy php.ini-production php.ini | ||
Add-Content php.ini "`n date.timezone=UTC" | ||
Add-Content php.ini "`n extension_dir=ext" | ||
Add-Content php.ini "`n memory_limit=1G" | ||
Add-Content php.ini "`n extension=php_openssl.dll" | ||
Add-Content php.ini "`n extension=php_mbstring.dll" | ||
Add-Content php.ini "`n extension=php_fileinfo.dll" | ||
Add-Content php.ini "`n extension=php_curl.dll" | ||
Add-Content php.ini "`n extension=php_xsl.dll" | ||
Add-Content php.ini "`n extension=php_soap.dll" | ||
} | ||
# composer | ||
- ps: | | ||
if (!(Test-Path C:\tools\composer)) { | ||
New-Item -path c:\tools -name composer -itemtype directory | ||
} | ||
if (!(Test-Path c:\tools\composer\composer.phar)) { | ||
appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar -Filename C:\tools\composer\composer.phar | ||
Set-Content -path 'C:\tools\composer\composer.bat' -Value ('@php C:\tools\composer\composer.phar %*') | ||
} | ||
# saxonb | ||
- ps: | | ||
if (!(Test-Path C:\ProgramData\chocolatey\bin\SaxonHE\bin\Transform.exe)) { | ||
appveyor-retry cinst --ignore-checksums -y saxonhe | ||
} | ||
# install composer dependences | ||
- cd c:\projects\project | ||
- appveyor-retry composer self-update --no-progress --no-interaction | ||
- appveyor-retry composer install --no-progress --no-interaction --prefer-dist | ||
|
||
## Run the actual test | ||
test_script: | ||
- cd c:\projects\project | ||
- mkdir build | ||
- vendor\bin\phplint | ||
- vendor\bin\phpcs -sp src tests | ||
- vendor\bin\php-cs-fixer fix --using-cache=no --dry-run --verbose | ||
- vendor\bin\phpunit | ||
- vendor\bin\phpstan.phar.bat --no-progress analyse --level max src tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# Guía para trabajar en MS Windows | ||
|
||
Microsoft windows no es el entorno de desarrollo primario, sin embargo aquí unos consejos | ||
para poder desarrollar (código o documentación) en esta plataforma. | ||
|
||
Recuerda consultar la [Guía del desarrollador](guia-desarrollador.md) | ||
y la [Guía del documentador](guia-documentador.md) como primeros pasos. | ||
|
||
## AppVeyor | ||
|
||
[AppVeyor] es una plataforma de integración continua con sistema operativo MS Windows. | ||
Esta librería es construida en esta plataforma para garantizar la compatibilidad. | ||
|
||
Gracias a la integración hecha en 2018-07-17 se pudieron encontrar algunos bugs menores | ||
y hacer las reparaciones necesarias, en especial en el paquete [XmlSchemaValidator]. | ||
|
||
|
||
## Chocolatey | ||
|
||
La forma más conveniente de preparar un entorno de desarrollo dentro de MS Windows es | ||
utilizar [Chocolatey]. Este es un gestor de paquetes (tipo `apt` o `yum`) que permite la | ||
instalación y actualización de software de manera ágil. | ||
|
||
Recuerda que para instalar, desinstalar o actualizar paquetes requieres privilegios administrativos. | ||
|
||
Estos son algunos comandos útiles para la instalación de paquetería: | ||
|
||
```shell | ||
choco install -y git php saxonhe | ||
``` | ||
|
||
|
||
## git | ||
|
||
Para evitar problemas con git y los finales de línea, es importante que configures tu entorno | ||
de desarrollo de la siguiente forma. | ||
Al momento de que [AppVeyor] hace el clon del proyecto está trabajando de esta misma manera. | ||
|
||
```shell | ||
git config --global core.autocrlf input | ||
``` | ||
|
||
> Referencias: | ||
> * <https://help.github.com/articles/dealing-with-line-endings/> | ||
> * <https://www.appveyor.com/docs/appveyor-yml/> | ||
|
||
## Ejecución de pruebas locales | ||
|
||
Para que puedas ejecutar los comandos que forman las pruebas del proyecto (lo "construyen") ejecuta: | ||
|
||
```shell | ||
:: verificar que se están compliendo las reglas de estilo | ||
vendor\bin\phpcs -sp src tests | ||
vendor\bin\php-cs-fixer fix --dry-run --verbose | ||
|
||
:: hacer las correcciones de estilo de forma automática | ||
vendor\bin\phpcbf -sp src tests | ||
vendor\bin\php-cs-fixer fix --verbose | ||
|
||
|
||
:: ejecutar las pruebas | ||
vendor\bin\phpunit | ||
|
||
:: ejecutar el analizador el analizador estático | ||
vendor\bin\phpstan.phar.bat --no-progress analyse --level max src tests | ||
``` | ||
|
||
Lamentablemente no se puede ejecutar `composer build` o alguno de los comandos personalizados | ||
definidos `composer.json` porque no funcionan correctamente. | ||
|
||
|
||
## SaxonB | ||
|
||
En [chocolatey] no se encuentra el código de SaxonB pero sí el de SaxonHE. | ||
|
||
El ejecutable se instala en `C:\ProgramData\chocolatey\bin\SaxonHE\bin\Transform.exe` | ||
y es compatible con la clase `SaxonBCliBuilder`. | ||
Si no lo tienes instalado no habrá problema, solamente los test relacionados se marcarán como saltados. | ||
Si no quieres que se salten puedes instalar SaxonHE y configurar una variable de entorno con lo que | ||
los test reconocerán el lugar donde está instalado y podrá ejecutar los tests: | ||
|
||
```shell | ||
:: definir la variable de entorno | ||
SET saxonb-path=C:\ProgramData\chocolatey\bin\SaxonHE\bin\Transform.exe | ||
|
||
:: mostrar el contenido de la variable de entorno | ||
ECHO %saxonb-path% | ||
|
||
:: ejecutar los tests | ||
vendor\bin\phpunit | ||
``` | ||
|
||
|
||
## Documentación | ||
|
||
En teoría, si tienes instalado [nodejs] y [python] ya sea usando [chocolatey] o por algún instalador | ||
deberías de poder ejecutar las herramientas de construcción de paquetes sin mayor complicación | ||
siguiendo los pasos generales de la [Guía del documentador](guia-documentador.md). | ||
|
||
```shell | ||
:: instalar las dependencias de nodejs para markdownlint | ||
npm install | ||
:: revisar la sintaxis de markdown | ||
node node_modules\markdownlint-cli\markdownlint.js *.md docs | ||
|
||
:: instalar mkdocs usando chocolatey | ||
choco install -y mkdocs mkdocs-material | ||
:: construyendo los documentos | ||
mkdocs build --strict --site-dir build\docs | ||
:: sirviendo los documentos | ||
mkdocs serve | ||
``` | ||
|
||
|
||
## GNU/Linux en MS Windows | ||
|
||
Con las últimas versiones de MS Windows es podible ejecutar en una máquina virtual interna | ||
alguna versión de GNU/Linux como Ubuntu o SUSE. Si sigues este camino, solo ten en cuenta que, | ||
aunque estés en un sistema operativo MS Windows en realidad los comandos se ejecutan en otra | ||
*máquina virtual* por lo que las pruebas y comandos que ejecutes será como Linux, no como MS Windows. | ||
|
||
|
||
[appveyor]: https://www.appveyor.com/ | ||
[chocolatey]: https://chocolatey.org/ | ||
[XmlSchemaValidator]: https://github.com/eclipxe13/XmlSchemaValidator | ||
[nodejs]: https://nodejs.org/es/ | ||
[python]: https://www.python.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.