gradle compile, api, implementation

Diff between compile api, implementation

NameRoleDescription
compilecompileDeprecated
Use compile, resolve dependencies
apiDeclaring API dependenciesExpose to customers, customers know what api to use. (Customer codes is also used when using this library)
implementationDeclaring implementation dependenciesPurely use in App or Library. Customer library does not care to call this dependencies.

api is basically used by child module or library. General application developer does not need to use.

Example

The Java Library Plugin page has a great sample how to use api and implementation.

Android Java
スポンサーリンク
Professional Programmer2

コメント