heremaps / gluecodium

Cross-language bindings generator for C++, Java, Swift, and Dart
Apache License 2.0
202 stars 27 forks source link

Failed to build example: SEVERE: Failed reading options: Unrecognized option: -nostdout #541

Closed iamsergio closed 3 years ago

iamsergio commented 4 years ago

Are there any requirements regarding Java and Gradle ? It fails on my Archlinux (gradle 6.6 ; OpenJDK 1.8)

$ ./generate -input ${PWD}/examples/libhello/lime -output ${PWD}/generated -nostdout
Oct 18, 2020 1:15:32 PM com.here.gluecodium.Gluecodium$Companion main
INFO: Version: 8.4.5
Oct 18, 2020 1:15:33 PM com.here.gluecodium.Gluecodium$Companion main
SEVERE: Failed reading options: Unrecognized option: -nostdout
usage: generate [input] [-auxinput <arg>] [-cache] [-commonoutput <arg>]
       [-copyright <arg>] [-cppexport <arg>] [-cppnamerules <arg>]
       [-cppnamespace <arg>] [-dartlookuperrormessage <arg>]
       [-dartnamerules <arg>] [-generators <arg>] [-help] [-input <arg>]
       [-internalprefix <arg>] [-intnamespace <arg>] [-intpackage <arg>]
       [-javanamerules <arg>] [-javanonnullannotation <arg>]
       [-javanullableannotation <arg>] [-javapackage <arg>] [-libraryname
       <arg>] [-mergemanifest <arg>] [-options <arg>] [-output <arg>]
       [-stubs] [-swiftnamerules <arg>] [-validate] [-version] [-werror
       <arg>]
Gluecodium - Generate APIs from LimeIDL files

 -auxinput <arg>                                 Auxiliary IDL sources
                                                 that are loaded but not
                                                 generated from
 -cache,--enable-caching                         enable caching of output
                                                 files, only available if
                                                 output destination is set
 -commonoutput,--common-output-dir <arg>         Common generated files
                                                 output directory,
                                                 defaults to be the same
                                                 as output
 -copyright,--copyright-header <arg>             Specify the path for the
                                                 file containing the
                                                 copyright header that
                                                 will be appended to all
                                                 the generated files.
 -cppexport <arg>                                C++ export macro name for
                                                 explicit symbol
                                                 exporting.
 -cppnamerules <arg>                             C++ name rules property
                                                 file.
 -cppnamespace <arg>                             C++ namespace for public
                                                 (API) headers.
 -dartlookuperrormessage <arg>                   Custom error message for
                                                 when Dart FFI function
                                                 lookup fails.
 -dartnamerules <arg>                            Dart name rules property
                                                 file.
 -generators <arg>                               List of generators to
                                                 use, separated by comma.
                                                 If empty, all available
                                                 generators are used.
                                                 Available generators:
                                                 android, cpp, swift,
                                                 lime, dart
 -help                                           Shows this help and
                                                 exits.
 -input <arg>                                    The path or the file to
                                                 use for generation
 -internalprefix <arg>                           Name prefix for internal
                                                 conversion functions in
                                                 Swift.
 -intnamespace,--cpp-internal-namespace <arg>    C++ namespace for
                                                 internal (non-API)
                                                 headers. Multiple
                                                 namespace levels may be
                                                 separated with '.'.
 -intpackage,--java-internal-package <arg>       Java package name to
                                                 append to 'javapackage'
                                                 for internal types.
 -javanamerules <arg>                            Java name rules property
                                                 file.
 -javanonnullannotation <arg>                    Java @NonNull annotation
                                                 full name including
                                                 package
 -javanullableannotation <arg>                   Java @Nullable annotation
                                                 full name including
                                                 package
 -javapackage <arg>                              Java package name
 -libraryname <arg>                              Name of the generated
                                                 library for some
                                                 generators (e.g. Dart).
 -mergemanifest,--android-merge-manifest <arg>   A second
                                                 AndroidManifest.xml that
                                                 will be merged with the
                                                 generated
                                                 AndroidManifest.xml
 -options <arg>                                  Options file to load
                                                 options from
 -output <arg>                                   Generated files output
                                                 directory
 -stubs,--generate-stubs                         Generate stubs for
                                                 classes and methods,
                                                 enabling mocking in unit
                                                 tests. Only supported for
                                                 Java and Dart.
 -swiftnamerules <arg>                           Swift name rules property
                                                 file.
 -validate,--validate-only                       Perform validation of
                                                 input files without
                                                 generating any code.
 -version                                        Prints version info and
                                                 exits.
 -werror,--warning-as-error <arg>                Treat the specified
                                                 validation warning type
                                                 as an error. Possible
                                                 values: DocLinks,
                                                 DeprecatedAttributes,
                                                 DartOverloads

Please report issues here: https://github.com/heremaps/gluecodium/issues

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gluecodium:run'.
> Process 'command '/usr/lib/jvm/java-8-openjdk/bin/java'' finished with non-zero exit value 1

* 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.

The arguments passed to java were:

java -Xmx64m -Xms64m -Dorg.gradle.appname=gradlew -classpath /data/sources/gluecodium/gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain -q run --args=-input /data/sources/gluecodium/examples/libhello/lime -output /data/sources/gluecodium/generated -nostdout

iamsergio commented 4 years ago

Without -nostdout I get

With jre11:


WARNING: com.here.gluecodium.common.LimeLogger log: File /data/sources/gluecodium/examples/libhello/lime/test/Comments.lime, element test.CommentsLinks.random_method: Failed to resolve documentation reference [comments.SomeArray]
WARNING: com.here.gluecodium.common.LimeLogger log: File /data/sources/gluecodium/examples/libhello/lime/test/Comments.lime, element test.CommentsLinks.random_method: Failed to resolve documentation reference [comments.SomeMap]
WARNING: com.here.gluecodium.common.LimeLogger log: File /data/sources/gluecodium/examples/libhello/lime/test/Comments.lime, element test.CommentsLinks.random_method: Failed to resolve documentation reference [CommentsTypeCollection.TypeCollectionTypedef]
WARNING: com.here.gluecodium.common.LimeLogger log: File /data/sources/gluecodium/examples/libhello/lime/test/Comments.lime, element test.CommentsLinks.random_method: Failed to resolve documentation reference [outputParameter]
WARNING: com.here.gluecodium.common.LimeLogger log: File /data/sources/gluecodium/examples/libhello/lime/test/ArraysByteBuffer.lime, element test.ArraysByteBuffer.methodThatExplodes: Failed to resolve documentation reference [x00,x01,x02]
SEVERE: com.here.gluecodium.Gluecodium$Companion checkForFileNameCollisions: Generator 'android' is overwriting file android/com/example/test/SystemColor.java created already by 'android' 
SEVERE: com.here.gluecodium.Gluecodium$Companion checkForFileNameCollisions: Generator 'android' is overwriting file android/com/example/test/SystemColor.java created already by 'android' 
SEVERE: com.here.gluecodium.Gluecodium$Companion checkForFileNameCollisions: Generator 'android' is overwriting file android/com/example/test/Season.java created already by 'android' 
SEVERE: com.here.gluecodium.Gluecodium$Companion checkForFileNameCollisions: Generator 'android' is overwriting file android/com/example/test/Season.java created already by 'android' 
SEVERE: com.here.gluecodium.Gluecodium$Companion checkForFileNameCollisions: Generator 'android' is overwriting file android/jni/com_example_test_SystemColor__Conversion.h created already by 'android' 
SEVERE: com.here.gluecodium.Gluecodium$Companion checkForFileNameCollisions: Generator 'android' is overwriting file android/jni/com_example_test_SystemColor__Conversion.cpp created already by 'android' 
SEVERE: com.here.gluecodium.Gluecodium$Companion checkForFileNameCollisions: Generator 'android' is overwriting file android/jni/com_example_test_Season__Conversion.h created already by 'android' 
SEVERE: com.here.gluecodium.Gluecodium$Companion checkForFileNameCollisions: Generator 'android' is overwriting file android/jni/com_example_test_Season__Conversion.cpp created already by 'android' ```
iamsergio commented 4 years ago

I think it's just the README which needs updating ?

It also mentions -enableCaching , which was removed some time ago

DanielKamkha commented 4 years ago

Our README file is definitely outdated. Might also be the cause of your initial problem. I'll have a look today or tomorrow.

DanielKamkha commented 3 years ago

Example projects got seriously outdated in the past year-and-something. They no longer compile. It is also no longer feasible to update them. Ideally we need to recreate them from scratch, but this effort is constantly of low priority compared to the need of new features and fixes.

I've pushed an update to README files so that at least they are no longer misleading with regard to "examples" project.

@iamsergio, if you have any ideas on what kind of example project could have helped you as an entry point, you feedback would be much appreciated.

iamsergio commented 3 years ago

I've found that ./generate -input ${PWD}/examples/libhello/lime/hello/ -output ${PWD}/generated simply works, while ./generate -input ${PWD}/examples/libhello/lime/ -output ${PWD}/generated doesn't.

i.e. building just for hello/, ignoring the tests (which are the culprit).

Not sure if the code will run, but at least the generated/ folder is full of dart bindings :).

So to close this bug, maybe just:

iamsergio commented 3 years ago

thanks for the updates!