ajoberstar / gradle-git Goto Github PK
View Code? Open in Web Editor NEWGit plugin for Gradle
License: Apache License 2.0
Git plugin for Gradle
License: Apache License 2.0
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)
Thanks for your plugin!
I wanted to know how to set the author of a commit but the link at http://ajoberstar.org/gradle-git/docs/groovydoc/PersonIdent.html gives a 404.
I came up with this clunky line where I set the author:
task commit(type: GitCommit){ setAuthor(new org.eclipse.jgit.lib.PersonIdent("me", "[email protected]")) setMessage("hi") }
There is a more concise way, isn't there?
Thanks
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.
With the GitClone task it's possible to clone the repo.
Is it also possible to checkout a certain tag / commit?
Currently it always says "Publish of Github pages from Gradle."
Perhaps there is an undocumented option. If so please document it.
Thanks!
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.
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 ๐
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.
Check if there is uncommitted code in the repo
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.
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.
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
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
For shallow clones.
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
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
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?
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?
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.
Was looking into the idea of writing my own plugin to do this, but to be frank I know too little about developing gradle itself instead of using gradle to develope other things.
I was thinking a port of sorts for this maven plugin: https://github.com/github/maven-plugins
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.
In GitBase, it might be better to enable searching the repository folder up from and inclusive the current project folder.
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.
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
.
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?
Not every use case for Git interaction in Gradle requires (or is possible) with tasks. Allowing an API oriented approach, that still includes tasks, would be more flexible.
Add the force option in GitCheckout.java
This is all the code:
private boolean forceCheckout = false;
inside the checkout method:
cmd.setForce(forceCheckout);
Check Github for a milestone with the name of the inferred version. If found, check that all issues are closed.
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
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?
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.
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).
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.
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?
I've run into a few issues now, saying that we should refer to the javadocs/groovydocs and Grgit is a copout.
Here's an example of discrepancies:
according to the docs http://ajoberstar.org/grgit/docs/groovydoc/org/ajoberstar/grgit/operation/CloneOp.html
So I'm wasting a lot of time figuring out how to actually use this.
And I'm not the first one to moan.
EDIT: My example was void since I was being a tool. But the point is still valid.
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.
Either the prepare task should force inference or the methods on InferredVersion should.
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
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.
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?
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?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.