Moonshine-IDE / ZoneMinder-tvOS

AppleTV Solution To ZoneMinder Streaming Using Moonshine Form Builder
0 stars 0 forks source link

Generating Database On Vagrant On Windows #2

Closed rat-moonshine closed 1 year ago

rat-moonshine commented 1 year ago

Target:

rat-moonshine commented 1 year ago

While trying to "Deploy Domino Database" on Windows, I saw strange value in "Local Database" path:

/Users/joelanderson/Documents/Flex/workspace/Cameras/nsfs/nsf-moonshine/target/nsf-moonshine-domino-1.0.0.nsf

image

rat-moonshine commented 1 year ago

@JoelProminic @solaechea While running Project > Generate Java Agents on "CamerasFormBuilderProject_JavaAgents", Moonshine returned following errors:

:   inflating: build.gradle            
:   inflating: CamerasFormBuilderProject_JavaAgents.javaproj  
:   inflating: gradle.properties       
: > Task :clean UP-TO-DATE
: > Task :compileJava FAILED
: 2 actionable tasks: 1 executed, 1 up-to-date
: Conversion failed with exit code: 1
: warning:  /tmp/restinterface/upload/B27278F7-D173-CB90-9344-55C55B676815.zip appears to use backslashes as path separators
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraCreate.java:23: error: illegal start of expression
: %editable/FieldList%
: ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraCreate.java:24: error: illegal start of expression
:       return fields;
:       ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraCreate.java:23: error: not a statement
: %editable/FieldList%
:                    ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraCreate.java:24: error: not a statement
:       return fields;
:              ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraCreate.java:57: error: illegal start of expression
: %all/FieldList%
: ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraCreate.java:58: error: illegal start of expression
:       return fields;
:       ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraCreate.java:57: error: not a statement
: %all/FieldList%
:               ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraCreate.java:58: error: not a statement
:       return fields;
:              ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:24: error: illegal start of expression
: %all/FieldList%
: ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:25: error: illegal start of expression
:       return fields;
:       ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:24: error: not a statement
: %all/FieldList%
:               ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:25: error: not a statement
:       return fields;
:              ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:30: error: illegal start of expression
: %key/KeyList%
: ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:32: error: illegal start of expression
:       if (keys.size() <= 0) {
:       ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:30: error: not a statement
: %key/KeyList%
:             ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:32: error: not a statement
:       if (keys.size() <= 0) {
:          ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraRead.java:32: error: ';' expected
:       if (keys.size() <= 0) {
:                            ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraUpdate.java:20: error: illegal start of expression
: %editable/FieldList%
: ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraUpdate.java:21: error: illegal start of expression
:       return fields;
:       ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraUpdate.java:20: error: not a statement
: %editable/FieldList%
:                    ^
: /tmp/dxlimporter/20221108054512/src/main/java/CameraAgents/CameraUpdate.java:21: error: not a statement
:       return fields;
:              ^
: 21 errors
: FAILURE: Build failed with an exception.
: * What went wrong:
: Execution failed for task ':compileJava'.
: > Compilation failed; see the compiler error output for details.
: * Try:
: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
: * Get more help at https://help.gradle.org
: BUILD FAILED in 2s
JoelProminic commented 1 year ago

This is a problem with the "Generate Java Agents" logic. From the errors, I see invalid lines. like %editable/FieldList%. which should have been generated and replaced by the "Generate Java Agents" logic. I suspect there may be a race condition here. Try regenerating the project again, and if you get the same error then please spend some time debugging this.

rat-moonshine commented 1 year ago

I spent some long time behind this today. This probably not a race situation but somehow the file-updating API for some reasons while did updates some properties while some not.

Properties like file-name, class-naming etc. works, placeholders like %all/FieldList% etc. somehow skips. Looking into the debug-values, the population for the targeted placeholders' values does generates correctly, though:

image

I still need some time to figure what is happening.

rat-moonshine commented 1 year ago

Ugh! I just figured.

While the placeholder-keys generates on macOS with frontslash (i.e. %all/FieldList%), these keys generates with backslash on Windows (i.e. %all\FieldList%). It makes sense why the API failed to replace the tokens.

While the content of CameraCreate.java (and likewise files) as received from template.zip expects the keys with frontslash:

    @Override
    protected Collection<FieldDefinition> getReturnFieldList() {
        Collection<FieldDefinition> fields = new ArrayList<FieldDefinition>();
%all/FieldList%
        return fields;

    }

I'll see what I can do about this.

rat-moonshine commented 1 year ago

Since this related to Moonshine generation, I moved this issue to https://github.com/Moonshine-IDE/Moonshine-IDE/issues/1134. I'm closing the issue here now.