{"comment":{"created_at":"2011-10-16T21:50:04Z","body":"Yeah, I realised that. I filled in all the markdown, and it didn't work, so I went to investigate, and found out that I needed to name it README.md.  But then I decided that most people won't understand what a .md file is, and get confused, and not confusing people was more important to me than making my readme look nice on Github.\r\n\r\nIf Github wanted to be clever, they could detect whether I'm using markdown from the content...","updated_at":"2011-10-16T21:50:04Z","url":"https://api.github.com/repos/rprince/CompileInMemory/issues/comments/2423255","id":2423255,"user":{"gravatar_id":"af48cdf7bf39d82e9513c79411c4d3e1","avatar_url":"https://secure.gravatar.com/avatar/af48cdf7bf39d82e9513c79411c4d3e1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/rprince","id":570909,"login":"rprince"}},"action":"created","issue":{"number":1,"created_at":"2011-10-15T22:17:11Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Try renaming your readme to readme.markdown, then adding newlines before all blocks of -. It'll look something like.... \r\n\r\nCompile In Memory\r\n=================\r\n\r\nRikki Prince - rikki@prince.io\r\n\r\nPrerequisites\r\n-------------\r\n- BeerPump.jar\r\n- FlexiFile.jar\r\n\r\n\r\nIntroduction\r\n------------\r\nCode influenced by examples on the web, which now seem to have disappeared.  URLs for original source are in the code comments.\r\n\r\nThis code was altered and simplified from the example code referenced, to make it into this usable library.\r\n\r\n\r\nFile Summary (in order of usefulness!)\r\n------------\r\n\r\nMemoryCompiler.java\r\n\r\n- You should create one of these.\r\n- It keeps references to a compiler, file managers and class loader.\r\n- Use .compile() and .run() or .compileAndRun(), to do your thing!\r\n- detectClassName() uses a regular expression to find the name of the first class in the source.\r\n\r\nCompileTest.java\r\n\r\n- a tester class containing only a main method which constructs a couple of pieces of source code, compiles and runs them.\r\n\r\nClassNameNotFoundException.java\r\n\r\n- Used to indicate failure of the MemoryCompile.detectClassName() method.\r\n\r\nCompilerNotAccessibleException.java\r\n\r\n- Used to indicate that when attempting to retrieve the JDK's compiler, 'null' was returned.\r\n\r\nJavaSourceFromString.java\r\n\r\n- a SimpleJavaFileObject that simply stores a string containing the source code\r\n\r\nMemoryFileManager.java\r\n\r\n- essentially a Map of filename strings to JavaFileObjects. In this case, only MemoryClassFile: all other file types passed to super.\r\n\r\nMemoryClassFile.java\r\n\r\n- wrapper around a ByteArrayOutputStream, so compiler can write byte code into it, and class loader can read byte code from it.\r\n\r\nMemoryClassLoader.java\r\n\r\n- looks for the requested class in the MemoryFileManager, then loads the bytes from the MemoryClassFile. If it doesn't exist, passes request to super.\r\n\r\nLoopCompiler.java\r\n\r\n- erm, not sure! TODO: work out what this does.\r\n\r\n\r\nOrder of Operations\r\n\r\n1. Call MemoryCompiler.compile(String sourceCode, String className).\r\n2. This creates a new JavaSourceFromString object.\r\n3. Creates an Iterable list of JavaFileObjects called \"compilationUnits\".\r\n4. compilationUnits is passed to the compiler.getTask() method, along with the MemoryFileManager.\r\n5. CompilationTask is call()ed.\r\n6. A new MemoryClassLoader is created from the updated FileManager.","comments":1,"title":"Markdown","updated_at":"2011-10-16T21:50:04Z","url":"https://api.github.com/repos/rprince/CompileInMemory/issues/1","id":1919537,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"fc1029a60d1f84a8f76fcd5d7b0afee7","avatar_url":"https://secure.gravatar.com/avatar/fc1029a60d1f84a8f76fcd5d7b0afee7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/Spacerat","id":141427,"login":"Spacerat"},"html_url":"https://github.com/rprince/CompileInMemory/issues/1","labels":[],"state":"open"},"legacy":{"issue_id":1919537,"comment_id":2423255}}