B4J Question How to stop B4ABuilder - Command line compilation in Jshell

Alimoeini

Member
Hi guys .
I use from B4ABuilder - Command line compilation for create a cms but i have a question now.
I need stop this compiler when run it.
how can I stop this compile after run it ?
I say this question in this thread and Erel say you should use Jshell library.
I used Jshell but when i killProcess middle of the compile dosent stop and there is in task manager and cpu running .

My codes are :

B4X:
#Region Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 600
#End Region

Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private xui As XUI
    Private Shell As Shell
    Private btnStart As B4XView
    Private btnStop As B4XView
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1")
    MainForm.Show
    
    Shell.Initialize("Shell", "cmd", Array("/c","""E:\Program Files (x86)\Anywhere Software\Basic4android\B4ABuilder.exe""","-Task=Build","-NoSign=False","-Obfuscate=False","-BaseFolder=C:\xampp\htdocs\shopper\shop"))
End Sub

Sub btnStart_Click
    Log("Started")
    Shell.Run(-1)
End Sub
Sub btnStop_Click
    Log("Stoped")
    Shell.KillProcess
End Sub

Sub Shell_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
    Log($"Success: ${Success},
    Out: ${StdOut}
    Error: ${StdErr}"$)
    Log(Success)
    Log("#################################################")
    Log(StdOut)
    Log("#################################################")
    Log(StdErr)
End Sub

And you can see my task manager after KillProcess in this image :

Screenshot (49).png
 

Alimoeini

Member
The builder itself starts other processes. It will be more complicated to stop these processes. You can try to delete the objects folder and cause them to fail.
Hi erel thanks for yor response.
I cant delete or rename or move that folder or file when compile is running because system say :
"the action cannot be completed because the folder or a file in it is open in another program"
I try this by cmd and run as adminstator but these arent work and say access denide.
after compile i can use them what do i do ?

Screenshot (51).png


you can see those error ( windows and cmd ) when i want stop compiler middle of the running !!!
 
Upvote 0
Top