Questions tagged [autofactory]

13 questions
19
votes
1 answer

IntelliJ can't find generated sources when used in same module

I'm using annotation processors of Google's AutoFactory. I annotated SomeClass with @AutoFactory and referenced new SomeClassFactory().create() somewhere else in that same module. Maven configuration: I added the necessary dependency in Maven: …
Rolf W.
  • 1,379
  • 1
  • 15
  • 25
6
votes
1 answer

Autofac error - No scope with a Tag matching 'AutofacWebRequest' is visible from the scope in which the instance was requested

In one of my web applications, I have a web service that is using Autofac, the svc file is as follows: <%@ ServiceHost Language="C#" Debug="true" Service="MyApp.WebServices.Contracts.Interfaces.IMyWebService, MyApp.WebServices.Contracts"…
lex87
  • 1,276
  • 1
  • 15
  • 33
4
votes
2 answers

How to exclude an annotation processor dependency from ProGuard

I received a ProGuard warning when attempting to create a release of my Android project that prevents the build from completing successfully. Warning: library class com.google.googlejavaformat.java.filer.FormattingJavaFileObject$1$1 extends or…
Trevor A.
  • 278
  • 3
  • 11
4
votes
1 answer

Factories generated with auto-factory cant import glide generated api

I'm using auto-factory and the glide generated api. The classes generated by auto-factory use the GlideRequests class which is generated by the GlideModule but when the build is finished, GlideRequests is not imported in the generated factory…
Safinn
  • 622
  • 3
  • 15
  • 26
3
votes
2 answers

Change injection in Autofac module with a mock (Moq) object

I have a Autofac module as below public class ServiceInjector:Module { protected override void Load(ContainerBuilder builder) { // many registrations and type looking up here ... …
jones
  • 317
  • 3
  • 13
2
votes
1 answer

How can I use @AutoFactory with an @AutoValue class?

Say I have a simple AutoValue class: @AutoValue abstract class Foo { abstract CommonDependency commonDep(); abstract String uniqueDataPerInstance(); static Foo create(CommonDependency commonDep, String data) { return new…
Cory Petosky
  • 12,458
  • 3
  • 39
  • 44
1
vote
1 answer

Why I got NonExistentClass in Kotlin when using AutoFactory?

I use AutoFactory in Kotlin and I receive the issue , I haven't had any issue when I was using java . What is the problem that I receive this issue? TopicLoaderModule_Companion_ProvidePageLoaderViewFactory.java:29: error: cannot find symbol …
I.S
  • 1,904
  • 2
  • 25
  • 48
1
vote
0 answers

AutoFac equivalent of this ninject command/function

In Ninject i can configure a container like the mentioned below, What is the Autofac equivalent for the "Highlighted ones"? Currently i am trying to achieve the same using AutoFac, any help is much appreciated. public class NinjectAdapter :…
Cody
  • 41
  • 3
1
vote
1 answer

Dagger2 : Cannot find symbol @Autofactory classes

I want to migrate my project from dagger 1 to dagger 2. after adding dagger 2 dependent libraries i am getting " error: cannot find symbol class MyClassFactory" error for all @Autofactory classes in my project. However i see that these classes are…
user3912899
  • 65
  • 1
  • 8
1
vote
1 answer

Issues implementing Assisted Injection while using Dagger-2 and Autofactory

I am using Dagger-2 (ver: 2.7) and AutoFactory (ver: 1.0-beta3). I am facing a peculiar issue. I have a a class MyRequest who's ctor takes 2 parameters as: ConnectivityManager conmgr int somevalue I created the ctor as @Autofactory public…
shyguy
  • 301
  • 3
  • 8
1
vote
1 answer

Use mock.Provide() to Setup a delegate factory, used in the SUT constructor

I am trying to test the behavior of a class, when it's passed one stub object via a delegate factory. I made a version of the test in which all the class's dependencies (except the factory) are passed as Mock objects and it works as supposed to. Now…
M.Tach
  • 143
  • 1
  • 1
  • 8
0
votes
1 answer

Autofac - How to resolve instances registered using JSON Configuration

Our requirement is to have different Logger instances for different user defined threads. { "defaultAssembly": "Framework", "components": [ { "type": "SynapseMiddleware.Core.Framework.LoggerServicePerContext, Framework", "services": [ { …
0
votes
0 answers

Autofac WCF Integration

I was trying to use the autofac with WCF Integration. I was using the solution from https://code.msdn.microsoft.com/DI-with-WCF-using-Autofac-a3e8cbbb. I am able to consume the service and call the operations by adding a service reference.But when I…
Vishnu
  • 897
  • 6
  • 13