Cocos2d-x Android. mk File Auto Modifier
Do cocos2d-x projects, usually with computer development, and then transplanted to the mobile phone platform. You need to re-compile and package it into an apk file using eclipse or other tools to transplant it to your Android phone. If you use eclipse to package, you need to add the project's cpp file to Android one by one. in mk configuration, it doesn't matter if there are few files, but if there are many files, manual addition is troublesome, especially in some cases, it should be different from the original Andriod. compare the mk configuration. What files are added this time, and then add the new files.
In short, it is difficult to manually modify the Android. mk configuration by packaging it into an apk. So I made an automatic modifier. For example:
My Cocos2d-x Android. mk File Auto modifier:
Http://download.csdn.net/detail/stevenkylelee/8426235 <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> Release + release/AwMb3tPK/release + rzboaM + Xzw8YnI + release/CM7j2ss7K/release + release/release + 7Ev7XE1LS0 + sLrxL/release/ rXEwre + compaction + dPQtcRjcHDOxLz + o6zJ + rPJxeTWw9fWt/compaction + wre + compaction/uxL + 1xMS/compaction/CzbzL + cq + o7o8YnI + http://www.2cto.com/uploadfile/Collfiles/20150206/2015020608384368.png" alt = "\">
Search for the replaced regular expression:To locate the replaced content, for example, LOCAL_SRC_FILES: = hellocpp/main. cpp. The program replaces the string in the original Android. mk with the string generated by the program to implement automatic modification.
Here, the regular expression is implemented by QT. The regular expressions of QT are somewhat different from those of C ++ 11 and C. Why use a regular expression? Regular expressions have better scalability. If it is difficult to locate the content to be replaced, you can first write a mark in the original mk file and then replace it with regular matching.
In practice, we found that the LOCAL_SRC_FILES: = field can be used not only to add the configuration of the cpp file, but also to introduce so and reference configurations of other libraries. What we need is to replace the field configured in the source code. "LOCAL_SRC_FILES *: = [a-zA-Z0-9 _/.] + cpp. * (\ r * \ n \ s * \ n)" This regular will match the LOCAL_SRC_FILES in the source code configuration. The program uses this regular expression by default. Of course, it can also be changed to another regular expression.
The three parameters will be saved when the program is closed. The parameter settings of the last saved will be restored when the program is opened next time.
After setting the parameters, click "generate" to modify the specified mk file.
The result of program modification is as follows: