Closed LuanLuna closed 8 years ago
Hi!
I've missed to add this:
mavenCentral() maven { url 'https://github.com/Archinamon/GradleAspectJ-Android/raw/master' }
into buildscript.repositories section.
that's why studio can't find the artifact.
Thanks, i can run the app now, but i've created a .aj file in my project, this file has an aspect with one pointcut and one advice, but when i run the app the around advice dont work. I can use native aspectj .aj in my project using your plugin? (I'm using android studio). (I'ts the last question i promise) TestAspect.aj
aspect TestAspect{
pointcut pointOne(): execution (String MainActivity.getParadigma());
String around(): pointOne() {
return "AOP";
}
}
MainActivity.java
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
((TextView)findViewById(R.id.textView)).setText("Welcome to "+getParadigma());
}
public String getParadigma() {
return "OOP";
}
}
Yes, you can use native aj syntax :) In this code you need to add import for your MainActivity in these two ways:
import my.code.MainActivity;
or modify your pointcut
execution (String my.code.MainActivity.getParadigma());
And then run your app.
Good, it works prefectly :D. Thanks.
Hi!!! When i try to use your plugin it's happen.