Cocos2d-x android.mk File Auto-modifier

Source: Internet
Author: User


  Do Cocos2d-x project, usually use a computer to develop, and then transplanted to the mobile phone platform. Porting to an Android phone requires using tools such as Eclipse to recompile the package into an APK file. And with Eclipse Packaging, To add the CPP file of the project to the ANDROID.MK configuration, the file is less indifferent, but if the file is a lot, manual add is more troublesome, especially in some cases, to compare with the original ANDRIOD.MK configuration, this time the new files, and then add the added files.

  In short, packaged as an apk, manually modifying the ANDROID.MK configuration is cumbersome. So, I made an automatic modifier. Such as:


  My cocos2d-x android.mk file auto-modifier:

  http://download.csdn.net/detail/stevenkylelee/8426235


  With QT5.4, you need to run the DLL with QT on your own, so the program is 16MB large. Every time I run this program will use the browser to open my CSDN blog, hey, use my labor results, I will pay some price. >_<

  To automatically modify the Android.mk file, you need to fill in the following 3 parameters:

   Source directory path: The path to the Cocos2d-x project's source code directory, usually filled in with the project's classes file. The program iterates through all the *.cpp files in this directory, finds all CPP files, and generates a configuration string.

   android.mk file path: point to the android.mk file that you want to modify.

  These 2 parameters correspond to the project's directory and file as shown in:



   search for replaced regular expressions: in order to locate the replaced content, for example: local_src_files: = Hellocpp/main.cpp. The program will replace the string in the original android.mk with the program generated, thus enabling automatic modification.

  The regular class used here is the QT implementation. QT's regular and c++11, C # 's regular is somewhat different. Why use regular expressions? The regular has better extensibility, if it is not good to locate the replacement content, you can first write a tag in the original Mk file, and then replace it with a regular match.

  In practice, it is found that the local_src_files: = field, not only can be used to join the CPP file configuration, but also can be used to introduce so, other library reference configuration. And what we actually want is the field that replaces the source code configuration. "Local_src_files *:=[a-za-z0-9 _/." +cpp.* (\r*\n\s*\n) "This regular will match the local_src_files of the source code configuration. The program uses this regular by default, and of course it can be modified to other regular.

  These 3 parameters are saved when the program is closed and the next time you open the program to restore the last saved parameter settings.

  After setting the parameters, clicking the "Generate" button will modify the specified MK file.

  The results of the program modification are as follows:














Cocos2d-x android.mk File Auto-modifier

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.