electron experiences?

Forum to discuss the new web client version of Servoy.

electron experiences?

Postby tgs » Sat Dec 22, 2018 9:49 pm

Does somebody has experiences with electron?

Today I got it running on my Mac and I would like to deploy the NG Client with that. It feels more like a Smart Client than a webbrowser solution.
But there are a lot of questions how to get the electron deployment working.

This are my first steps:

1. Installing node and npm:
Code: Select all
sudo npm install npm -g

Version node: v10.9.0
Version npm: 6.5.0

2. Installing electron:
Code: Select all
npm install electron --save-dev

Version: 4.0.0

3. Open NG Solution in electron:
Code: Select all
/path-to-Electron.app/Contents/MacOS/Electron https://mySolution.com:8443/mySolution/solutions/mySolution/index.html


The readme on GitHub/Servoy/electron makes it not clear for me
- how to change/set properties (solution URL, app icon, window size)
- how to pack the application
- how to create the executable

Regards
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: electron experiences?

Postby tgs » Sun Dec 23, 2018 8:02 pm

Now I made some further steps to build an executable:

- I have stored and modified as discribed on GitHub/Servoy/electron the build.xml to my electron direction.
- I opened the Terminal, changed to the electron direction and executed: ant run.electron

The executable file should be created in the ../electron/ElectronClient/ directory (as presented from Sean in the Tech Webinar #39).
But the build failed. This is what I get in the Terminal:
Code: Select all
iMac:electron thomas$ ant run.electron
Buildfile: /Volumes/iMac/Users/thomas/electron/build.xml
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

run.electron:
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

run.electron.init:
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

run.electron.windows:
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

run.electron.mac:
     [echo] Mac Target
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

run.electron.install:

BUILD FAILED
/Volumes/iMac/Users/thomas/electron/build.xml:27: The following error occurred while executing this line:
/Volumes/iMac/Users/thomas/electron/build.xml:34: The following error occurred while executing this line:
/Volumes/iMac/Users/thomas/electron/build.xml:64: The following error occurred while executing this line:
/Volumes/iMac/Users/thomas/electron/build.xml:74: Problem: failed to create task or type if
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Ok, the Cause and Action output should be clear, but I can't find anything went wrong...
The build.xml is exactly the same as on GitHub/Servoy/electron except the changes for the "url" property. The "platform" and "arch" properties are correkt.
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: electron experiences?

Postby Joas » Mon Dec 24, 2018 7:22 am

I don't get this error, but I am on windows.
What is the value of the name property in build.xml? Have you tried changing it?

With my name property like this:
Code: Select all
<property name="name" value="--name electronjoas" />

The executable ends up here, when I run "ant run.electron":
Code: Select all
...\electron\ElectronClient\lib\electronjoas-win32-x64\electronjoas.exe


Also, when the build worked for the first time, I couldn't run the executable because of an error about missing library "electron-google-analytics". I had to run "npm install electron-google-analytics" in the folder it is complaining about, I'm not entirely sure which folder that was.
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: electron experiences?

Postby tgs » Mon Dec 24, 2018 2:58 pm

Hi Joas,

changing the value of the name property in build.xml doesn't makes it work.
But I could solve the
Code: Select all
[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

I (re)installed the antcontrib by: brew install ant-contrib

When I execute now: ant run.electron
I get this output:
Code: Select all
iMac:electron thomas$ ant run.electron
Buildfile: /Volumes/iMac/Users/thomas/electron/build.xml

run.electron:

run.electron.init:

run.electron.windows:

run.electron.mac:
     [echo] Mac Target

run.electron.install:
     [echo] NPM install

BUILD FAILED
/Volumes/iMac/Users/thomas/electron/build.xml:27: The following error occurred while executing this line:
/Volumes/iMac/Users/thomas/electron/build.xml:34: The following error occurred while executing this line:
/Volumes/iMac/Users/thomas/electron/build.xml:64: The following error occurred while executing this line:
/Volumes/iMac/Users/thomas/electron/build.xml:99: The directory /Volumes/iMacHDD/Users/thomas/electron/ElectronClient/app does not exist

In the build.xml the lines correspond as:
27 = <antcall target="run.electron.init"/>
34 = <antcall target="run.electron.mac"/>
64 = <antcall target="run.electron.install"/>
99 = <exec dir="ElectronClient/app" executable="${shell}">

I have checked the user rights and ownership of the files and directories.
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 3 guests