Ok, by crosswalk source you actually means the packaging tool itself, right?
So combine the two ideas, how about this. 1. Add a new option, say -project-dir, if specified, we put all the app sources/resources there instead of temp folder and don't remove it after apk making. 2. If no project_dir specified, create a system temp folder for it and clean it up at last. Thanks, Shiliu. From: Spencer, Bob Sent: Wednesday, August 27, 2014 1:39 PM To: Wang, Shiliu; Wang, Peter H Cc: crosswalk-dev@lists.crosswalk-project.org Subject: RE: Intent to Implement -- make_apk.py (and related) script improvements You are probably a better expert than me after my few days reviewing the code. Here's my thinking. 1. temp location: Currently make_apk.py does the following: - create a sub directory in the crosswalk folder with a name based on the package. If I pass: --package=org.xyz.bobapp then the directory is named "Bobapp". - create a valid android apk directory structure in "Bobapp", copy contents from the android "template" directory, copy author's source - generate .apk from this directory and place .apk in "--output" - delete Bobapp directory (if we get to the end of the script, which we probably do most of the time) I suggest that "Bobapp" be placed in the system temp directory since I found I hit Ctrl+C once in a while for various reasons and the folder was left behind. The xdk has another folder that gets deleted at the end but I haven't investigated its creation, location, or exact use. If it is also created in the crosswalk source dir I might argue it could be created in the temp location for the same reason. 2. Yes, good point. I actually found it useful to look in that folder while understanding how things were built. We could add flags such as --keep-build-dir and --no-apk for this. Suggestions? Thanks for the comments. Bob From: Wang, Shiliu Sent: Tuesday, August 26, 2014 7:24 PM To: Spencer, Bob; Wang, Peter H Cc: crosswalk-dev@lists.crosswalk-project.org<mailto:crosswalk-dev@lists.crosswalk-project.org> Subject: RE: Intent to Implement -- make_apk.py (and related) script improvements Hi, Bob Thanks for the intent to help improve packaging tool. I've several details questions: 1. Can you share more detail about the temp directories you mentioned which will be created in crosswalk source? Because packaging tool should be running independent of crosswalk source tree. 2. You mentioned that the app's folder will not be cleaned up if apk built successfully. I think it might be useful if developer want to do some customization upon it after we create the app project. Do you think it makes sense that we have an option to keep this folder or even just generating project without compiling? Thanks, Shiliu. From: Spencer, Bob Sent: Wednesday, August 27, 2014 7:27 AM To: Wang, Shiliu; 'Zhu, Yongsheng' Cc: crosswalk-dev@lists.crosswalk-project.org<mailto:crosswalk-dev@lists.crosswalk-project.org> Subject: Intent to Implement -- make_apk.py (and related) script improvements Description: There are a handful of things I'd like to improve in the current python build/bundle scripts. Specifically: - Allow make_apk.py to be runnable from any directory, not just from the crosswalk directory - Improve the language and printed output from the scripts - Create the temporary directories in the system "temp" location so if the script is interrupted they don't clutter the crosswalk source directory Affected component: - source changes: Python scripts in src/xwalk/app/ - area of project affected: Crosswalk command-line builds Related features/bugs: XWALK-2391 - 2395<https://crosswalk-project.org/jira/browse/XWALK-2395?jql=id%20in%20%28XWALK-2391%2C%20XWALK-2392%2C%20XWALK-2393%2C%20XWALK-2394%2C%20XWALK-2395%29> Implementation details: To allow make_apk.py to be runnable from any directory, identify all the places where scripts are imported or files/directories are read/written and pre-pend the xwalk directory. The main changes are in make_apk.py and customize.py with a couple one-line changes in the few other scripts. (I think!) For example: (at head of script) # get xwalk absolute path so we can run this script from any location xwalk_dir = os.path.dirname(os.path.abspath(__file__)) (then to load additional .py) sys.path.append(xwalk_dir) (or to access files/directories) target_library_path = os.path.join(xwalk_dir, name, 'xwalk_core_library') Bob
_______________________________________________ Crosswalk-dev mailing list Crosswalk-dev@lists.crosswalk-project.org https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-dev