Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import golo scripts #3

Open
k33g opened this issue May 3, 2013 · 5 comments
Open

import golo scripts #3

k33g opened this issue May 3, 2013 · 5 comments

Comments

@k33g
Copy link
Member

k33g commented May 3, 2013

is that the import golo scripts is supposed to be managed? (sorry about my english)

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at fr.insalyon.citi.golo.cli.MainGoloGolo.main(MainGoloGolo.java:69)
Caused by: java.lang.NoSuchMethodError: sam
    at fr.insalyon.citi.golo.runtime.FunctionCallSupport.fallback(FunctionCallSupport.java:88)
    at bob.main(bob.golo)
    ... 5 more
@davidfestal
Copy link
Member

No, the run golo file in the editor contextual menu doesn't support imports for now.
We need to implement a proper build mechanism first to be able to add the output directory on the classpath during the run.
Or while keeping interpreted mode we could detect imports in the editor Ast and add the corresponding golo files on the generated command line for run, but this will be quite limited.

@k33g
Copy link
Member Author

k33g commented May 4, 2013

by loading all golo scripts of the project ?

@davidfestal
Copy link
Member

I was meaning by adding only the files imported by the currently edited file. But this is very limited because it doesn't support transitive imports.
Sure, we could add all the project files but it seems a bit too much.
I think in those cases, compiling to an output directory and running from the classes will be the best.

@k33g
Copy link
Member Author

k33g commented May 4, 2013

i use something like that : https://github.com/k33g/Fast20/blob/master/src/fast/jgolo/KlassLoader.java
for the moment ;) I have no problem
... a little bit dirty (I recognize it) but it works :)

@k33g
Copy link
Member Author

k33g commented May 4, 2013

finally being I use the same kind of logic to work with sublimetext :

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_12.jdk/Contents/Home
export GOLO_HOME=/Users/k33g_org/Dropbox/golo/r0/bin

echo "1- loading jars"
#FIND JARS
JARS=""
FILES="$(find $1 -name '*.jar')"
for jar in $FILES
do
    JARS="$JARS$PWD/$jar:"
    echo "--> $jar"
done

export CLASSPATH_PREFIX=${CLASSPATH_PREFIX}:"$JARS"


echo "2- loading Golo Libraries"
#FIND GOLO LIBRARIES
LIBS=""
FILES="$(find $1 -name '*.golo')"
for gf in $FILES
do
    LIBS="$LIBS $gf"
    echo "--> $gf"
done

echo "3- running $2"
echo 

$GOLO_HOME/gologolo $LIBS $2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants