KaMPKit icon indicating copy to clipboard operation
KaMPKit copied to clipboard

Refactor/Rename How-To

Open rodrigo-lima opened this issue 6 years ago • 4 comments

This is a fantastic starter kit and I thank you all for putting this together for all of us!

Would it be possible to add a "How-To refactor/rename" best practices doc for packages, app name, dependencies, etc. so we're not always using co/touchlab/kampstarter / co.touchlab.kampstarter and we don't break gradle, Xcode, Android builds?

rodrigo-lima avatar Feb 16 '20 22:02 rodrigo-lima

You can refactor the package in the IDE. Edit -> Find -> Replace in path ; Shortcut is crtl + shift + r. You would still need to manually update the file directories to match the new package.

It would be great though if it was possible to generate this project with the details of my own project sans all the helpful docs and images.

jmarks213 avatar Feb 17 '20 20:02 jmarks213

Similar ask from recent survey respondent

provide a script to easily rename whole project to add custom branding/package names etc

piannaf avatar Apr 24 '20 13:04 piannaf

I've made a script which seems to work. Tested only on macOS, but should work on linux too (and windows under wsl). It requires "rename", the one from perl. ~~PS: if you rename the package id using something which starts with "co." (like "co.example.demo") you will get some error message, since the script tries to remove the "co" folder, which is not empty; I should add a check in order to avoid misleading error messages)~~ EDIT: check added PPS: feel free to copy it or trash it completely

coletz avatar Sep 16 '20 22:09 coletz

This is kind of old, but we should take a look at the script and discuss this a bit. I just closed another issue that had a similar request (https://github.com/touchlab/KaMPKit/issues/223). Maybe if this is straightforward we can consider it.

kpgalligan avatar Mar 20 '22 12:03 kpgalligan