GithubHelp home page GithubHelp logo

bat-cha / gradle-plugin-git-dependencies Goto Github PK

View Code? Open in Web Editor NEW
152.0 13.0 24.0 814 KB

A Gradle Plugin to manage git repository dependencies

Home Page: http://bat-cha.github.io/gradle-plugin-git-dependencies/

Groovy 72.60% Shell 27.26% Java 0.14%

gradle-plugin-git-dependencies's Introduction

Git Dependencies Plugin for Gradle

The Git dependencies plugin helps resolving Gradle project dependencies via git using seamless gradle syntax. It relies on Gradle multi-project build capabilities. The purpose of this plugin is to setup a multi-project Gradle environment ONLY when a dependency cannot be resolved via the classical maven or ivy Gradle Dependency Resolution.

What's this ?

If you sometime need to convert some external module dependency to project dependency then this plugin is for you ! Just specify your git repo where the plugin can find your dependency.

The git-dependencies plugin adds 3 tasks to your project:

  • initGitDependencies
  • resolveGitDependencies
  • refreshGitDependencies

initGitDependencies task

This task will look for dependency that cannot be resolved but have a git extra property. It will clone them into project.gitDependenciesDir, default to "${projectDir.parent}/${project.name}-git-dependencies" and prepare your environment for a multi-project build by adding '''settings.gradle''' in "${projectDir.parent}

resolveGitDependencies task

This task will always be called after your project evaluation, it is simply replacing any unresolved git dependencies by a project dependency using the cloned repositories.

refreshGitDependencies task

This task simply refresh all cloned repository

Usage

To use the git-dependencies plugin, include in your build script:

apply plugin: 'git-dependencies'

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

If you do not need the gradle --offline (cf http://issues.gradle.org/browse/GRADLE-1768), You can also do

apply from: 'https://raw.github.com/bat-cha/gradle-plugin-git-dependencies/0.2/git-dependencies.gradle'

To declare a Dependency,

dependencies {

  compile('org.batcha:dummy-project-a:4.2').ext.git = 'https://github.com/bat-cha/dummy-java-project-a.git'
    
}

or if you want to use a different version from the unresolved dependency

dependencies {

  compile('org.anic:myproject:42.0') {
    ext.git = '[email protected]:fabzo/gradle-plugin-git-dependencies.git'
    ext.gitVersion = 'some/otherBranch/h2g2'
  }
    
}

To setup the multi-project build for all the non resolved dependencies having a git property,

./gradlew initGitDependencies

To refresh git repositories for the non resolved dependencies having a git property,

./gradlew refreshGitDependencies

API Doc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.