-
Notifications
You must be signed in to change notification settings - Fork 135
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
BaselineExactDependencies applies to all source sets #1262
Changes from 12 commits
7f56d14
000b180
d599b2d
df86f65
bc8e9e2
3f16f85
82c3df4
4f1fae6
d8473df
55c0f2b
8e58b4a
6bdc909
29f4c91
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type: improvement | ||
improvement: | ||
description: BaselineExactDependencies applies to all source sets | ||
links: | ||
- https://github.com/palantir/gradle-baseline/pull/1262 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
package com.palantir.baseline.tasks; | ||
|
||
import com.google.common.base.Preconditions; | ||
import com.google.common.collect.Sets; | ||
import com.google.common.collect.Streams; | ||
import com.palantir.baseline.plugins.BaselineExactDependencies; | ||
|
@@ -190,6 +191,11 @@ public final Provider<List<Configuration>> getSourceOnlyConfigurations() { | |
} | ||
|
||
public final void sourceOnlyConfiguration(Configuration configuration) { | ||
Preconditions.checkNotNull(configuration, "This method requires a non-null configuration"); | ||
Preconditions.checkArgument( | ||
configuration.isCanBeResolved(), | ||
"May only add sourceOnlyConfiguration if it is resolvable: %s", | ||
configuration); | ||
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. To be fair this method shouldn't exist, because I don't know in what situation users might actually use it. But for now, let's at least throw eagerly if the user gave us a bad configuration. |
||
this.sourceOnlyConfigurations.add(Objects.requireNonNull(configuration)); | ||
} | ||
|
||
|
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.
Can we write a test for this?
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.
Yep, wrote one