bat-cha / gradle-plugin-git-dependencies

A Gradle Plugin to manage git repository dependencies
http://bat-cha.github.io/gradle-plugin-git-dependencies/
153 stars 24 forks source link

Resolve buildscript/other plugin dependencies directly from Git - possible? #27

Open sixman9 opened 9 years ago

sixman9 commented 9 years ago

Hi, I'd really like to make the resolution of a 3rd-party Gradle plugin, 'gradle-trang', part of my main project's own Gradle build-script (the external plugin, 'gradle-trang', is _not_ under dependency management and is hosted at Github).

As this is not a project dependency and is instead a plugin required by the script itself (in order to process some XML files, before another tasks is executed), is it possible to use your plugin to retrieve a Gradle PLUGIN project from Git (it will probably be declared within the buildscript => dependencies closure section). For example:

-Attempt at resolving the 'gradle-trang' plugin from a GitHub (for Gradle buildscript itself, NOT code project)

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
    }
    dependencies {
        classpath 'org.batcha.gradle.plugins:git-dependencies:0.2'

        //The 'Trang' dependency should be brought in and built from the Git repository (i.e. is *not* hosted for Maven)
        compile('org.hsudbrock:gradle-trang:0.1-SNAPSHOT').ext.git = 'https://github.com/hsudbrock/gradle-trang.git'
    }

apply plugin: 'trang'   //To be resolved/built directly from Git by using your 'gradle-plugin-git-dependencies'

Of course, once that plugin has been cloned from Git[Hub], it would need to be installed locally by Gradle and its task should be available from the main build script (along with your own).

If this isn't feasible, it's no biggy, I can install manually, I just wanted to make this as automated as possible.

Rich