Question
· Apr 15, 2016

How to manually compile file / package

Is there a way to manually compile a class or package without having to save?

Using the perforce integration I did a "Undo Check Out" and the code was revered but not compiled.

CLARIFICATION: From the Atelier UI.

Discussion (6)0
Log in or sign up to continue

This is a really good point.

At some level, this is part of the behavior of %Studio.SourceControl.ISC, the studio extension class for source control using Perforce. Studio doesn't automatically recompile the class and dependent classes after checkout either. This has bitten me before - I've undone a checkout, but forgotten to recompile, leaving the old compiled version in effect. It might be reasonable for %Studio.SourceControl.ISC to have an option to automatically compile edited items after undo of a checkout, or even to just do that all the time.

Also, Atelier actually does have a separate "compile" option, in the toolbar at the top. (The icon has a file with "010" on it.)

This is an important feature; in addition to the case you noted, there are several situations I can think of offhand where a class would need to be recompiled even though it hasn't changed:

  • The behavior of a macro defined in a .inc file changes. Classes that use that macro must be recompiled to get the new behavior.
  • A method in Class A is called from a [ CodeMode = objectgenerator ] method in Class B. If the implementation of the method in Class A changes, Class B may need to be recompiled. (It won't be recompiled automatically.)

One downside to automatically compiling impacted/dependent classes is that it can take a while - if a minor change impacts hundreds of classes, it might be reasonable to save the class and compile it in separate actions. There's a preference in Atelier (Preferences -> Atelier -> Save Settings, "server save action") to not compile files automatically when they're saved to the server. Atelier is much better about this than Studio, though; when compiling hundreds of dependent classes, Studio tends to freeze up. With Atelier there's the possibility of a timeout, but the editor should remain responsive while the compilation is happening.