Andrey Hihlovskiy
Professional blog on groovy, gradle, Java, Javascript and other stuff.
Tag Archives: automation
GVM – tool for managing groovy/gradle versions
December 19, 2013
Posted by on Just discovered GVM – Groovy enVironment Manager ( http://gvmtool.net/ )
First impression: it’s like apt-get, but for groovy-based frameworks. Second impression: support of multiple versions is very useful thing.
Will use it at home and in office to automate installation of groovy-related stuff.
Gradle script: multiproject git-gradle management
June 7, 2013
Posted by on Suppose you build your software project from many open-source components, most of which are already available via git. How to automate clone/pull/build/install cycle, especially across projects from different git-repositories? How to establish high-level inter-project dependencies?
For that I wrote gradle script, which implements multiproject git-gradle management. It works as follows: you write configuration file, name it “config.gradle”, put it to the same folder as “build.gradle” (of multiproject git-gradle) and then run “gradle build”.
Full documentation and sources are available at:
Automated git-pull
June 7, 2013
Posted by on Suppose you have 20 git-repositories, which you actively pull and push from/to central location (e.g. github). Don’t you think pulling them by hand is too mechanical? And what if you forget to pull some?
I wrote little gradle script capable of automated git-pull:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { mavenCentral() } | |
dependencies { classpath 'org.ajoberstar:gradle-git:0.5.0' } | |
} | |
import org.ajoberstar.gradle.git.tasks.* | |
def onEachGitFolder(File folder, Closure closure) { | |
File gitServiceFolder = new File(folder, ".git") | |
if(gitServiceFolder.exists() && gitServiceFolder.isDirectory()) | |
closure(folder) | |
else | |
folder.eachDir { subFolder -> | |
onEachGitFolder(subFolder, closure); | |
} | |
} | |
task pull | |
onEachGitFolder projectDir, { folder -> | |
def taskName = folder.name + "_pull" | |
project.task (taskName, type: GitPull) { | |
setRepoPath folder.absolutePath | |
} | |
project.tasks.pull.dependsOn project.tasks[taskName] | |
} | |
defaultTasks "pull" |
You drink morning coffee and the machine does the job for you.
Credits come to the creators of excellent gradle-git plugin:
Recent Comments