Questions tagged [grgit]

Grgit is a wrapper over JGit that provides a fluent API for interacting with Git repositories in Groovy-based tooling.

About

Grgit is a wrapper over that provides a fluent API for interacting with repositories in Groovy-based tooling.

With the tooling focus, "porcelain" commands are the primary scope of what is included. Features that require more user interaction (such as resolving merge conflicts) are intentionally excluded.

Links

32 questions
8
votes
0 answers

Could not get unknown property 'Grgit' for task

Trying to git commit a repo through a task in build.gradle. However, the error persists and I am not able to fix it. LOG: Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'Grgit' for task ':gitCommit' of type…
Sidharth
  • 1,402
  • 2
  • 16
  • 37
4
votes
1 answer

Get git branch name with gradle git plugin on jenkins slave

I'm doing sonar integration and would like to pass git branch as a parameter. It will be run on Jenkins server. Before I was using next line of code to get current git branch: def workingBranch = """git rev-parse --abbrev-ref…
Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114
2
votes
1 answer

Plugin with id 'org.ajoberstar.grgit' not found

I'm trying to compile an opensource minecraft mod called VeinMiner. I use ./gradlew build to compile it. However it failed and give me this reason: FAILURE: Build failed with an exception. * Where: Build file…
Hhry
  • 823
  • 1
  • 8
  • 19
2
votes
1 answer

Gradle DSL method not found: 'versionCode()'

Have a problem build my Android project. I using Grgit to fill versionCode and versionName in gradle. Everything worked fine, until I updated Android Studio and gradle tools to newer version (build 3.4.0 and distribution 5.1.1). ./gradlew build fail…
Tomas Ivan
  • 2,212
  • 2
  • 21
  • 34
2
votes
0 answers

grgit.add() Not adding files to staging

I'm trying to set this up for this first time on a project of mine, and I'm curious as to why some items are still considered un-staged after I do a grgit.add(). My build.gradle task gitCommit { group = "Custom" description = "Commits the…
Cheabs
  • 37
  • 6
1
vote
0 answers

Intellij - Gradle - Unable to build - Failed to apply plugin [id 'org.ajoberstar.grgit']

I am working on Intellij 2019.2.4 with Java 11.0.13 JDK and gradle 7.3.3 in settings. Gradle-wrapper.properties file has - distributionUrl=https://services.gradle.org/distributions/gradle-4.8.1-bin.zip I have tried manual proxy configuration and…
Vaneet Singh
  • 61
  • 1
  • 6
1
vote
1 answer

Get last modification dates of files in directory in git

I have a folder full of files and I want to get the timestamps of last git update for each of those files. I'd like to get those in a Gradle task. I tried the following with GrGit: def git = org.ajoberstar.grgit.Grgit.open dir:project.rootDir task…
injecteer
  • 20,038
  • 4
  • 45
  • 89
1
vote
0 answers

Custom Gradle Plugin: Task not found when adding grgit.checkout

I'm writing a custom gradle plugin. I'm working on two tasks at the moment: project.tasks.create("prepareCustomTask", PrepareCustomTask) { it.group = TASK_GROUP it.description = "Prepares custom task" } project.tasks.create("customTask",…
JoschJava
  • 1,152
  • 12
  • 20
1
vote
2 answers

How to configure automatic semantic versioning using ajoberstar/reckon and Bitbucket Pipelines?

I want to set up an automatic semantic versioning so that each CI build results in an incremented patch part like in ... I use an ajoberstar/reckon gradle plugin which works flawlessly on a local machine but I'm facing some problems when trying to…
1
vote
0 answers

Release artifact name and version in Jenkinsfile

I am using the gradle git to release artifacts: https://github.com/ajoberstar/gradle-git. Is it possible to get the release artifact name and version that it uses in the release stage in another stage that runs after release in the Jenkinsfile?
Ufder
  • 527
  • 4
  • 20
1
vote
1 answer

Fetch Gradle subproject at build time using grgit

How can I have gradle clone a git repository (to a sub-repo of the current one) and build it as a subproject? Currently I have the following: settings.gradle: include 'contrib/dependency/foolib' build.gradle (shortened): buildscript { …
user149408
  • 5,385
  • 4
  • 33
  • 69
1
vote
1 answer

grgit - to add new files and remove deleted files

we are using grgit to update files in github. def grgit = Grgit.open(dir: repoDir) grgit.add(patterns: ['src'], update: false) // False should even add new files grgit.commit(message: 'Updated subsets', amend: false) grgit.push() we…
Chetan Sharma
  • 173
  • 1
  • 3
  • 16
1
vote
1 answer

Is it possible to commit only one file through grgit plugin for gradle.?

Is it possible to commit only one file through grgit plugin for gradle.? I have modified the version.properties file and I need to commit only that particular file back to git using grgit plugin. But when i Commit back to git whole project is…
Spencer Bharath
  • 507
  • 2
  • 7
  • 21
1
vote
1 answer

How to use Grgit to fetch from remote?

The following code: final git = Grgit.open("${oldVersionRoot}/.git") git.fetch(refSpecs: ["release/${oldVersion}"]) emits: Caused by: org.eclipse.jgit.errors.TransportException: Remote does not have release/2.1747.0 available for fetch. What's the…
Noel Yap
  • 18,822
  • 21
  • 92
  • 144
1
vote
1 answer

Using grgit to capture logs between two tags

I want to capture the commit messages between two tags. Like, I create a tag in my repo, then commit some files and then add a tag. So, in between these tags, I want to capture those commit messages. All this is suppose to be done using grgit, the…
sver
  • 866
  • 1
  • 19
  • 44
1
2 3