Closed koppor closed 2 months ago
Example generated code:
// Generated by Dagger (https://dagger.dev).
package org.jabref.cli;
import dagger.Lazy;
import dagger.MembersInjector;
import dagger.internal.DaggerGenerated;
import dagger.internal.DoubleCheck;
import dagger.internal.InjectedFieldSignature;
import javax.inject.Provider;
import org.jabref.logic.util.BuildInfo;
@DaggerGenerated
@SuppressWarnings({
"unchecked",
"rawtypes"
})
public final class JabRefCLI_MembersInjector implements MembersInjector<JabRefCLI> {
private final Provider<BuildInfo> buildInfoProvider;
public JabRefCLI_MembersInjector(Provider<BuildInfo> buildInfoProvider) {
this.buildInfoProvider = buildInfoProvider;
}
public static MembersInjector<JabRefCLI> create(Provider<BuildInfo> buildInfoProvider) {
return new JabRefCLI_MembersInjector(buildInfoProvider);
}
@Override
public void injectMembers(JabRefCLI instance) {
injectBuildInfo(instance, DoubleCheck.lazy(buildInfoProvider));
}
@InjectedFieldSignature("org.jabref.cli.JabRefCLI.buildInfo")
public static void injectBuildInfo(JabRefCLI instance, Lazy<BuildInfo> buildInfo) {
instance.buildInfo = buildInfo;
}
}
Superseeded by https://github.com/koppor/jabref/pull/687
Google's Dagger seems to be a nice dependency injection framework [slides].
Since
@Inject
is also used by Afterburner, I had to removeprivate
at some places. The dependency injection is not complete; there needs to be proper thought about the "modules". I started withFetchers
to bundle fetchers and adding a quick hack.Current state: Does not compile:
First error:
According to https://stackoverflow.com/q/67647474/873282, one has to use
id 'org.jetbrains.kotlin.jvm' version '1.5.30'
. Then, one gets following error:This probably can be solved by using a different JVM. See https://github.com/JetBrains/kotlin#build-environment-requirements for details.
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)