Skip to content

Commit a89faf4

Browse files
committed
Small update
1 parent ce338f9 commit a89faf4

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

jppm-plugin/src/AndroidPlugin.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
/**
1919
* Class AndroidPlugin
2020
*
21-
* @jppm-task-prefix android
22-
* @jppm-task init as init
23-
* @jppm-task compile as compile
24-
* @jppm-task compile_install as compile:adb
25-
* @jppm-task run as run
21+
* @jppm-task init as android:init
22+
* @jppm-task compile as android:compile
23+
* @jppm-task compile_install as android:compile:adb
24+
* @jppm-task run as android:run
25+
*
26+
* @jppm-task compile as build
2627
*/
2728
class AndroidPlugin {
2829

@@ -122,7 +123,7 @@ public function exec_gradle_task(Event $event, string $task) {
122123
$this->prepare_compiler();
123124
$this->generate_gradle_build($event);
124125

125-
Tasks::run("build", [], null);
126+
Tasks::run("app:build", [], null);
126127

127128
$buildFileName = "{$event->package()->getName()}-{$event->package()->getVersion('last')}";
128129
Console::log('-> unpack jar');
@@ -212,6 +213,8 @@ public function compile_install(Event $event) {
212213
/**
213214
* Run project on desktop
214215
*
216+
* @jppm-dependency-of start
217+
*
215218
* @param Event $event
216219
* @throws IOException
217220
* @throws IllegalArgumentException
@@ -228,6 +231,8 @@ public function run(Event $event) {
228231
Console::error("Unable to run unknown UI type");
229232
exit(103);
230233
}
234+
235+
exit(0);
231236
}
232237

233238
protected function prepare_compiler() {

ui-javafx/src-jvm/main/java/org/venity/jphp/ext/android/UXAndroidApplication.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@
88
import com.gluonhq.charm.down.plugins.DisplayService;
99
import javafx.stage.Stage;
1010
import org.venity.jphp.ext.android.android.classes.UXMobileApplication;
11+
import php.runtime.Memory;
1112

1213
import java.io.IOException;
1314

1415
public class UXAndroidApplication extends MobileApplication {
1516

17+
private StandaloneAndroidLoader loader;
18+
1619
public static void main(String[] args) {
1720
launch(args);
1821
}
1922

2023
@Override
2124
public void init() throws IOException {
22-
StandaloneAndroidLoader loader = new StandaloneAndroidLoader();
25+
loader = new StandaloneAndroidLoader();
2326
loader.setClassLoader(getClass().getClassLoader());
2427
loader.loadLibrary();
2528
loader.run();
@@ -40,6 +43,7 @@ public void postInit(Scene scene) {
4043
stage.setTitle("jPHP For Android sandbox");
4144
}
4245

43-
UXMobileApplication.getCallback().callNoThrow();
46+
if (UXMobileApplication.getCallback() != null)
47+
UXMobileApplication.getCallback().callNoThrow(Memory.wrap(loader.env, scene));
4448
}
4549
}

0 commit comments

Comments
 (0)