1
edit
Changes
revert
IRC handle: halcyon1234
=Assignment 1BTP600=
BTP600 course material goes here. Iwouldn'd like to figure out how to do that "quote from another article" thing I always see on t mind doing the Wikipedia, where it says "from main article XXX: (text)", so I can snip a part of my A1Design Pattern stub.
#Which file(Here will be the From Main Article clip of why I chose Assignment 2s)did you have to examine?
'''make'''I'm doing don’t think I can put them down, in accordance to Seneca’s Acceptable Use Policy. But the summary sheer amount of the newsgroup [[Mozilla.dev.platform#.5B.5Blkates_ng_220906.7CFriday_September_22.2C_2006.5D.5D|mozilla.devcode and underscores and structs were a bit overwhelming.platform]]
Main.h also defines a structure called "file", which has error handling in it for empty filenames:
<code>static struct file * enter_command_line_file (name) char *name; { if (name[0] =What I Learned='\0') fatal (NILF, _("empty string invalid as file name"));</code>
Shortly after, main goes into its main() function. It starts to do a bunch of crazy stuff with backslash conversion and allocating temp space for variables and stuff. After its done that, it goes ahead and re-interprets the command line switches, in case Make itself has added any: <code> /*Open source isn't just done In The BasementDecode switches again, in case the variables were set by the makefile. There */ decode_env_switches ("MAKEFLAGS", 9);#if 0 decode_env_switches ("MFLAGS", 6);#endif</code> It then goes into a bunch of "goal files", which are people who , as far as I can tell, files that have to be made real. If none are specified, but are expected, it dies: <code> if (!goals) { if (read_makefiles == 0) fatal (NILF, _("No targets specified and no makefile found")); fatal (NILF, viable careers from open source_("No targets")); }</code> '''Ant'''Opening main.java yeilds some gold right off the bat: <code>/** * Command line entry point into Ant. This class is entered via the * canonical `public static void main` entry point and reads the * command line arguments. It then assembles and executes an Ant * project. They've partnered with large corporations* <p> * If you integrating Ant into some other tool, this is not the class * to use as an entry point. Please see the source code of this They've made advertising revenue* class to see how it manipulates the Ant project classes. They* */public class Main implements AntMain {</code> Right after, there've used OS as s more gold <code> /** * Creates a way new instance of this class using the * arguments specified, gives it any extra user properties which have been * specified, and then runs the build using the classloader provided. * * @param args Command line arguments. Must not be <code>null</code>. * @param additionalUserProperties Any extra properties to showcase themselvesuse in this * build. May be <code>null</code>, which have lead is the equivalent to * passing in an empty set of properties. * @param coreLoader Classloader used for core classes. May be * <code>null</code> in which case the system classloader is used. */ public static void start(String[] args, Properties additionalUserProperties, ClassLoader coreLoader) {</code> Such nice documentation! Soon after, I encountered a method that "real jobsprocesses command line arguments" Sweet! <code> /** * Process command line arguments. *Its okay When ant is started from Launcher, the -lib argument does not get * passed through to ask questionsthis routine. I came into this project with zero knowledge of * * @param args the whole processcommand line arguments. * * @since Ant 1.6 */ private void processArgs(String[] args) {</code> It goes on to parse each possible command line argument (and its long name equiv), check it for existence, proper structure, and throws exceptions where appropriate. After that, it goes to check files. #How do I start an extensionare invalid or non-existent Filenames dealt with? '''make'''In general, a fatal flag is put up, and the program dies. What IS an extension? This seems to be mostly done when the command line switches are processed. How do I look If a file was expected (ie: a Make file, or a file specified after a switch argument), then the errors are found when the switch is processed, or the file is looked at the code? . How do This is different from what I compile? Etcwas expecting. I learned how was expecting it to ask questions do mandatory file checking right off the bat (start of main function, perhaps), and dying before it did any other work. '''Ant'''After checking all the switches (and their appropriate files, where appropriate), in the Start function, it goes on IRC-to run a bunch of if- blocks to check for file names. It checks for buildfile, etc. If it ever doesn't find an expected file, it throws an exception and how to ask them again dies.<code> // make sure buildfile exists if needed(!buildFile.exists()) { System. The answer is out there.println("Buildfile: " + buildFile + " does not exist!"); throw new BuildException("Build failed"); }</code> .Find and describe 2 similarities between the code you examined in both projects. .Both of the programs process switches, then look at files.Both use a seperate class/method to process the command line switches .Find and with describe 2 differences between the code you examined in both projects..'''Make''' uses structures and flags to error check their flags. In a large enough communityway, you can even get someone the switches error check themselves. '''Ant''' uses a bunch of if blocks and exceptions. It has to answer "what error check the switches..'''Make''' has a bunch of very obfuscated comments laced throughout the code. '''Ant'' puts all their documentation right before each function, and each piece of documentation is, like, 3 paragraphs long and is printf?"presented in very plain English. . (You may If you have time, try modifying one of the programs to suffer through add a couple RTFMs, but someone will eventually point you new command-line switch that is your learn ID. The switch doesn't have to documentationdo anything, or tell you what %d can do something very trivial. (A prize to the first group that doesthis successfully!). Be persistant Sure, but not annoyingwe'll see. ;)*=Other things, as discussed in class.Wiki Courses=[[lkates:dps909]]