chachako / metalava-gradle

A Gradle plugin for Metalava, AOSP's tool for API metadata extraction and compatibility tracking.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metalava-gradle

Build Gradle Plugin Portal Metalava

A Gradle plugin for Metalava, AOSP's tool for API metadata extraction and compatibility tracking. This plugin is currently in active development and does not yet fully support all of Metalava's features.

Supported Plugins

This plugin currently supports the following plugins:

  • com.android.library
  • java-library
  • kotlin("multiplatform")

Setup

Kotlin

buildscript {
    repositories {
        maven("https://plugins.gradle.org/m2/")
    }
    dependencies {
        classpath("me.tylerbwong.gradle:metalava-gradle:<current_version>")
    }
}

apply(plugin = "me.tylerbwong.gradle.metalava")

or, using the new plugin API

plugins {
    id("me.tylerbwong.gradle.metalava") version "<current_version>"
}

Groovy

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "me.tylerbwong.gradle:metalava-gradle:<current_version>"
    }
}

apply plugin: "me.tylerbwong.gradle.metalava"

Also ensure that Google's Maven Repository is added to your project.

Usage

This plugin registers the following tasks:

metalavaGenerateSignature - Generates a Metalava signature descriptor file at a specified location.

metalavaCheckCompatibility - Checks API compatibility between the code base and the current API.

The plugin can also be configured using the metalava extension block

plugins {
    id("me.tylerbwong.gradle.metalava") version "<current_version>"
}

...

metalava {
    documentation = Documentation.PUBLIC
    outputKotlinNulls = false
    includeSignatureVersion = false
    ...
}

Check out the samples for more example usages and see MetalavaExtension for all configurable options.

Attributions

Huge thanks to the projects that helped throughout the development of this plugin:

License

Copyright 2020 Tyler Wong

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A Gradle plugin for Metalava, AOSP's tool for API metadata extraction and compatibility tracking.

License:Apache License 2.0


Languages

Language:Kotlin 100.0%