From cd67db7478cf0c7ba78ad8a3923f252121a84ed6 Mon Sep 17 00:00:00 2001 From: Joshua Gerrard Date: Mon, 9 Nov 2015 17:46:07 +0000 Subject: [PATCH] Fixed paths containing ${user.home} not working in Android Studio --- .../jucer_ProjectExport_AndroidStudio.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_AndroidStudio.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_AndroidStudio.h index b8b86f0c9a..64f2598a82 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_AndroidStudio.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_AndroidStudio.h @@ -245,14 +245,15 @@ private: static String sanitisePath (String path) { - if (path.startsWith ("~")) - { - const String homeFolder (File::getSpecialLocation (File::userHomeDirectory).getFullPathName()); + return expandHomeFolderToken (path).replace ("\\", "\\\\"); + } - path = path.replaceSection (0, 1, homeFolder); - } + static String expandHomeFolderToken (const String& path) + { + String homeFolder = File::getSpecialLocation (File::userHomeDirectory).getFullPathName(); - return path.replace ("\\", "\\\\"); + return path.replace ("${user.home}", homeFolder) + .replace ("~", homeFolder); } void writeLocalDotProperties (const File& folder) const