chiquitinxx / grooscript

Converts your Groovy code to Javascript
https://www.grooscript.org
Other
221 stars 18 forks source link

Error compiling from groovyConsole #5

Closed chiquitinxx closed 11 years ago

chiquitinxx commented 11 years ago

Executing this code from groovyConsole fails. Seem a classpath issue with groovyConsole, works fine executing with groovy command.

@Grab('org.grooscript:grooscript:0.2.3') import org.grooscript.GrooScript

GrooScript.convert('source.groovy','./')

Fails if source.groovy contains for example: import org.grooscript.asts.GsNative

WARNING: Sanitizing stacktrace: java.lang.Exception: Compiler ERROR on Script -startup failed: script1365176628670.groovy: 1: unable to resolve class org.grooscript.asts.GsNative @ line 1, column 1. import org.grooscript.asts.GsNative ^

1 error

glaforge commented 11 years ago

Perhaps have a look at the classloader options that you can pass to your @Grab statements.

mariogarcia commented 11 years ago

Guillaume is right. The truth is that adding the proper @GrabConfig instruction, it compiles.

@GrabConfig(systemClassLoader=true) @Grab('org.grooscript:grooscript:0.2.3')

chiquitinxx commented 11 years ago

Closing, can be solved with grabconfig.