Skip to content

Instantly share code, notes, and snippets.

@xconnecting
Created November 27, 2012 01:41
Show Gist options
  • Save xconnecting/4151859 to your computer and use it in GitHub Desktop.
Save xconnecting/4151859 to your computer and use it in GitHub Desktop.
Gradle: git init using JGit ant task
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
configurations { jgit }
repositories {
mavenRepo url: 'http://download.eclipse.org/jgit/maven'
mavenCentral()
}
dependencies {
jgit 'org.eclipse.jgit:org.eclipse.jgit:2.1.0.201209190230-r'
jgit 'org.eclipse.jgit:org.eclipse.jgit.ant:2.1.0.201209190230-r'
}
task gitInit << {
def basedir = '.'
ant.taskdef(classpath:configurations.jgit.asPath
, resource:"org/eclipse/jgit/ant/ant-tasks.properties"
)
ant.'git-init'(dest:".")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment