Problem with Jake Deploy

75 views
Skip to first unread message

Aaron Chang

unread,
Oct 20, 2015, 6:17:17 PM10/20/15
to Cappuccino & Objective-J
Not sure if my last post was successful. So, I might post again here.

I try to use jake to build my project and got the following error, but it was okay on some of my machines.

SyntaxError: 

@implementation StyleTrait : CPObject

                             ^

ERROR line 9 in file:/var/www/cps/web_root/assets/newcpseditor/StyleTrait.j: Can't find superclass CPObject


I am wondering if I setup my environment wrongly. Otherwise, why the same codes have different compile results?


Aaron

Aaron Chang

unread,
Oct 20, 2015, 9:01:25 PM10/20/15
to Cappuccino & Objective-J
Adding one more thing. It is CentOS that is not working. But, my MacOS has no problem. What am I missing here?

I also set 

NARWHAL_ENGINE=rhino


No luck. Any help?


Aaron

Aaron Chang

unread,
Oct 21, 2015, 8:13:16 PM10/21/15
to Cappuccino & Objective-J
I found it can be build in some folder but not in another folder on the same machine now.
I set the permission right. For some reason, it cannot consume all the source code files. Then, it shows missing superclass file error.

I still cannot figure why? any clue?

Aaron

Martin Carlberg

unread,
Oct 22, 2015, 4:26:30 PM10/22/15
to objec...@googlegroups.com
Hi!

I usually don’t build on Linux but it looks like jake does not find your frameworks. Do you have the paths setup correctly in the jake file?

Maybe someone with more experience building on Linux can help you with this?

Best regards,

- Martin


--
You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectivej+...@googlegroups.com.
To post to this group, send email to objec...@googlegroups.com.
Visit this group at http://groups.google.com/group/objectivej.
For more options, visit https://groups.google.com/d/optout.

Christian Passlack

unread,
Oct 27, 2015, 1:24:23 AM10/27/15
to Cappuccino & Objective-J
We had the same problem in the past. I copied the lines

@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>

of main.j to AppController.j and then everything works fine. The problem occurred when we updated to a newer Ubuntu version. It seems to me, that in the newer Ubuntu AppController is processed first and therefore the imports of the framework aren't there. But that's is just a guess.

Aaron Chang

unread,
Oct 27, 2015, 6:08:46 PM10/27/15
to Cappuccino & Objective-J
Your guess really gave me a good hint of the solution.
For some reason, in my case, the first processing file is not AppController.j, it is my own created class called Style.j. I added the framework import into that and everything is good.

But, I am worried that different OS starts from different file, I might end up with adding framework import in multiple files in order to for my application to be built in different OS.

Thanks,
Aaron

Christian Passlack

unread,
Oct 28, 2015, 3:47:41 AM10/28/15
to Cappuccino & Objective-J
Is your file Style.j in the root directory of your project? I think it's reliable that the build starts with the files in the root directory of the project. I would move own classes to separate dirs to avoid that a something other than AppController or main is processed first. I think the only difference between the different os is whether the files were ordered descending or acceding depending on their filename. But you are right, I think this is not really the expected behavior. I would think main.j is always processed first.

Anyway, nice that it solved your problem:)

Greetings,
Christian   

Martin Carlberg

unread,
Oct 28, 2015, 4:58:25 AM10/28/15
to objec...@googlegroups.com
Hi!

Ok, this gave good input what the problem is.

This is how it works. If you compile in the browsers the first file to compile is main.j. It will usually import Foundation, AppKit and your AppController.j. And so on...

If you compile from command line. Jake will ask the file system for a list of all your Objective-j files (*.j). This list has an undefined sort order. It is different depending on your OS. So the first file to compile can be any of your files. The list also depends on what files you have changed since last compile as Jake will filter out unchanged files. unless you have done ’jake clean'

The rule here is to always import your superclass(es) in all your files. You should also import all the classes that you use in your file. I usually just import <Foundation/CPObject.j> and/or <Foundation/CPArray.j> etc. instead of <Foundation/Foundation.j>. The difference is not big but it gives the build system at least a chance to skip files that are not needed.

This is the same way as it works in Objective-C and other languages. The build system should be able to compile every file independently. So all used classes has do be imported.

Happy coding!

- Martin



Reply all
Reply to author
Forward
0 new messages