If anyone else is interested in using JSC, here are the changes that I made.

In the getFilePath() function of GoogDepsWriter, on line 377:

String classPath = className.replace(".", File.separator);
if(classPath.equals(className))
{
    classPath = className.replace("_", File.separator);
}

As a fallback, I kept the case where _ is replaced because the
org_apache_flex_utils_Language is still named with underscores right now,
and I was getting an error because of it.

Later in the same function:

String fwdClassPath = className.replace(".", "/");
if(fwdClassPath.equals(className))
{
    fwdClassPath = className.replace("_", "/");
}
String bckClassPath = className.replace(".", "\\");
if(bckClassPath.equals(className))
{
    bckClassPath = className.replace("_", "\\");
}

Finally, this change should also happen in the formatQualifiedName()
function in the JSFlexJSDocEmitter class. The doc comments also currently
reference class names with underscores.

protected String formatQualifiedName(String name)
{
    if (name.contains("goog.") || name.startsWith("Vector."))
        return name;
    name = name.replaceAll("\\.", ".");
    return name;
}

- Josh

On Sat, Jul 11, 2015 at 10:22 AM, Josh Tynjala <joshtynj...@gmail.com>
wrote:

> No rush! I can make the change locally.
>
> - Josh
> On Jul 10, 2015 9:26 PM, "Alex Harui" <aha...@adobe.com> wrote:
>
>> Sorry for the late reply.  I had internet issues all day.
>>
>> The problem is that GoogDepsWriter.java is still assuming “_” for package
>> separators.  See line 377.
>>   String classPath = className.replace("_", File.separator);
>>
>> I wasn’t planning on switching back to “.” until after next week or so,
>> but I suppose I could shift priorities.  Or if you have built your own
>> compiler you can limp along by making this change in your local copy.
>>
>> -Alex
>>
>> On 7/10/15, 4:15 PM, "Josh Tynjala" <joshtynj...@gmail.com> wrote:
>>
>> >Just in case someone gets confused, this line should not include
>> >newPack.OtherClass:
>> >
>> >java.lang.RuntimeException: Unable to find JavaScript filePath for class:
>> >newPack.OtherClass
>> >
>> >Bad copy-paste job. The real output was feathers.controls.SimpleButton
>> >too.
>> >
>> >On Fri, Jul 10, 2015 at 4:06 PM, Josh Tynjala <joshtynj...@gmail.com>
>> >wrote:
>> >
>> >> It looks like the jsc output type is having trouble with classes when
>> >> they're in packages. See the error below:
>> >>
>> >> Could not find file for class: feathers.controls.SimpleButton
>> >> java.lang.RuntimeException: Unable to find JavaScript filePath for
>> >>class:
>> >> newPack.OtherClass
>> >>     at
>> >>
>>
>> >>org.apache.flex.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWr
>> >>iter.java:174)
>> >>     at
>> >>
>>
>> >>org.apache.flex.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWr
>> >>iter.java:192)
>> >>     at
>> >>
>>
>> >>org.apache.flex.compiler.internal.graph.GoogDepsWriter.buildDB(GoogDepsWr
>> >>iter.java:127)
>> >>     at
>> >>
>>
>> >>org.apache.flex.compiler.internal.graph.GoogDepsWriter.getListOfFiles(Goo
>> >>gDepsWriter.java:79)
>> >>     at
>> >>
>>
>> >>org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSPublisher
>> >>.publish(MXMLFlexJSPublisher.java:325)
>> >>     at
>> >>org.apache.flex.compiler.clients.MXMLJSC.compile(MXMLJSC.java:467)
>> >>     at
>> >> org.apache.flex.compiler.clients.MXMLJSC._mainNoExit(MXMLJSC.java:346)
>> >>     at
>> >> org.apache.flex.compiler.clients.MXMLJSC.mainNoExit(MXMLJSC.java:272)
>> >>     at
>> >>
>>
>> >>org.apache.flex.compiler.clients.MXMLJSC.staticMainNoExit(MXMLJSC.java:23
>> >>1)
>> >>     at org.apache.flex.compiler.clients.MXMLJSC.main(MXMLJSC.java:177)
>> >>
>> >>
>> >> File not found: feathers.controls.SimpleButton
>> >>
>> >> If I put the SimpleButton class into the top-level package, it compiles
>> >> without error. Any ideas?
>> >>
>> >> - Josh
>> >>
>>
>>

Reply via email to