Skip to content
Closed

Test #83

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.android.tools.r8.ir.desugar.desugaredlibrary.lint;

import com.android.tools.r8.CompilationFailedException;
import com.android.tools.r8.StringConsumer;
import com.android.tools.r8.Version;
import com.android.tools.r8.internal.AbstractC3072to;
import com.android.tools.r8.internal.C0767Le;
import com.android.tools.r8.internal.C3384x50;
import com.android.tools.r8.internal.EnumC3471y2;
import com.android.tools.r8.internal.InterfaceC3166uo;
import com.android.tools.r8.t0;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/* JADX INFO: compiled from: R8_8.5.35_9c55004e7c41a17b1ed47c4e1952cb6778b3dac6afb6afc113a2737c3cde13e0 */
/* JADX INFO: loaded from: classes8.dex */
public class DesugaredMethodsList extends e {
private final EnumC3471y2 j;
private final boolean k;
private final StringConsumer l;

DesugaredMethodsList(int i, boolean z, C3384x50 c3384x50, t0 t0Var, Collection collection, StringConsumer stringConsumer, Collection collection2) {
super(c3384x50, t0Var, collection, null, collection2);
this.j = EnumC3471y2.b(i);
this.k = z;
this.l = stringConsumer;
}

/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ void a(DesugaredMethodsListCommand desugaredMethodsListCommand) throws IOException {
new DesugaredMethodsList(desugaredMethodsListCommand.getMinApi(), desugaredMethodsListCommand.isAndroidPlatformBuild(), desugaredMethodsListCommand.getReporter(), desugaredMethodsListCommand.getDesugarLibrarySpecification(), desugaredMethodsListCommand.getDesugarLibraryImplementation(), desugaredMethodsListCommand.getOutputConsumer(), desugaredMethodsListCommand.getLibrary()).run();
}

public static void main(final String[] strArr) {
AbstractC3072to.a(new InterfaceC3166uo() { // from class: com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList$$ExternalSyntheticLambda1
@Override // com.android.tools.r8.internal.InterfaceC3166uo
public final void run() throws CompilationFailedException {
DesugaredMethodsList.a(strArr);
}
});
}

public static void run(final DesugaredMethodsListCommand desugaredMethodsListCommand) throws CompilationFailedException {
if (desugaredMethodsListCommand.isHelp()) {
System.out.println(DesugaredMethodsListCommand.getUsageMessage());
} else {
if (!desugaredMethodsListCommand.isVersion()) {
AbstractC3072to.b(desugaredMethodsListCommand.getReporter(), new AbstractC3072to.a() { // from class: com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList$$ExternalSyntheticLambda0
@Override // com.android.tools.r8.internal.AbstractC3072to.a
public final void run() throws IOException {
DesugaredMethodsList.a(desugaredMethodsListCommand);
}
});
return;
}
System.out.println("DesugaredMethodsList " + Version.getVersionString());
}
}

@Override // com.android.tools.r8.ir.desugar.desugaredlibrary.lint.e
final void a(EnumC3471y2 enumC3471y2, EnumC3471y2 enumC3471y22, ArrayList arrayList) {
Iterator it = arrayList.iterator();
while (it.hasNext()) {
this.l.accept((String) it.next(), this.a.i);
}
this.l.finished(this.a.i);
}

@Override // com.android.tools.r8.ir.desugar.desugaredlibrary.lint.e
public EnumC3471y2 run() throws IOException {
EnumC3471y2 enumC3471y2C = this.b.c();
a(enumC3471y2C, this.j, new o(this.a, this.f, true, this.j, this.k, true).b(this.d, this.c));
return enumC3471y2C;
}

/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ void a(String[] strArr) throws CompilationFailedException {
try {
run(strArr);
} catch (IOException e) {
throw new C0767Le(e.getMessage(), e);
}
}

public static void run(String[] strArr) throws IOException, CompilationFailedException {
run(DesugaredMethodsListCommand.parse(strArr));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
package com.android.tools.r8.ir.desugar.desugaredlibrary.lint;

import com.android.tools.r8.ClassFileResourceProvider;
import com.android.tools.r8.DiagnosticsHandler;
import com.android.tools.r8.ParseFlagPrinter;
import com.android.tools.r8.ProgramResourceProvider;
import com.android.tools.r8.StringConsumer;
import com.android.tools.r8.a0;
import com.android.tools.r8.internal.AbstractC0695Iu;
import com.android.tools.r8.internal.C3384x50;
import com.android.tools.r8.internal.EnumC3471y2;
import com.android.tools.r8.internal.Zf0;
import com.android.tools.r8.t0;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;

/* JADX INFO: compiled from: R8_8.5.35_9c55004e7c41a17b1ed47c4e1952cb6778b3dac6afb6afc113a2737c3cde13e0 */
/* JADX INFO: loaded from: classes8.dex */
public class DesugaredMethodsListCommand {
private final boolean a;
private final boolean b;
private final int c;
private final C3384x50 d;
private final t0 e;
private final Collection f;
private final StringConsumer g;
private final Collection h;
private final boolean i;

/* JADX INFO: compiled from: R8_8.5.35_9c55004e7c41a17b1ed47c4e1952cb6778b3dac6afb6afc113a2737c3cde13e0 */
public static class Builder {
private final C3384x50 b;
private StringConsumer e;
private int a = EnumC3471y2.c.d();
private t0 c = null;
private final ArrayList d = new ArrayList();
private final ArrayList f = new ArrayList();
private boolean g = false;
private boolean h = false;
private boolean i = false;

public Builder(DiagnosticsHandler diagnosticsHandler) {
this.b = new C3384x50(diagnosticsHandler);
}

public Builder addDesugarLibraryImplementation(ProgramResourceProvider programResourceProvider) {
this.d.add(programResourceProvider);
return this;
}

public Builder addLibrary(ClassFileResourceProvider classFileResourceProvider) {
this.f.add(classFileResourceProvider);
return this;
}

public DesugaredMethodsListCommand build() {
boolean z = this.g;
if (z || this.h) {
return new DesugaredMethodsListCommand(z, this.h);
}
if (this.i && !this.d.isEmpty()) {
this.b.a("With platform build desugared library is not allowed.");
}
if (this.c != null && this.f.isEmpty()) {
this.b.a("With desugared library specification a library is required.");
}
if (!this.d.isEmpty() && this.c == null) {
this.b.a("The desugar library specification is required when desugared library implementation is present.");
}
if (this.e == null) {
this.e = new c();
}
return new DesugaredMethodsListCommand(this.a, this.b, this.c, this.d, this.e, this.f, this.i);
}

public Builder setAndroidPlatformBuild() {
this.i = true;
return this;
}

public Builder setDesugarLibrarySpecification(t0 t0Var) {
this.c = t0Var;
return this;
}

public Builder setHelp() {
this.g = true;
return this;
}

public Builder setMinApi(int i) {
this.a = i;
return this;
}

public Builder setOutputConsumer(StringConsumer stringConsumer) {
this.e = stringConsumer;
return this;
}

public Builder setOutputPath(Path path) {
this.e = new b(path);
return this;
}

public Builder setVersion() {
this.h = true;
return this;
}
}

DesugaredMethodsListCommand(int i, C3384x50 c3384x50, t0 t0Var, ArrayList arrayList, StringConsumer stringConsumer, ArrayList arrayList2, boolean z) {
this.a = false;
this.b = false;
this.c = i;
this.d = c3384x50;
this.e = t0Var;
this.f = arrayList;
this.g = stringConsumer;
this.h = arrayList2;
this.i = z;
}

public static Builder builder(DiagnosticsHandler diagnosticsHandler) {
return new Builder(diagnosticsHandler);
}

public static String getUsageMessage() {
StringBuilder sb = new StringBuilder();
Zf0.a(sb, "Usage: desugaredmethods [options] where options are:");
new ParseFlagPrinter().addFlags(AbstractC0695Iu.a(AbstractC0695Iu.g().a(a0.a("--output", Collections.singletonList("<file>"), Arrays.asList("Output result in <file>.", "<file> must be an existing directory or a zip file."))).a(a0.a("--lib", Collections.singletonList("<file|jdk-home>"), Arrays.asList("Add <file|jdk-home> as a library resource."))).a(a0.e()).a(a0.a("DesugaredMethods")).a(a0.c()).a(a0.a("--desugared-lib", Collections.singletonList("<file>"), Arrays.asList("Specify desugared library configuration.", "<file> is a desugared library configuration (json)."))).a(a0.a("--android-platform-build", Collections.emptyList(), Arrays.asList("Compile as a platform build where the runtime/bootclasspath", "is assumed to be the version specified by --min-api."))).a(a0.a("--desugared-lib-jar", Collections.singletonList("<file>"), Arrays.asList("Specify desugared library jar."))).a())).appendLinesToBuilder(sb);
return sb.toString();
}

public static DesugaredMethodsListCommand parse(String[] strArr) throws IOException {
return parse(strArr, new C3384x50());
}

public Collection<ProgramResourceProvider> getDesugarLibraryImplementation() {
return this.f;
}

public t0 getDesugarLibrarySpecification() {
return this.e;
}

public Collection<ClassFileResourceProvider> getLibrary() {
return this.h;
}

public int getMinApi() {
return this.c;
}

public StringConsumer getOutputConsumer() {
return this.g;
}

public C3384x50 getReporter() {
return this.d;
}

public boolean isAndroidPlatformBuild() {
return this.i;
}

public boolean isHelp() {
return this.a;
}

public boolean isVersion() {
return this.b;
}

public static DesugaredMethodsListCommand parse(String[] strArr, C3384x50 c3384x50) throws IOException {
return d.a(strArr, c3384x50);
}

DesugaredMethodsListCommand(boolean z, boolean z2) {
this.a = z;
this.b = z2;
this.c = -1;
this.d = null;
this.e = null;
this.f = null;
this.g = null;
this.h = null;
this.i = false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.android.tools.r8.ir.desugar.desugaredlibrary.lint;

import com.android.tools.r8.graph.B1;
import com.android.tools.r8.internal.C1064Vk;
import com.android.tools.r8.internal.C3030tM;
import com.android.tools.r8.internal.C3200vB;
import com.android.tools.r8.internal.C3384x50;
import com.android.tools.r8.internal.EnumC3471y2;
import com.android.tools.r8.internal.InterfaceC1037Uk;
import com.android.tools.r8.t0;
import java.nio.file.Path;
import java.util.Collection;

/* JADX INFO: compiled from: R8_8.5.35_9c55004e7c41a17b1ed47c4e1952cb6778b3dac6afb6afc113a2737c3cde13e0 */
/* JADX INFO: loaded from: classes8.dex */
public abstract class a {
final C3200vB a;
final InterfaceC1037Uk b;
final t0 c;
final Collection d;
final Path e;
final Collection f;
static final /* synthetic */ boolean h = true;
static final EnumC3471y2 g = EnumC3471y2.J;

a(C3384x50 c3384x50, t0 t0Var, Collection collection, Path path, Collection collection2) {
if (!h && collection2 == null) {
throw new AssertionError();
}
C3200vB c3200vB = new C3200vB(new B1(), c3384x50).w().a(true).f;
this.a = c3200vB;
this.c = t0Var;
this.f = collection2;
this.b = t0Var == null ? C3030tM.g() : C1064Vk.a(t0Var, c3200vB.s(), c3200vB.i, false, EnumC3471y2.c.d());
this.d = collection;
this.e = path;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.android.tools.r8.ir.desugar.desugaredlibrary.lint;

import com.android.tools.r8.DiagnosticsHandler;
import com.android.tools.r8.StringConsumer;
import java.nio.file.Path;

/* JADX INFO: compiled from: R8_8.5.35_9c55004e7c41a17b1ed47c4e1952cb6778b3dac6afb6afc113a2737c3cde13e0 */
/* JADX INFO: loaded from: classes8.dex */
public final class b extends StringConsumer.FileConsumer {
public b(Path path) {
super(path);
}

@Override // com.android.tools.r8.StringConsumer.FileConsumer, com.android.tools.r8.StringConsumer.ForwardingConsumer, com.android.tools.r8.StringConsumer
public final void accept(String str, DiagnosticsHandler diagnosticsHandler) {
super.accept(str, diagnosticsHandler);
super.accept(System.lineSeparator(), diagnosticsHandler);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.android.tools.r8.ir.desugar.desugaredlibrary.lint;

import com.android.tools.r8.DiagnosticsHandler;
import com.android.tools.r8.StringConsumer;

/* JADX INFO: compiled from: R8_8.5.35_9c55004e7c41a17b1ed47c4e1952cb6778b3dac6afb6afc113a2737c3cde13e0 */
/* JADX INFO: loaded from: classes8.dex */
public final class c implements StringConsumer {
@Override // com.android.tools.r8.StringConsumer
public final void accept(String str, DiagnosticsHandler diagnosticsHandler) {
System.out.println(str);
}

@Override // com.android.tools.r8.I
public final void finished(DiagnosticsHandler diagnosticsHandler) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.android.tools.r8.ir.desugar.desugaredlibrary.lint;

/* JADX INFO: compiled from: R8_8.5.35_9c55004e7c41a17b1ed47c4e1952cb6778b3dac6afb6afc113a2737c3cde13e0 */
/* JADX INFO: loaded from: classes8.dex */
public abstract class d {
/* JADX WARN: Code restructure failed: missing block: B:39:0x00eb, code lost:

return r0.build();
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public static com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsListCommand a(java.lang.String[] r6, com.android.tools.r8.DiagnosticsHandler r7) {
/*
Method dump skipped, instruction units count: 236
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.android.tools.r8.ir.desugar.desugaredlibrary.lint.d.a(java.lang.String[], com.android.tools.r8.DiagnosticsHandler):com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsListCommand");
}
}
Loading