A Cappuccino project has always needed to have a flat file structure to
be able to compile from source in the web browser.
A new dictionary can be added to the project's Info.plist with the key
'CPFileTranslationDictionary'. It should contain all the path
translations in the project to allow the Browser to find out where in
the file structure the source files are. Check in the AppKit framework
for an example.
Also, a include list can be added in the Info.plist for the key
'CPCompileIncludeFileArray'. The file in the list will be included
by a '#include' statement for each file that is compiled in this project
A last new feature is to add macros in the 'OBJJ_COMPILER_FLAGS' global
variable. It is usually declared in the index.html file. It is done
with the format '-Dmacroname[=macrodefinition]'.
An updated Info.plist file in the AppKit framework will allow the AppKit
to compile from the source in the web browser. The following things is
needed to get this to work:
1. Replace the AppKit folder in your project's Frameworks folder with a
copy of the AppKit folder from the Cappuccino project.
2. Add a copy of the built Aristo2.blend folder to the AppKit's Resource
folder.
3. Add "-DPLATFORM_DOM", "-DPLATFORM_BROWSER" and optionally "-DDEBUG"
to the global variable 'OBJJ_COMPILER_FLAGS' in the project's index.html
file.
The app load time will increase (about 3 seconds on a 2018 MacBook Pro)
as the AppKit framework is compiled from source.
The Foundation framework is not yet tested but it might be working by
adding info about the file structure in the Info.plist file.
This new warning adds a lot of warnings in the Cappuccino frameworks. I have turned off
the warning in the Jakefiles when compiling most of the Cappuccino frameworks. But it is
on as default for any user projects.
So there is also a new feature to turn off/on warnings as a compiler flag.
These flags are (all flags are on as default):
-Wunused-but-set-variable Warning when a local variable is never read.
-Wshadow-ivar Warning when a local variable is shadowing an instance variable for the class.
-Wcreate-global-inside-function-or-method Warning when creating a global variable inside a function or method.
-Wunknown-class-or-global Warning when a class or global variable is not known.
-Wunknown-ivar-type Warning when the type for an instance variable is not known.
To turn off a flag add a 'no-' prefix. Example: -Wno-unused-but-set-variable
For an example how to use it in a Jakefile please look at the Jakefiles in this commit.
The compiler can now run in IE8. Also found the use of the function .indexOf on Arrays in CPView.j.
It is not supported in IE8.
Added a new file (OldBrowserCompatibility.js) in the Objective-J framework that will add functions if they are not supported in the javascript runtime.