Skip to content

Make repository usable on JDK11. #1370

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

Merged
merged 2 commits into from
Mar 19, 2020
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class CheckCoveragePlugin implements Plugin<Project> {
toolVersion = '0.8.5'
}

tasks.withType(Test) {
jacoco {
excludes = ['jdk.internal.*']
}
}

task('checkCoverage', type: JacocoReport) {
dependsOn 'check'
description 'Generates check coverage report and uploads to Codecov.io.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ plugins {
id 'java-library'
}

def jvm = org.gradle.internal.jvm.Jvm.current()


dependencies {
implementation project(':encoders:firebase-encoders-processor:test-support')
implementation 'com.google.auto.service:auto-service-annotations:1.0-rc6'
Expand All @@ -30,7 +33,7 @@ dependencies {
annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6'

testImplementation 'com.google.testing.compile:compile-testing:0.18'
testImplementation files(org.gradle.internal.jvm.Jvm.current().getToolsJar())
if (jvm.getToolsJar() != null) testImplementation files(jvm.getToolsJar())
testImplementation 'com.google.truth:truth:1.0'

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.google.firebase.encoders.annotations.Encodable;
import com.google.firebase.encoders.processor.getters.Getter;
import com.google.firebase.encoders.processor.getters.GetterFactory;
import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
Expand Down Expand Up @@ -63,6 +62,11 @@ public class EncodableProcessor extends AbstractProcessor {
private Types types;
private GetterFactory getterFactory;

@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latestSupported();
}

@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
super.init(processingEnvironment);
Expand All @@ -88,15 +92,14 @@ private void processClass(Element element) {
ClassName className =
ClassName.bestGuess("Auto" + Names.generatedClassName(element) + "Encoder");
ClassName configurator = ClassName.get("com.google.firebase.encoders.config", "Configurator");

// TODO(vkryachko): add @Generated annotation in a way that is compatible with Java versions
// before and after 9. See https://github.com/google/dagger/pull/882
TypeSpec.Builder encoderBuilder =
TypeSpec.classBuilder(className)
.addJavadoc("@hide")
.addModifiers(Modifier.PUBLIC, Modifier.FINAL)
.addSuperinterface(configurator)
.addAnnotation(
AnnotationSpec.builder(ClassName.get("javax.annotation", "Generated"))
.addMember("value", "$S", getClass().getName())
.build())
.addField(
FieldSpec.builder(
TypeName.INT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import javax.annotation.Generated;

@Generated("com.google.firebase.encoders.processor.EncodableProcessor")
public final class AutoGenericsEncoder implements Configurator {
public static final int CODEGEN_VERSION = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import javax.annotation.Generated;

/**
* @hide */
@Generated("com.google.firebase.encoders.processor.EncodableProcessor")
public final class AutoGenericClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import javax.annotation.Generated;

@Generated("com.google.firebase.encoders.processor.EncodableProcessor")
public final class AutoMainClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import javax.annotation.Generated;

@Generated("com.google.firebase.encoders.processor.EncodableProcessor")
public final class AutoSimpleClassEncoder implements Configurator {
public static final int CODEGEN_VERSION = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
import com.google.firebase.encoders.config.EncoderConfig;
import java.io.IOException;
import java.lang.Override;
import javax.annotation.Generated;

/**
* @hide */
@Generated("com.google.firebase.encoders.processor.EncodableProcessor")
public final class AutoTypeWithListEncoder implements Configurator {
public static final int CODEGEN_VERSION = 1;

Expand Down
12 changes: 10 additions & 2 deletions fiamui-app/fiamui-app.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,19 @@ android {
dependencies {
implementation project(path: ":firebase-inappmessaging-display")
implementation project(path: ":firebase-inappmessaging")
implementation "com.google.firebase:firebase-measurement-connector:18.0.0"
implementation 'com.google.guava:guava:24.1-jre-android'

implementation('com.google.firebase:firebase-analytics:17.0.0') {
implementation('com.google.firebase:firebase-analytics:17.2.3') {
exclude group: 'com.google.firebase', module: 'firebase-common'
exclude group: 'com.google.firebase', module: 'firebase-components'
exclude group: 'com.google.firebase', module: 'firebase-installations'
exclude group: 'com.google.firebase', module: 'firebase-installations-interop'
}
implementation('com.google.firebase:firebase-iid:20.1.1') {
exclude group: 'com.google.firebase', module: 'firebase-common'
exclude group: 'com.google.firebase', module: 'firebase-components'
exclude group: 'com.google.firebase', module: 'firebase-installations'
exclude group: 'com.google.firebase', module: 'firebase-installations-interop'
}

implementation "com.android.installreferrer:installreferrer:1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ android {
targetSdkVersion project.targetSdkVersion
minSdkVersion project.minSdkVersion
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
Expand Down
3 changes: 3 additions & 0 deletions firebase-inappmessaging/firebase-inappmessaging.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ dependencies {
implementation project(':firebase-installations-interop')
runtimeOnly project(':firebase-installations')

//To provide @Generated annotations
compileOnly 'javax.annotation:jsr250-api:1.0'

implementation 'com.google.android.gms:play-services-tasks:17.0.0'
implementation 'io.grpc:grpc-stub:1.21.0'
implementation 'io.grpc:grpc-protobuf-lite:1.21.0'
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ org.gradle.jvmargs=-Xmx8g -XX:MaxPermSize=8g

android.enableJetifier=true
android.useAndroidX=true
android.jetifier.blacklist=errorprone,firebase-encoders-processor

org.gradle.parallel=true
org.gradle.caching=true

firebase.checks.errorproneProjects=:tools:errorprone
firebase.checks.lintProjects=:tools:lint

systemProp.illegal-access=warn