Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

brightsparklabs/gradle-multi-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gradle-multi-git

Gradle plugin to simplify managing multiple git repositories.

Build

./gradlew build

# publish
./gradlew publishPlugins

Usage

// file: build.gradle

plugins {
    id 'com.brightsparklabs.gradle.multi-git'
}

Configuration

Use the following configuration block to configure the plugin:

// file: build.gradle

multiGitPluginConfig {
    repositoriesDir = new File('subprojects')
    repositories = [
        'project-alpha': 'git@github.com:brightsparklabs/project-alpha.git',
        'project-bravo': [
            url: 'git@github.com:brightsparklabs/project-bravo.git',
            options: ['--depth', '3', '--branch', 'develop']
        ],
    ]
}

Where:

  • repositoriesDir is the directory to checkout the git repositories to.
  • repositories is a map of repository name to repository location.
  • Entries in repositories take the repository URL, or a map including:
    • url: the repository URL
    • options: clone options, e.g. ['--depth', '1', '--branch', 'stable']

Tasks

The tasks added by the plugin can be found by running:

./gradlew tasks

Methods

The following methods are added to the project:

  • gitExec(repoName, gitArgs)
    • Executes a git command on the specified git repository.
    • Arguments:
      • repoName: Name of the git repository to execute the command on.
      • gitArgs: Array of arguments to append to the 'git' command.
        • E.g. ['checkout', 'master']
  • gitExecAllRepos(gitArgs)
    • Executes a git command on all git repositories.
    • Arguments:
      • gitArgs: Array of arguments to append to the 'git' command.
        • E.g. ['checkout', 'master']

Licenses

Refer to the LICENSE file for details.

About

Gradle plugin to simplify managing multiple git repositories.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages