ceylon / ceylon-js

DEPRECATED
Apache License 2.0
54 stars 9 forks source link

Files in two source directories don't see each other #590

Closed jpragey closed 9 years ago

jpragey commented 9 years ago

If module source files are spread in two source directories (eg 'source' and 'test-source'), 'test-source' code don't see 'source' stuff, when you compile them in shell. That's a problem for whitebox testing, where test and app code must be in the same module.

Note that it's OK when compiling from eclipse, or for java.

Example:

//source/app/run.ceylon
shared void run() {}

// test-source/app/tests.ceylon
shared void runTests() {
    run();
}
$ceylon compile-js
Error: Errors found. Compilation stopped.
Note: Created module default
Note: Created module app/1.0.0
error encountered [function or value does not exist: 'run'] at 3:4-3:6 of tests.ceylon
ceylon compile-js: 1 errors.
chochos commented 9 years ago

you must specify the test-source in the command, since the default is just source

jpragey commented 9 years ago

Problem persists with:

ceylon compile-js --src=source:test-source

BTW I think I found another issue: if the second path in '--src' argument doesn't exists (--src=source:dummy), I get a java.lang.StringIndexOutOfBoundsException: String index out of range: -1

chochos commented 9 years ago

I tried with test-source and am not getting this error; files are compiled just fine. But I do get an error if I specify an invalid path in --src.