Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Package annotations with RetentionPolicy.SOURCE in separate JAR to lighten the final APK #129

Copy link
Copy link
@pdecat

Description

@pdecat
Issue body actions

It is my understanding that annotations declared with @retention(RetentionPolicy.SOURCE) are discarded at compilation time and as such are not needed at runtime.

Most annotations are in this case, with the exceptions being:

com.googlecode.androidannotations.annotations.EBean / @retention(RetentionPolicy.CLASS)
com.googlecode.androidannotations.annotations.rest.Rest / @retention(RetentionPolicy.CLASS)
com.googlecode.androidannotations.annotations.EApplication / @retention(RetentionPolicy.CLASS)

Including them in the androidannotation-api JAR ends up in making the final APK unnecessarily big.

Indeed, a quick analysis of the com/googlecode/androidannotations/androidannotations/2.4/androidannotations-2.4-api.jar file seems to indicate that these annotations are taking up to 60% of its size.

Placing those annotations in a separate JAR that could be depended on with a "provided" scope would lighten the final APK, wouldn't it.

I'm not that familiar with the annotation processor so I wouldn't be surprised if I'm completely wrong...

Best regards,
Patrick.

PS: thanks to pyricau and a-thomas for the great presentation at last evening PAUG!

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.