-
Notifications
You must be signed in to change notification settings - Fork 395
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
Update library loading so branch not required for localSource locations. #75
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,14 @@ class LocalSource implements SourceRetriever { | |
|
||
@Override | ||
List<URL> retrieve(String repository, String branch, String targetPath) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The real problem here is that the (abstract) concept of SourceRetriever is too tightly coupled with the one of a (git) repository and that we are bending the implementation accordingly. Rather than always requiring a branch and ignoring it when it does not make sense (i.e. in line 18), it would be much better if the |
||
def sourceDir = new File(sourceURL).toPath().resolve("$repository@$branch").toFile() | ||
def sourceURLPath = new File(sourceURL).toPath() | ||
def sourceDir | ||
if (branch) { | ||
sourceDir = sourceURLPath.resolve("$repository@$branch").toFile() | ||
} else { | ||
sourceDir = sourceURLPath.resolve(repository).toFile() | ||
} | ||
|
||
if (sourceDir.exists()) { | ||
return [sourceDir.toURI().toURL()] | ||
} | ||
|
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.
I believe this class should be agnostic of the retriever's "type".