Skip to content

ReVanced/revanced-patches-gradle-plugin

Repository files navigation


ย ย ย  ย ย ย  ย ย ย  ย ย ย  ย ย ย  ย ย ย 

Continuing the legacy of Vanced

๐Ÿ˜ ReVanced Patches Gradle plugin

GitHub Workflow Status (with event) GPLv3 License

A Gradle plugin for ReVanced Patches projects.

โ“ About

ReVanced Patches Gradle plugin configures a project to develop ReVanced Patches.

For that, the plugin provides:

  • The settings plugin: Applied to the settings.gradle.kts file, configures the project repositories and subprojects
  • The patches plugin: Applied to the patches subproject by the settings plugin
  • The extension plugin: Applied to extension subprojects by the settings plugin

Caution

This plugin is not stable yet and likely to change due to lacking experience with Gradle plugins.
If you have experience with Gradle plugins and can help improve this plugin, consider reaching out to us at [email protected] or by opening an issue.

๐Ÿš€ How to get started

Tip

The ReVanced Patches template repository uses this plugin and is a good starting point to create a new ReVanced Patches project.

Add the following to the settings.gradle.kts file:

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        maven {
           name = "GitHubPackages"
           url = uri("https://maven.pkg.github.com/revanced/registry")
           credentials {
              username = providers.gradleProperty("gpr.user")
              password = providers.gradleProperty("gpr.key")
           }
        }
    }
}

plugins {
   id("app.revanced.patches") version "<version>"
}

Note

The plugin is published to the GitHub Package Registry, so you need to authenticate with GitHub.
More information here.

Create the patches project and configure the build.gradle.kts file:

patches {
    about {
        name = "ReVanced Patches"
        description = "Patches for ReVanced"
        // ...   
    }
}

Note

By default, the plugin expects the patches project to be in the patches directory.

Create the extension project and configure the build.gradle.kts file:

extension {
   name = "extensions/extension.rve"
}

android {
   namespace = "app.revanced.extension"
}

Note

By default, the plugin expects extension projects to be under the extensions directory.

๐Ÿ“š Everything else

๐Ÿ› ๏ธ Building

To build ReVanced Patches Gradle plugin, follow these steps:

  1. Clone the repository and navigate to the project directory.
  2. Authenticate with GitHub. More information here.
  3. Run ./gradlew build to build the plugin.
  4. Optionally, run ./gradlew publishToMavenLocal to publish the plugin to your local Maven repository for development.

๐Ÿ“œ Licence

ReVanced Patches Gradle plugin is licensed under the GPLv3 license. Please see the license file for more information. tl;dr you may copy, distribute and modify ReVanced Patches Gradle plugin as long as you track changes/dates in source files. Any modifications to ReVanced Patches Gradle plugin must also be made available under the GPL, along with build & install instructions.