Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

focus.settings.gradle for Windows #34

Closed
eduard1abdulmanov123 opened this issue May 18, 2023 · 5 comments · Fixed by #36
Closed

focus.settings.gradle for Windows #34

eduard1abdulmanov123 opened this issue May 18, 2023 · 5 comments · Fixed by #36

Comments

@eduard1abdulmanov123
Copy link

After calling the "focus" task, a file is generated focus.settings.gradle in which the paths on the module are specified using such a slash - , but Windows only accepts such a slash - /. Please let me know if this is a bug and someone is working on a fix.

@eduard1abdulmanov123
Copy link
Author

Example:
Generated - project(":analytics").projectDir = new File('C:\Users\Eduard\StudioProjects...\sources\base\analytics')
Necessary - project(":analytics").projectDir = new File('C:/Users/Eduard/StudioProjects/.../sources/base/analytics')

@rharter
Copy link
Collaborator

rharter commented May 21, 2023 via email

@eduard1abdulmanov123
Copy link
Author

eduard1abdulmanov123 commented May 22, 2023

Gradle doens't work with such generated files. If you fix the path separators by hand and start synch, then it will be successful

@SimonMarquis
Copy link
Contributor

SimonMarquis commented May 31, 2023

A simple solution would be to update this code

writer.appendLine("project(\"${dep.path}\").projectDir = new File($literalQuoteChar${dep.projectDir}$literalQuoteChar)")

And replace any backslash with double backslashes:

-writer.appendLine("project(\"${dep.path}\").projectDir = new File($literalQuoteChar${dep.projectDir}$literalQuoteChar)")
+writer.appendLine("project(\"${dep.path}\").projectDir = new File($literalQuoteChar${dep.projectDir.path.replace("\\", "\\\\")}$literalQuoteChar)")

I can draft a PR with new tests if this is something that you would want to include.

@rharter
Copy link
Collaborator

rharter commented Jun 1, 2023

That would be appreciated, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants