Skip to content

Commit 3ed66c1

Browse files
committed
Upgrade jppm to 0.5.6
1 parent 0293d86 commit 3ed66c1

File tree

7 files changed

+31
-8
lines changed

7 files changed

+31
-8
lines changed

packager/buildSrc/AppPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function build(Event $event)
183183
$compiler->compile($event->package());
184184
}
185185

186-
$launcherConf['types'] = $launcherConf['types'] ?? ['jar', 'sh', 'bat'];
186+
$launcherConf['types'] = $launcherConf['types'] ?? ['sh', 'bat'];
187187

188188
if (!$launcherConf['disabled']) {
189189
Console::log("-> create jphp app launcher");

packager/buildSrc/DefaultPlugin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ function init(Event $event)
135135
Console::log("Success, {0} has been created.", Package::FILENAME);
136136
}
137137

138-
Console::log("✨ Done.");
138+
Console::printForXterm("");
139+
Console::log("Done.");
139140
}
140141

141142
/**

packager/package.php.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ github:
1414
> JPHP Package Manager v%version%
1515
1616
**What's new**
17-
+ Fix bytecode compilation for Linux & Mac.
17+
+ Fix Tasks::run() up-to-date status when using flags.
18+
+ Colorized output for Xterm console (Linux, Mac, Cygwin).
1819
1920
**Downloads**
2021
+ For Windows: [JPPM Windows Installer](%github.address%/releases/download/jppm-%version%/jppm-setup-%version%.exe)

packager/src-php/packager/Colors.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?php
22
namespace packager;
33

4+
use packager\cli\Console;
5+
use php\lang\System;
46
use php\lib\char;
7+
use php\lib\str;
58

6-
class Colors{
9+
class Colors {
710
public static $ANSI_CODES = array(
811
"off" => 0,
912
"bold" => 1,
@@ -33,10 +36,10 @@ class Colors{
3336

3437
public static function withColor($str, $color)
3538
{
36-
37-
if(Package::getOS()=='win'){
39+
if (!Console::isXTerm()) {
3840
return $str;
3941
}
42+
4043
$color_attrs = explode("+", $color);
4144
$ansi_str = "";
4245

packager/src-php/packager/Package.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ public function fetchIgnore(): Ignore
369369
$ignore->addRule("/" . self::LOCK_FILENAME);
370370

371371
$ignore->addRule($this->getConfigBuildPath() . "/**");
372+
$ignore->addRule( $this->getConfigBuildPath() . "-*/**");
372373
$ignore->addRule($this->getConfigVendorPath() . "/**");
373374
$ignore->addRule("/package.*.yml");
374375
$ignore->addRule("/.gradle/**");

packager/src-php/packager/cli/Console.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
namespace packager\cli;
33

4-
54
use packager\Colors;
65
use php\io\Stream;
76
use php\lang\System;
@@ -11,13 +10,31 @@
1110

1211
class Console
1312
{
13+
public static function isXTerm(): bool
14+
{
15+
static $xterm;
16+
17+
if ($xterm === null) {
18+
$xterm = str::equalsIgnoreCase($_ENV['TERM'], 'xterm');
19+
}
20+
21+
return $xterm;
22+
}
23+
1424
public static function log($message, ...$args)
1525
{
1626
static::print($message, ...$args);
1727

1828
System::out()->write("\n");
1929
}
2030

31+
public static function printForXterm($message, ...$args)
32+
{
33+
if (Console::isXTerm()) {
34+
static::print($message, ...$args);
35+
}
36+
}
37+
2138
public static function print($message, ...$args)
2239
{
2340
$stream = System::out();

packager/src-php/packager/cli/ConsoleApp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function invokeTask(string $task, array $args, ...$flags)
212212

213213
if ($handler = $command['handler']) {
214214
foreach ($command['dependsOn'] as $one) {
215-
$this->invokeTask($one, $args);
215+
$this->invokeTask($one, $args, ...$flags);
216216
}
217217

218218
Console::log("-> {0} {1}", $task, ($flags ? '-' : '') . flow($flags)->keys()->toString(' -'));

0 commit comments

Comments
 (0)