From ace1a32a87856b2a6e42006d48bbf7842b89d7e1 Mon Sep 17 00:00:00 2001 From: cushon Date: Fri, 9 Aug 2019 20:56:07 -0700 Subject: Make reduced classpath computation more lenient I changed this in [] but some code paths are relying on the old behaviour. GOOGLE: RELNOTES: N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=262683944 --- java/com/google/turbine/deps/Dependencies.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'java/com/google/turbine/deps') diff --git a/java/com/google/turbine/deps/Dependencies.java b/java/com/google/turbine/deps/Dependencies.java index 4235bc2..92193e8 100644 --- a/java/com/google/turbine/deps/Dependencies.java +++ b/java/com/google/turbine/deps/Dependencies.java @@ -184,11 +184,18 @@ public class Dependencies { /** * Filters a transitive classpath to contain only the entries for direct dependencies, and the * types needed to compile those direct deps as reported by jdeps. + * + *

If no direct dependency information is available the full transitive classpath is returned. */ public static Collection reduceClasspath( ImmutableList transitiveClasspath, ImmutableSet directJars, ImmutableList depsArtifacts) { + if (directJars.isEmpty()) { + // the compilation doesn't support strict deps (e.g. proto libraries) + // TODO(cushon): make this a usage error + return transitiveClasspath; + } Set reduced = new HashSet<>(directJars); for (String path : depsArtifacts) { DepsProto.Dependencies.Builder deps = DepsProto.Dependencies.newBuilder(); -- cgit v1.2.3