-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix crossProjectBaseDirectory
#156
Fix crossProjectBaseDirectory
#156
Conversation
@@ -18,21 +18,24 @@ lazy val root = | |||
check := { | |||
doCheckPlatform(crossProjectPlatform.value, "jvm") | |||
doCheckType(crossProjectCrossType.value, CrossType.Pure) | |||
doCheckBase(crossProjectBaseDirectory.value, file("root")) | |||
doCheckBase(crossProjectBaseDirectory.value, | |||
file("root").getAbsoluteFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the .getAbsoluteFile
inside def doCheckBase
?
settings( | ||
CrossPlugin.autoImport.crossProjectBaseDirectory := dir.getAbsoluteFile) | ||
.mapProjectsByPlatform((platform, project) => | ||
project.in(crossType.platformDir(dir, platform))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting here is downright misleading. Can you convince scalafmt not to destroy readability here? Perhaps import CrossPlugin.autoImport._
at the top of the file, and use unqualified key names.
Apparently, this is happening at "build loading time" here: |
f4d7bd7
to
4972b7c
Compare
Thanks, that was very helpful! Is this what you had in mind? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that seems more like it ;)
Sorry, there were some misses in the initial implementation 😕
The vanilla
baseDirectory
setting (always?) returns an absolute file so I would expectcrossProjectBaseDirectory
to do so as well.Changes to the base directory with
CrossProject#in
was not being reflected in thecrossProjectBaseDirectory
setting.The fixes work, but I wonder if there is a more principled way we should do this.
In sbt, the
Project#base
is a relative file butthisProject.value.base
is absolute. So the change is somehow happening in between but I couldn't quite figure out how.