{"id":19419175,"url":"https://github.com/serso/aspecta","last_synced_at":"2025-06-13T18:35:25.145Z","repository":{"id":57740784,"uuid":"154185955","full_name":"serso/aspecta","owner":"serso","description":"AspectJ for Android","archived":false,"fork":false,"pushed_at":"2018-11-01T12:50:09.000Z","size":143,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T17:43:31.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-22T17:25:10.000Z","updated_at":"2018-11-01T12:50:11.000Z","dependencies_parsed_at":"2022-08-25T19:21:11.747Z","dependency_job_id":null,"html_url":"https://github.com/serso/aspecta","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serso%2Faspecta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serso%2Faspecta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serso%2Faspecta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serso%2Faspecta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serso","download_url":"https://codeload.github.com/serso/aspecta/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240599179,"owners_count":19826959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T13:16:35.586Z","updated_at":"2025-02-25T03:43:56.504Z","avatar_url":"https://github.com/serso.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\nAspectJ for Android.\n\n# Installation\nIn `build.gradle`:\n```groovy\nbuildscript {\n  // might be not needed depending on your project's setup\n  repositories {\n    google()\n    jcenter()\n  }\n\n  dependencies {\n    classpath 'org.solovyev.android.aspecta:plugin:1.0.0'\n  }\n}\n\napply plugin: 'com.android.application' // or 'com.android.library'\napply plugin: 'org.solovyev.android.aspecta'\n\naspecta {\n  // enable AspectA only in debug builds\n  enabled { BaseVariant variant -\u003e variant.buildType.debuggable}\n}\n\ndependencies {\n  implementation 'org.aspectj:aspectjrt:1.9.1'\n}\n```\n\n# Usage\nDefine an annotation:\n```java\npackage org.example.android;\n\n// retention must be class\n@Retention(RetentionPolicy.CLASS)\n@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})\npublic @interface MyAnnotation {\n}\n```\n\nDefine your aspect:\n```java\npackage org.example.android;\n\n@Aspect\npublic class MyAspect {\n    @Pointcut(\"execution(@org.example.android.MyAnnotation * *(..))\")\n    public void method() {\n    }\n\n    @Before(\"method()\")\n    public void execute(@NonNull JoinPoint jp) {\n        // define action\n    }\n}\n```\n\nUse the annotation. The code will be automatically woven by the library:\n```java\npackage org.example.android;\n\n@Aspect\npublic class MainActivity extends Activity {\n    \n    @MyAnnotation\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserso%2Faspecta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserso%2Faspecta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserso%2Faspecta/lists"}