Skip to content

Commit 375e130

Browse files
committed
Beta-4
1 parent 6ec9476 commit 375e130

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

develnext/launcher/DevelNext.exe

0 Bytes
Binary file not shown.

develnext/src/ide/build/OneJarBuildType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ function onExecute(Project $project, $finished = true)
161161
$dialog->setBuildPath($this->getBuildPath($project));
162162
$dialog->setOpenDirectory($this->getBuildPath($project));
163163

164-
$pathToProgram = Ide::get()->getJrePath() . "/bin/java -jar {$this->getBuildPath($project)}/{$project->getName()}.jar";
164+
$pathToProgram = [Ide::get()->getJrePath() . "/bin/java", "-jar", "{$this->getBuildPath($project)}/{$project->getName()}.jar"];
165165

166-
$dialog->setRunProgram($pathToProgram);
166+
//$dialog->setRunProgram($pathToProgram);
167167

168168
$dialog->showAndWait();
169169
}

develnext/src/ide/forms/BuildSuccessForm.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use php\gui\UXTextField;
1212
use php\io\File;
1313
use php\io\IOException;
14+
use php\lang\Process;
15+
use php\lib\fs;
16+
use php\lib\str;
1417

1518
/**
1619
* Class BuildSuccessForm
@@ -62,11 +65,21 @@ public function setOnOpenDirectory($onOpenDirectory)
6265

6366
public function setRunProgram($pathToProgram)
6467
{
65-
$pathToProgram = File::of($pathToProgram);
68+
$pathToProgram = is_array($pathToProgram) ? $pathToProgram : str::split($pathToProgram, ' ');
6669

6770
$this->onRun = function () use ($pathToProgram) {
6871
try {
69-
$result = `$pathToProgram`;
72+
$result = (new Process($pathToProgram, $this->buildPath, Ide::get()->makeEnvironment()))->start();
73+
74+
/*$exit = $result->getExitValue();
75+
76+
if ($exit != 0) {
77+
$error = $result->getError()->readFully();
78+
79+
if ($error) {
80+
UXDialog::showAndWait($error, 'ERROR');
81+
}
82+
} */
7083
} catch (IOException $e) {
7184
UXDialog::showAndWait('Невозможно запустить программу: ' . $e->getMessage(), 'ERROR');
7285
}
@@ -98,8 +111,8 @@ public function doShow()
98111
{
99112
Logger::info("Show build success: buildPath = {$this->buildPath}");
100113

101-
$this->runButton->visible = !!$this->onRun;
102-
$this->openButton->visible = !!$this->onOpenDirectory;
114+
$this->runButton->enabled = !!$this->onRun;
115+
$this->openButton->enabled = !!$this->onOpenDirectory;
103116

104117
$this->pathField->text = File::of($this->buildPath);
105118
}

develnext/src/ide/project/behaviours/BundleProjectBehaviour.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ public function doClose()
130130
}
131131
}
132132

133-
$this->bundleConfigs = [];
134-
$this->bundles = [];
133+
//$this->bundleConfigs = [];
134+
// $this->bundles = [];
135135
$this->fileStat = [];
136136
}
137137

0 commit comments

Comments
 (0)