-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for iterable XML blocks; preconfigure software registry
- Loading branch information
Showing
13 changed files
with
201 additions
and
4 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 |
---|---|---|
@@ -1,3 +1,21 @@ | ||
<?xml version="1.0"?> | ||
<dload> | ||
<registry> | ||
<software name="RoadRunner" description="High performant Application server"> | ||
<repository type="github" uri="roadrunner-server/roadrunner" pattern="/^roadrunner-.*/"/> | ||
<file rename="rr" pattern="/^(roadrunner|rr)(?:\.exe)?/" /> | ||
</software> | ||
</registry> | ||
<registry> | ||
<software name="Dolt" description="Dolt is a SQL database that you can fork, clone, branch, merge, push and pull just like a Git repository"> | ||
<repository type="github" uri="dolthub/dolt" pattern="/^dolt-.*/"/> | ||
<file pattern="/^(dolt)(?:\.exe)?/" /> | ||
</software> | ||
</registry> | ||
<registry> | ||
<software name="Temporal" description="Temporal command-line interface and development server"> | ||
<repository type="github" uri="temporalio/cli" pattern="/^temporal_cli_.*/"/> | ||
<file pattern="/^(temporal)(?:\.exe)?/" /> | ||
</software> | ||
</registry> | ||
</dload> |
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Internal\DLoad\Module\Common\Config; | ||
|
||
use Internal\DLoad\Module\Common\Internal\Attribute\InputOption; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class DestinationInput | ||
{ | ||
#[InputOption('path')] | ||
public ?string $path = null; | ||
|
||
#[InputOption('rename')] | ||
public ?string $rename = null; | ||
} |
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Internal\DLoad\Module\Common\Config\Embed; | ||
|
||
use Internal\DLoad\Module\Common\Internal\Attribute\XPath; | ||
|
||
final class File | ||
{ | ||
/** | ||
* @var non-empty-string|null In case of not null, found file will be renamed to this value with the same extension. | ||
*/ | ||
#[XPath('@rename')] | ||
public ?string $rename = null; | ||
|
||
#[XPath('@pattern')] | ||
public string $pattern = '/^.*$/'; | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Internal\DLoad\Module\Common\Config\Embed; | ||
|
||
use Internal\DLoad\Module\Common\Internal\Attribute\XPath; | ||
|
||
final class Repository | ||
{ | ||
#[XPath('@type')] | ||
public string $type = 'github'; | ||
#[XPath('@uri')] | ||
public string $uri; | ||
#[XPath('@pattern')] | ||
public string $pattern = '/^.*$/'; | ||
} |
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,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Internal\DLoad\Module\Common\Config\Embed; | ||
|
||
use Internal\DLoad\Module\Common\Internal\Attribute\XPath; | ||
use Internal\DLoad\Module\Common\Internal\Attribute\XPathEmbedList; | ||
|
||
final class Software | ||
{ | ||
#[XPath('@name')] | ||
public string $name; | ||
|
||
/** | ||
* If {@see null}, the name in lower case will be used. | ||
*/ | ||
#[XPath('@alias')] | ||
public ?string $alias = null; | ||
|
||
#[XPath('@description')] | ||
public string $description = ''; | ||
|
||
#[XPathEmbedList('repository', Repository::class)] | ||
public array $repositories = []; | ||
|
||
#[XPathEmbedList('file', File::class)] | ||
public array $files = []; | ||
} |
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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Internal\DLoad\Module\Common\Config; | ||
|
||
use Internal\DLoad\Module\Common\Internal\Attribute\Env; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class GitHubConfig | ||
{ | ||
#[Env('GITHUB_TOKEN')] | ||
public ?string $token = null; | ||
} |
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,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Internal\DLoad\Module\Common\Config; | ||
|
||
use Internal\DLoad\Module\Common\Internal\Attribute\XPathEmbedList; | ||
|
||
final class SoftwareRegistry | ||
{ | ||
#[XPathEmbedList('/dload/registry/software', Embed\Software::class)] | ||
public array $software = []; | ||
} |
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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Internal\DLoad\Module\Common\Internal\Attribute; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
#[\Attribute(\Attribute::TARGET_PROPERTY)] | ||
final class XPathEmbedList implements ConfigAttribute | ||
{ | ||
/** | ||
* @param non-empty-string $path | ||
* @param class-string $class | ||
*/ | ||
public function __construct( | ||
public string $path, | ||
public string $class, | ||
) {} | ||
} |
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