Giter Site home page Giter Site logo

gradle-git's Introduction

gradle-git

Bintray Travis GitHub license

Project Status

gradle-git has been around since 2012 and has evolved quite a bit from the original release. In order to continue to evolve these features, this project is being broken up into multiple repositories. As such:

  • gradle-git will no longer be maintained
feature replacement comments
org.ajoberstar.grgit grgit Grgit has been an independent project since 2013 and has been stable for quite a while. Version 2.0 removed some deprecated features, but otherwise is fully compatible with existing usage. It also integrates the org.ajoberstar.grgit plugin directly into the project.
org.ajoberstar.github-pages gradle-git-publish org.ajoberstar.git-publish is a more robust version of the old plugin. It is functionally equivalent (or better), but does require porting configuration over as noted in the README.
org.ajoberstar.release-* reckon Reckon focuses solely on determining your project version (and assisting with tagging and pushing that tag). It provides an opinionated model of how to apply semantic versioning, with more finite configuration options.
org.ajoberstar.release-* nebula-release If reckon doesn't suit your needs, nebula-release has forked the gradle-git release plugin and can serve as a replacement for this.

Why do you care?

Git is immensely popular and being able to interact with it as part of a build process can be very valuable to provide a more powerful and consistent result.

What is it?

gradle-git is a set of Gradle plugins:

  • org.ajoberstar.grgit - provides a Grgit instance, allowing interaction with the Git repository the Gradle project is contained in
  • org.ajoberstar.github-pages - publishes files to the gh-pages branch of a Github repository
  • org.ajoberstar.release-base - general structure for inferring a project version and releasing it
  • org.ajoberstar.release-opinion - opinionated defaults for org.ajoberstar.release-base

See Grgit for details on the Git library used underneath, including configuration for authentication.

Usage

NOTE: gradle-git modules require Java 7 (or higher).

Questions, Bugs, and Features

gradle-git is not maintained anymore. See the Project Status section above for details.

Contributing

gradle-git is not maintained anymore. See the Project Status section above for details.

Acknowledgements

Thanks to all of the contributors.

Credit goes to Peter Ledbrook for the initial idea for the org.ajoberstar.github-pages plugin.

Thanks to Zafar Khaja for the very helpful java-semver library.

gradle-git's People

Contributors

aaronzirbes avatar aheusingfeld avatar ajoberstar avatar bmuschko avatar cervator avatar danielthomas avatar eyedol avatar guenhter avatar hierynomus avatar mojavelinux avatar nadavc avatar phatblat avatar pvdissel avatar rspieldenner avatar sdavids13 avatar siordache avatar tschulte avatar urskr avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-git's Issues

GitPush.namesOrSpecs() gives NPE

Hi,

When pushing to the remote repo, I want to define the branch to push to.
That's because the branch was set to null according to getNamesOrSpecs().
Turns out, the way I did it causes a NullPointerException:

task pushWithTags(type: GitPush){
    description = "Performs a Git push that includes the tags."
    setPushTags(true)
    namesOrSpecs ("master") // <---- Causes NPE
    credentials{
        username = "mb720"
        if(!project.hasProperty("gitPassword")){
           ext.gitPassword = ""
        }
        password = gitPassword
    }
}

Yet if I change that line to setNamesOrSpecs (["master"]) everything works fine.
Here is the stacktrace: http://pastebin.com/e4MJh2WF
Is this a bug? Am I using it wrong? Just wanted to let you know.

Thanks.

GithubPages: Make repo equal to pages

I configured my /docs directory to be synced to my github project wiki with the following configuration:

apply plugin: 'github-pages'

githubPages {
    repoUri = '[email protected]:pipelinecd/pipeline.wiki.git'
    targetBranch = 'master'
    workingPath = "$buildDir/wiki"
    commitMessage 'Publish gitHub wiki from docs'
    pages {
        from 'docs'
    }
}

My docs directory contained some files that had a colon-sign (":") in their name, which caused the Gradle CopySpec to fail.. So I remove the colon-signs from my filenames after which the publishGhPages task worked perfectly.
But I noticed it had left my colon-sign containing files in the wiki repository, so I presume the publishGhPages task only looks at the files it works with from the pages section.

Request:
I would love a setting to do a complete sync, making the target repo branch completely equal to the content I set via the pages section. Including removing any unknown files.

I believe this can be done by first removing all files from the target repository like:

repo.rm(patterns: ['.'])

and then do the add.
Anything that is still the same as before the remove, will undo the remove. So this should not result to any wacky commit logs or anything.

I expected this to be the default functionality...
But having it as an additional setting is also fine by me ๐Ÿ˜

dev build after rc infers from last release

If I'm on a branch and I have a v0.20.0-rc.1 tag, I would expect future untagged stages to be based on that tag. I.e. the next dev build would use 0.20.0 as the nearest so that the next dev build would be 0.20.0-dev.4. Is there a strict ordering in the stages? I went through InferredVersionSpec and don't see this case covered (dev after rc), so I guess in essence it's unspecified what happens. I'm curious what the expected behavior is, either way. If I know I can add to the test. I see in the InferredVersion code that nearest is all that's taking into account.

My use-case if that I'm trying to bootstrap a new branch and before a single release has gone out, I want all dev builds to be using a version specific to that branch. Any suggestions on how to accomplish this? I was hoping I could create a "dummy" tagged stage called "branch" and then I would manually create a tag like v2.0.0-branch.1 so that future version calculations use 2.0.0 as a base.

examples for basic git command need

task fetch(type: GitFetch) {
    setRemote("file:///D:/Inetpub/app")
    fetch()
}

org.gradle.api.GradleException: Problem with transport.

How can I create such kind of task?

publishGhPages require X11 Display

I get the following output from my Jenkins build (running Ubuntu):

Execution failed for task ':publishGhPages'.
No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Any clue what might cause it? I'm using latest 0.8.0 version. Just upgraded from 0.6.3.

Version has not been inferred when using the tooling API

I have the following minimal build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.ajoberstar:gradle-git:0.8.0'
    }
}

apply plugin: 'grgit-release'

import org.ajoberstar.grgit.*

release {
    grgit = Grgit.open(project.file('.'))
}

If I try to import this to IntelliJ IDEA from the Quick Start -window using Import Project, the importing fails with the following error:

14:16:47 Gradle 'release-test' project refresh failed:
     Could not resolve all dependencies for configuration 'detachedConfiguration1'.
     Version has not been inferred.

It seems that the tooling API allows calls to the model before the task-graph is ready. Perhaps the default version inferring could be done earlier?

error: No value for key branch.gradle.merge found in configuration

task pull(type: GitPull) {
  description = "git pull "
  setRepoPath gitRootDir
}

gradle pull

I am getting error:

Caused by: org.eclipse.jgit.api.errors.InvalidConfigurationException: No value for key branch.gradle.merge found in configuration

Full stack:

:pull FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':pull'.
> Problem with pull.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':pull'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
    at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:179)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:232)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:138)
    at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
    at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(DefaultTaskPlanExecutor.java:52)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(DefaultTaskPlanExecutor.java:38)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:30)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:130)
    at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
    at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:158)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
    at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
    at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:137)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:48)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:39)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: org.gradle.api.GradleException: Problem with pull.
    at org.ajoberstar.gradle.git.tasks.GitPull.pullRepo(GitPull.java:59)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.ajoberstar.gradle.git.tasks.GitPull_Decorated.invokeMethod(Unknown Source)
    at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:161)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:156)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:472)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:461)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60)
    ... 57 more
Caused by: org.eclipse.jgit.api.errors.InvalidConfigurationException: No value for key branch.gradle.merge found in configuration
    at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:173)
    at org.ajoberstar.gradle.git.tasks.GitPull.pullRepo(GitPull.java:51)
    ... 67 more


BUILD FAILED

Typo in Grgit groovydoc class description for clone

The groovydoc page for Grgit has a typo in the class description clone section. It says that to clone call:

def grgit = Grgit.open(dir: new File('path/to/my/repo'), uri: '[email protected]:ajoberstar/grgit.git')

But I believe the correct method is:

def grgit = Grgit.clone(dir: new File('path/to/my/repo'), uri: '[email protected]:ajoberstar/grgit.git')

Looks like a cut-and-paste error.

GitPush is always using the awt

I try to use the GitPush task to automatically publish to GitHub, using SSH. It seems the GitClone task works fine, but when the Push starts, it's always asking for credentials (awt windows)
I don't want to set the credentials in a file, but use only the SSH key on a build server. How can I configure that?

Binaries require Java 1.7

Hi!

Is there any reason this library requires java 1.7? I have not checked the latest release, but I think it runs fine on java 1.6 so I don't see any reason in imposing an artificial requirement for nothing.

Let me know what you think.

Thanks,
Alex

Check for non-final dependencies in release

Part of the ready* task should be to check the dependencies to see if any are non-final (e.g. SNAPSHOTs). Could try parsing as semver versions, and if they pass check for pre-release info.

Plugin with id 'github-pages' not found

Hi,
I really enjoy your Git tasks but I do not know how to install the 'github-pages' plugin. Here is my deploy.gradle :

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.ajoberstar:gradle-git:0.6.3'
    }
}

import org.ajoberstar.gradle.git.tasks.*

apply plugin: 'github-pages'

I probably forgot to add some lines

GitClone fails to pop the awt password box from 0.6.0 up

After lengthy troubleshooting of my issues noted in #30 thinking I had messed up my local dependency cache / SSH setup I finally tried to vary the gradle-git version and my issue went away when using 0.5.0 again :-)

I tossed together a quick example:

import org.ajoberstar.gradle.git.tasks.*

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'org.ajoberstar:gradle-git:0.6.0'
    }
}

task testClone(type: GitClone) {
    def org = 'Nanoware'
    def repo = 'Portals'
    def destination = file("$repo")
    enabled = !destination.exists()
    if (enabled) {
        uri = "[email protected]:$org/" + repo + ".git"
        destinationPath = destination
        bare = false
    }
}

That fails for me on my primary system, a clean system (just in case I had messed something up), and on a friend's system with the following error (with --stacktrace on):

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':testClone'.
> Problem with transport.
...
Caused by: org.gradle.api.GradleException: Problem with transport.
...
Caused by: org.eclipse.jgit.api.errors.TransportException: [email protected]:Nanoware/Portals.git: Auth fail
...
Caused by: org.eclipse.jgit.errors.TransportException: [email protected]:Nanoware/Portals.git: Auth fail
...
Caused by: com.jcraft.jsch.JSchException: Auth fail

Normal command line git commands work fine and ask for my passphrase. Going back to 0.5.0 makes it work fine and the awt passphrase prompt pops up.

While digging around I found: http://stackoverflow.com/questions/12502452/how-do-you-set-the-configuration-for-jschconfigsessionfactory-for-jgit-so-that-p/15290861#15290861

But I'm not sure if I'm simply approaching authentication the wrong way after the addition of jsch-agent-proxy support in 0.6.0. Same error in 0.6.2, although at least the new GitInit task works - unsurprisingly since it doesn't auth :-)

I've tried adding the following to no avail:

    credentials {
        password = '[password]'
    }

Thoughts?

GitClone incremental build support issue

Here is my task definition:

task 'clone-log-to-jira-static'(type: GitClone) {
    uri = 'https://github.com/ignite/log-to-jira.git'
    destinationPath = 'repos/log-to-jira'
    credentials {
        username = 'aleksz'
        password = 'xxx'
    }
}

When I run it second time, I get error: Destination path "log-to-jira" already exists and is not an empty directory. It should show UP-TO-DATE and skip this task.

gradle --version

------------------------------------------------------------
Gradle 1.2
------------------------------------------------------------

Gradle build time: Wednesday, September 12, 2012 10:46:02 AM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_09 (Oracle Corporation 23.5-b02)
OS: Linux 3.5.0-19-generic amd64

Allow releasing without new commits

Use case 1: I've performed a RC release, and it has been successfully tested, with no code changes. Now I want to roll the final release. But I can't roll it because of the InferredVersion.releasable check in the prepare task, which fails unless there are intermediate commits. In reality I NEVER want to see a commit between the last RC release and the final release.

Use case 2: We're moving away from the use of SNAPSHOTs and towards using -dev releases from our CI server. But the CI server can't run a -dev release because there are no new commits for it to push. The CI server should never commit, but it should certainly be able to release (in the sense that it should be able to run the releaseTasks tasks (e.g. publish) to push the artifacts somewhere, and to optionally create and push a tag.

Thanks,
Shannon

Git Commit Hash as Version

Hi,

I don't know if it is already implemented or if there is an easy way with your plugin to do this or not.

I am building jar files. Each jar-file has a version number. If it has not, it is versioned with '-SNAPSHOT'
But this way I am losing control of which commit I did the snapshot. I would prefer somthing like this: '-5ah3e23'
myapp-SNAPSHOT.jar vs myapp-5ah3e23.jar

It would be much easier to know, which version is out there.

Something like:
def readLastCommitHash() {
'git log -1 --pretty=format:"%h"'.execute().getText()
}

Cheers,
Martin

publishGhPages with github token not working

When trying to execute gradlew publishGhPages (locally, on windows, Android Studio 0.5.9) using the setup below, task still shows a popup window asking for the credentials:

githubPages {

    repoUri = 'https://github.com/....git'
    pages {
        from './build/docs/'
    }
    credentials {
        username = 'myfullgithubtoken'
        password = ''
    }
}

Am I doing something wrong or is there something elso going wrong?

GitCheckout add force option

Add the force option in GitCheckout.java

This is all the code:

   private boolean forceCheckout = false;

inside the checkout method:

   cmd.setForce(forceCheckout);

GitClone causes illegal argument exception

import org.ajoberstar.gradle.git.tasks.*

buildscript {
  repositories { 
    mavenCentral()
  }
  dependencies {
    classpath 'org.ajoberstar:gradle-git:0.2.3'
  }
}



task foo(type: GitClone) {
  destinationDir = 'gradle-git'
  uri = 'https://github.com/ajoberstar/gradle-git.git'
}

task wrapper(type: Wrapper) {
  gradleVersion = '1.0'
}

Then
gradle wrapper
./gradlew foo

results in the path being null

java.lang.IllegalArgumentException: Neither path nor baseDir may be null or empty string. path='null' basedir=...

Am I using this incorrectly, or is this a bug?

Clone current working dir if from same git upstream

github pages is cloning a LARGE upstream repository into build/ghpages, but the entire git repository is also the root of the current repository. Can it please clone from the local copy, then if required add an origin and pull changes, rather than pulling the whole huge (duplicate) repository from remote?

Releasing multi-module project

Hi,

can you give me an example on how to release a multi-module project with your grgit-release plugin?

If I apply the plugin to all my subprojects it tries to create the same version for each subproject which obviously fails in git.
If I apply the plugin to the root project only then
1.) releaseTask needs to reference subproject tasks which is annoying if you have quite some subprojects, e.g. releaseTask = [ ':proj1:clean', 'proj2:clean', 'proj1:build', 'proj2:build' ]
2.) the prepare task fails because no version has been inferred.

localhost:common-parent Jens$ ./gradlew -Prelease.scope=major -Prelease.stage=final release
The Compile.setJavaCompiler(Compiler<JavaCompileSpec>) method has been deprecated and is scheduled to be removed in Gradle 2.0.
:prepare FAILED
:validateSinceTags SKIPPED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':prepare'.
> Version has not been inferred.

The build file of the root project is basically like:

apply plugin: 'grgit-release'

release {
  grgit = Grgit.open(project.file('.'))
  releaseTasks = [':common:clean', ':common-gwt:clean', ':common:build', ':common-gwt:build' ]
}

subprojects {
  apply plugin: 'java'
  apply plugin: 'signing'
  apply plugin: 'maven'
  ..... configuration for all subprojects ....
}

I think I am missing something obvious.

Thanks in advance.

jnilib error for publishGhPages

When I run the build using Gradle wrapper 1.10 I get the following output running on Mac OS X 10.9.2:

$ java -version
Calling 'java' to output the currently used java version
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

$ ./gradlew publishGhPages
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
:cleanGhPages
:cloneGhPages
File found at /Users/alex/native/jna/darwin/libjnidispatch.jnilib but not loadable: Native Library /Users/alex/native/jna/darwin/libjnidispatch.jnilib already loaded in another classloader
:processGhPages
:addGhPages
:commitGhPages
:pushGhPages
:publishGhPages

BUILD SUCCESSFUL

The build is successful but nevertheless the JNI error is slightly worrying. I didn't have time to look into your plugin too deeply, so any advice is appreciated. Thanks.

0.7.+ release misses gradle-git plugin files

I tried to use gradle-git 0.7.0 and 0.7.1 from Maven Central. It seems that essential parts of gradle-git are missing. The jar of 0.7.1 has 17kB, 0.6.5 has 107kB.

Gradle gives following error:
Could not find implementation class 'org.ajoberstar.gradle.git.plugins.GrGitPlugin' for plugin 'grgit' specified in jar:file:/Users/xxx/.gradle/caches/modules-2/files-2.1/org.ajoberstar/gradle-git/0.7.0/1f3fbfdc85448f6ff95d938dba7810e2c9f09dda/gradle-git-0.7.0.jar!/META-INF/gradle-plugins/grgit.properties.

Allow user to determine if a module is releasable

We have some dynamic behaviors which can change a build, without a commit. This means we would want to be able to do a release without any additional commits. It looks like in InferredVersion, it wouldn't be too hard to make releasable a Closure with a default of { nearest.distanceFromAny > 0 } (though how nearest is captured would be an issue).

GitClone doesn't release .git directory if dependsOn

It seems that when I have a Task that depends on a GitClone task, it doesn't release a file from .git directory until the process finishes. I experienced that because my task is trying to rename the directory.

While debugging I can see that the directory is locked by:

java.exe pid: 11108 type: File 798: E:${path}${clonedD irectory}.git\objects\pack\pack-d227a324d409bf2ff03b133827b9bfb6f9d75a56.pack

Thanks,

Daniel

apply plugin : 'github' doesnt work.

As mentioned in the README section, If I apply plugin: 'github' in my build.gradle, I get Plugin with id 'github' not found

Also, I see only Github Pages plugin descriptor at src/main/resources/META-INF/gradle-plugins/github-pages.properties

I guess, if there is no such plugin github, README needs to be corrected. If there exists such plugin then there is some issue with it not working.

Is it possible to delete files using the github-pages plugin?

As far as I can tell when you remove or rename a file, the original file will stay in the gh-pages branch, since files only get into the repository, but not removed.

Is there a way to remove files?

Maybe a way to specify some directories to be cleaned before copying over the new stuff would do the trick.

GitCheckout.java

Please add this at the GitCheckout.java

cmd.setUpstreamMode(SetupUpstreamMode.TRACK)

for that Git pull work fine:

Caused by: org.eclipse.jgit.api.errors.InvalidConfigurationException: No value for key branch.ubuntu.merge found in configuration
        at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:217)

Memory usage

I'm using the following script:

import org.ajoberstar.grgit.*;

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.ajoberstar:gradle-git:0.9.+'
    }
}

ext.repo = Grgit.open(project.file('../'))
ext.tagList = ext.repo.tag.list()
ext.tag = tagList.get(tagList.size() - 1).getName()

if (isRelease == 'false') {
    int lastNumber = Integer.parseInt(tag.substring(tag.size() - 1))
    ext.tag = tag.substring(0, tag.size() - 1) + (lastNumber + 1);
}

When this script is active, I get a lot of java.lang.OutOfMemoryError: PermGen space errors. Killing the java process solves the problem for a short while. Possibly a memory leak somewhere? I have confirmed that this issue does not occur when I disable that script.

Support Maven style SNAPSHOT versions

The current InferredVersion doesn't seem to have the ability to have a stage/scope combination that ends with -SNAPSHOT. If I use build metadata, it'll always be appended with a "+", e.g. "+SNAPSHOT". If I name my stage SNAPSHOT, it'll get commit count appended to it, always, e.g. "-SNAPSHOT.3". I would have to use a stage of "final" to avoid the target version, but clearly that's not the best stage for a SNAPSHOT build.

It's not possible to stage a single file from a subdirectory with GitAdd

Maybe I'm just using GitAdd wrong, but I wasn't able to use GitAdd to stage a single file from a subdirectory.

I've tried the following:
First try: Include the file that should be staged

task myTask(type: GitAdd) {
    include('path/to/file')
}

This stages all changed files.

Second try: Include the file that should be staged and exclude everything else

task myTask(type: GitAdd) {
    include('path/to/file')
    exclude('*')
}

This stages nothing at all.

Then I tried to define the includes/excludes using closures and/or using my own Spec<FileTreeElement> implementation. Without success.

I've checked the source code and I believe that this is caused by the way FileTree.matching(PatternFilterable patterns) works. A call to FileTree.matching(...) will only check files in subdirectories if the directory itself isn't excluded, e.g. to include path/to/file I have to include the directory path/to. With path/to included GitAdd stages all modified files below path/to.

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.