wukong-m2m / wukong-darjeeling

Darjeeling for WuKong
Other
20 stars 17 forks source link

WKDeployCustomComponents.xml is not copied to the src/app/wkdeploy/java #38

Closed pencilcheck closed 11 years ago

pencilcheck commented 11 years ago

It appears to me that wkpf-app.xml requires WKDeployCustomComponents.xml to be presented in the java directory of wkdeploy so it can call codegen.py on it to generate additional GENERATEDXXX.java files for the app specific components, but it's weird how Niels actually place them in the same directory instead, but I don't know where should the GENERATEDXXX.java for custom components go either. This might have some implications on the issues I talked about before. https://github.com/wukong-m2m/wukong-darjeeling/issues/33

It seemed like Niels was adding the entire wukong master directory as part of java source path as well, so as long as the java implementation of the custom components are placed under wukong master dir (should be in wukong/javax) then deploy should be fine, so it should be fine if you place the custom java component source code inside the wukong master apps directory. But there might be a possible problem with name conflicts because it will include all java files from all apps. I guess we can fix that later. I will add a issue for that as well.

nielsreijers commented 11 years ago

Just catching up on my email a bit. I don't really get what's the issue here, or what's weird about it? The custom components is part of the app right, so should be in the wkdeploy directory. In my opinion, all code specific to the appl should stay in the wkdeploy directory. So if an application contains any custom components, both the custom Java containing the update function, and the generated Java, both should go in that directory. I'm not sure if I implemented it right, since we didn't have the rest of the infrastructure for customer classes at the time, but that's how I intended it.

The master should clean the app/wkdeploy/java directory before deploying a different application since now there might be Java code from the previous app, but it shouldn't be necessary to do clean of everything (as described in #33), which will slow down the deploy unnecessarily.

pencilcheck commented 11 years ago

The build.xml for wkdeploy is looking for WKDeployCustomComponents.xml in the directory which none of the code is working to copy the file, so when master is deploying the app and running the ant command the xml will not be there, thus the custom components abstract parent java classes will not be generated, and thus compiling will not include the custom components.

We shouldn't need to clean the directory if we are replacing the necessary xmls all the time, but from what I understand, if we don't clean them, the previous application specific java files will be included and possibly increase the final byte size, and might cause some conflicts if somehow the previous remains polluted the current deployment. So to be safe, we should clean the directory before each deployment.

nielsreijers commented 11 years ago

Yes, you should clean the wkdeploy directory. But not all virtual wuclasses, the ones in the standard library don't need to be recompiled (would be a waste to do so).

I don't really get what you're saying in the first bit. Of course it won't work if the xml isn't there. You can make an application specific directory for it, but it seems much easier to me to just put everything in the wkdeploy directory. Downside is that you have to recompile the virtual classes when you deploy, but otherwise you need to do some work to get the build process to generated to different directories and include those again when compiling the Java code.

pencilcheck commented 11 years ago

Currently I believe the master_server.py will creates the WKDeployCustomComponents.xml in respective apps directory (the one in wukong/master), but the build.xml is looking for this file in the wkdeploy/java directory. Thus when wkpf-app.xml calls the target "app-specific-codegen", the build will not be able to generate the meta classes for the app specific virtual wuclasses.

pencilcheck commented 11 years ago

f22466367e