Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Remove compile_against option from JvmLibraryArg
Browse files Browse the repository at this point in the history
Summary: We don't want to give libraries the choice of which version of their dependencies they actually build against.

Reviewed By: mykola-semko

fbshipit-source-id: da8a6225316a7b7bfb199e0d08c359cb314086d6
  • Loading branch information
IanChilds authored and facebook-github-bot committed Sep 28, 2021
1 parent 0b6dbc0 commit 92c6901
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,7 @@ public ImmutableList<JavaDependencyInfo> getDependencyInfosForSourceOnlyAbi() {
private BuildRule getAbiDep(BuildRule compileTimeFullDep) {
Preconditions.checkState(compileTimeFullDep instanceof HasJavaAbi);
HasJavaAbi hasJavaAbi = (HasJavaAbi) compileTimeFullDep;
CompileAgainstLibraryType compileAgainstLibraryType = getCompileAgainstLibraryType();
Optional<BuildTarget> abiJarTarget = Optional.empty();

if (compileAgainstLibraryType.equals(CompileAgainstLibraryType.SOURCE_ONLY_ABI)) {
abiJarTarget = hasJavaAbi.getSourceOnlyAbiJar();
}
Optional<BuildTarget> abiJarTarget = hasJavaAbi.getSourceOnlyAbiJar();

if (!abiJarTarget.isPresent()) {
abiJarTarget = hasJavaAbi.getAbiJar();
Expand Down
14 changes: 3 additions & 11 deletions src/com/facebook/buck/jvm/java/DefaultJavaLibraryRules.java
Original file line number Diff line number Diff line change
Expand Up @@ -674,17 +674,9 @@ private JavacPluginParams abiProcessorsOnly(

@Value.Lazy
CompileAgainstLibraryType getCompileAgainstLibraryType() {
CoreArg args = getArgs();
CompileAgainstLibraryType result = CompileAgainstLibraryType.SOURCE_ONLY_ABI;
if (args != null) {
result = args.getCompileAgainst().orElse(result);
}

if (!getConfiguredCompilerFactory().shouldCompileAgainstAbis()) {
result = CompileAgainstLibraryType.FULL;
}

return result;
return getConfiguredCompilerFactory().shouldCompileAgainstAbis()
? CompileAgainstLibraryType.ABI
: CompileAgainstLibraryType.FULL;
}

@Value.Lazy
Expand Down
2 changes: 0 additions & 2 deletions src/com/facebook/buck/jvm/java/JvmLibraryArg.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ public interface JvmLibraryArg extends BuildRuleArg, MaybeRequiredForSourceOnlyA

Optional<AbiGenerationMode> getAbiGenerationMode();

Optional<CompileAgainstLibraryType> getCompileAgainst();

Optional<SourceAbiVerificationMode> getSourceAbiVerificationMode();

Optional<UnusedDependenciesParams.UnusedDependenciesAction> getOnUnusedDependencies();
Expand Down

0 comments on commit 92c6901

Please sign in to comment.