cocos2d / cocos2d-console

cocos2d command line tool
152 stars 190 forks source link

improve gen-libs for Android platform #440

Closed drelaptop closed 6 years ago

drelaptop commented 6 years ago

fix, https://github.com/cocos2d/cocos2d-x/issues/18790

drelaptop commented 6 years ago

please review and merge @minggo

correspond issue, https://github.com/cocos2d/cocos2d-x/issues/18790

minggo commented 6 years ago

key is only needed for Android APK, it is not needed for generating libs, so i don't think the parameter is needed.

drelaptop commented 6 years ago

Yes, it's not needed for gen-libs, but now cocos gen-libs -p android -m release need user to input key info. so add a no-sign to avoid gen-libs to use keystore file.

minggo commented 6 years ago

what i mean is that, should fix the logic to avoid checking key info instead of adding a new parameter.

drelaptop commented 6 years ago

the cocos gen-libs is finished by call cocos compile cmd, and copy the libs to some dir, add a new parameter to cocos compile is a convenient way for cocos gen-libs to control. And this new parameter didn't break the older compile logic.

find another way to fix the logic will cause to more code changes, I will find another way to compare with this way if you stick to.

minggo commented 6 years ago

Yep, i think should put the logic of compiling libs in one function, for example named compile_cpp_codes(), then cocos gen-libs and cocos compile can use the same logic.

drelaptop commented 6 years ago

after I review the project_compile.py and build_android.py again, I think it's not a good choice to put the compile logic into a function.

the implement now use many member variables, which values is gotten from cocos compile cmd line. to put all compile logic into a function, and then call when gen libs, so that we will have to set members values manually in gen_libs.py. Another reason I think --no-sign is a good optional parameter for android compile, sign infos are not necessary for Android release compile process, it's only necessary when run release apk into android device. Gradle don't ask developer to input sign infos before release compile process, but cocos console asked.

crazyhappygame commented 6 years ago

@minggo PR looks good for me. Could you merge it?