Comments (8)
Hi, the src/test are the tests, the source code itself is on src/main.
To use the project, you need to package and install on your local maven repo.
git clone [email protected]:0x3333/dagger-aop-logger.git
cd dagger-aop-logger
mvn clean install
And import into your project:
<dependency>
<groupId>com.github.0x3333.dagger.aop</groupId>
<artifactId>dagger-aop-logger</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Then you are ready to go.
from dagger-aop-logger.
but what about this step
"Add to you Dagger Module the InterceptorModule and a @provides for LogInterceptor."
from dagger-aop-logger.
To YOUR Dagger Module you add:
@Provides
static LogInterceptor providesLogInterceptor() {
return new LogInterceptor();
}
This will bind the LogInterceptor class in the dagger graph.
from dagger-aop-logger.
hmm. ok but as per your documentation
`// Adding InterceptorModule
@module(includes = { InterceptorModule.class })
public abstract class MyModule {
@BINDS
MyService providesMyService(MyClass impl);
@provides
static LogInterceptor providesLogInterceptor() {
return new LogInterceptor();
}
}`
So do i need ?
@Binds MyService providesMyService(MyClass impl);
from dagger-aop-logger.
It is exactly what it says. This is a "imaginary" module. You have to add InterceptorModule and the provides in your module.
// Adding InterceptorModule
@module(includes = { InterceptorModule.class })
public abstract class MyModule {
@provides
static LogInterceptor providesLogInterceptor() {
return new LogInterceptor();
}
}
from dagger-aop-logger.
Im so sorry if these are dumb questions but if
public abstract class MyModule {
is the module in "my project"
it would be in
src/main/java/com.dathShana.sample.modules/MyModule.java
How can i add a dependancy on InterceptorModule.class which gets generated in
src/test/....
thank you for your responses
from dagger-aop-logger.
The src/test InterceptorModule is the module generated by the APT to the test package, APT should generate a InterceptorModule for you binds.
The InterceptorModule is a module that is generated with binds to all generated classes.
from dagger-aop-logger.
The minimal setup example is the test itself...
from dagger-aop-logger.
Related Issues (2)
- InterceptorModule HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dagger-aop-logger.