Crash with space in project name for android
Closed this issue · 6 comments
Can be fixed with replacing this line to let solutionName = project.getName().replace(/ /g, '-')
https://github.com/Kode/kincmake/blob/master/src/main.ts#L441
This is how android exporter creates build subfolder. I think there is safename code mess. Lets specify what names for projects is allowed or separate project id (for folder name) and actual project name.
Lets remove space replace and do { shell: true }
workaround for process.spawn
?
https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_spawning_bat_and_cmd_files_on_windows
I think allowed characters for variable names is a good hint on what should be allowed. No space or other special characters?
Should i use My-Name
instead of My Name
variable value and fix every exporter? (adding project.getSafeName
or something)
Oh, i have very cool idea. How about just don't use project.name
for folders and always use Project/
instead?
Some profit:
- Incremental compilation stay after project renaming
- custom build scripts can use static paths (
build/android-native-build/Project
instead ofbuild/android-native-build/MyAnotherProjectName
) (really want it!) - We can clean up safeName things mostly
- Less problems with different platforms and
procces.spawn
errors
Cool spot?
I think that was how khamake started out initially, but i changed it to support different projects when FlashDevelop was still in use (you would only see Project
in the recent workspaces or something, so it was pretty useless). Might actually be a good idea to revert that, now that vscode is the hip thing to use. And about android/android-native, is the subdirectory actually needed at all?
Android Studio needs the subdirectory. It also needs it to be named after the project to reliably show the project name in its own project list even though it should actually get it from the project files, at least last time I checked it was like that. Sorry but Android Studio just isn't very cooperative.