Skip to content

Commit

Permalink
Merge branch 'release/0.4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
OpherV committed Sep 10, 2015
2 parents 29c85b1 + 562aba8 commit 5b61f1c
Show file tree
Hide file tree
Showing 13 changed files with 454 additions and 144 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
*.zip
*.jar
out
gitflow.iml
*.iml
26 changes: 12 additions & 14 deletions META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<name>Git Flow Integration</name>
<id>Gitflow</id>
<description>Git Flow Integration</description>
<version>0.4.3</version>
<version>0.4.4</version>
<category>VCS Integration</category>
<vendor url="http://www.opherv.com">Opher Vishnia</vendor>

Expand All @@ -17,23 +17,21 @@

<action id="Gitflow.InitRepo" class="gitflow.actions.InitRepoAction" text="Initialize Gitflow Repository"></action>

<action id="Gitflow.StartFeature" class="gitflow.actions.StartFeatureAction" text="Start Feature"></action>
<action id="Gitflow.FinishFeature" class="gitflow.actions.FinishFeatureAction" text="Finish Feature"></action>
<action id="Gitflow.PublishFeature" class="gitflow.actions.PublishFeatureAction" text="Publish Feature"></action>
<action id="Gitflow.TrackFeature" class="gitflow.actions.TrackFeatureAction" text="Track Feature"></action>
<action id="Gitflow.StartFeature" class="gitflow.actions.StartFeatureAction" text="Gitflow: Start Feature..."></action>
<action id="Gitflow.FinishFeature" class="gitflow.actions.FinishFeatureAction" text="Gitflow: Finish Feature..."></action>
<action id="Gitflow.PublishFeature" class="gitflow.actions.PublishFeatureAction" text="Gitflow: Publish Feature"></action>
<action id="Gitflow.TrackFeature" class="gitflow.actions.TrackFeatureAction" text="Gitflow: Track Feature..."></action>

<action id="Gitflow.StartRelease" class="gitflow.actions.StartReleaseAction" text="Start Release"></action>
<action id="Gitflow.FinishRelease" class="gitflow.actions.FinishReleaseAction" text="Finish Release"></action>
<action id="Gitflow.PublishRelease" class="gitflow.actions.PublishReleaseAction" text="Publish Release"></action>
<action id="Gitflow.TrackRelease" class="gitflow.actions.TrackReleaseAction" text="Track Release"></action>
<action id="Gitflow.StartRelease" class="gitflow.actions.StartReleaseAction" text="Gitflow: Start Release..."></action>
<action id="Gitflow.FinishRelease" class="gitflow.actions.FinishReleaseAction" text="Gitflow: Finish Release"></action>
<action id="Gitflow.PublishRelease" class="gitflow.actions.PublishReleaseAction" text="Gitflow: Publish Release"></action>
<action id="Gitflow.TrackRelease" class="gitflow.actions.TrackReleaseAction" text="Gitflow: Track Release..."></action>

<action id="Gitflow.StartHotfix" class="gitflow.actions.StartHotfixAction" text="Start Hotfix"></action>
<action id="Gitflow.FinishHotfix" class="gitflow.actions.FinishHotfixAction" text="Finish Hotfix"></action>
<action id="Gitflow.PublishHotfix" class="gitflow.actions.PublishHotfixAction" text="Publish Hotfix"></action>
<action id="Gitflow.StartHotfix" class="gitflow.actions.StartHotfixAction" text="Gitflow: Start Hotfix..."></action>
<action id="Gitflow.FinishHotfix" class="gitflow.actions.FinishHotfixAction" text="Gitflow: Finish Hotfix"></action>
<action id="Gitflow.PublishHotfix" class="gitflow.actions.PublishHotfixAction" text="Gitflow: Publish Hotfix"></action>
</actions>



<project-components>
<component>
<implementation-class>gitflow.GitflowComponent</implementation-class>
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ This plugin is under the [Apache 2.0 license](http://www.apache.org/licenses/LIC
Copyright 2013-2014, Opher Vishnia.


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/OpherV/gitflow4idea/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
70 changes: 70 additions & 0 deletions docs/project_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Project setup help

This is a quick overview how to setup the project for development.

## 1. Make sure the plugin development plugin is enabled

Start IDEA, go to *Settings -> Plugins* and make sure that `Plugin DevKit` is installed and enabled.
If it's not, install it now.

## 2. Clone the project from GitHub

Typically you check out your fork of the project on GitHub here.

## 3. Import the project into IDEA

Select the *Import Project* option (e.g. by pressing shift twice and entering "import project")
and navigate to the cloned repository directory when prompted.

### Model

Chose "From existing sources" when prompted for a model.

### SDK Setup

If you dont have a plugin SDK yet, click `+` to add an SDK and select *IntelliJ Platform Plugin SDK*

1. Navigate to your IDEA installation and select the installation directory.
2. Afterwards select a JDK when prompted

Select your plugin SDK as the one to use.

### Other

The remaining options can be left at default

## 4. Change the project type

Open the projects iml file (it should be named `gitflow4idea.iml` by default) and replace its contents with this:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PLUGIN_MODULE" version="4">
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/META-INF/plugin.xml" />
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
```

Then close and reopen the project to apply the changes.

## 5. Add git4idea dependency

1. Open the module settings and navigate to *Modules -> gitflow4idea (or your project name here)* and select the *Dependencies* tab.
2. Click add -> "JARs or directories" and add `git4idea.jar`.
This can be found in your IDEA installation directory under `plugins/git4idea/lib`.
3. Change the scope of the added JAR to **provided**.

## 6. Create a run configuration

Go to Run/Debug configurations and create a new configuration of the type `Plugin`. Under "Use classpath of module" select the project (`gitflow4idea` by default).
Click run. A new IDEA instance should start with the plugin running.

And that's it. You can now make changes to the source and run them.


36 changes: 21 additions & 15 deletions src/gitflow/GitInitLineHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
import git4idea.commands.GitCommand;
import git4idea.commands.GitLineHandler;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

import git4idea.commands.GitCommand;
import git4idea.commands.GitLineHandler;


public class GitInitLineHandler extends GitLineHandler {
private BufferedWriter writer;
GitflowInitOptions _initOptions;

public GitInitLineHandler(GitflowInitOptions initOptions,@NotNull Project project, @NotNull VirtualFile vcsRoot, @NotNull GitCommand command) {
public GitInitLineHandler(GitflowInitOptions initOptions, @NotNull Project project, @NotNull VirtualFile vcsRoot, @NotNull GitCommand command) {
super(project, vcsRoot, command);
_initOptions=initOptions;
_initOptions = initOptions;
}

@Nullable
Expand All @@ -39,54 +40,59 @@ protected void processTerminated(final int exitCode) {

@Override
protected void onTextAvailable(String s, Key key) {
super.onTextAvailable(s,key);
super.onTextAvailable(s, key);
try {
if (s.contains("Branch name for production releases")){
if (s.contains("Branch name for production releases")) {
writer.write(_initOptions.getProductionBranch());
myVcs.showCommandLine(_initOptions.getProductionBranch());
writer.newLine();
writer.flush();
}

if (s.contains("Branch name for \"next release\"") ||
s.contains("Which branch should be used for integration of the")){
if (s.contains("Branch name for \"next release\"")) {

writer.write(_initOptions.getDevelopmentBranch());
myVcs.showCommandLine(_initOptions.getDevelopmentBranch());
writer.newLine();
writer.flush();
}
if (s.contains("Feature branches")){

if (s.contains("Which branch should be used for integration of the")) {
writer.newLine();
writer.flush();
}

if (s.contains("Feature branches")) {
writer.write(_initOptions.getFeaturePrefix());
myVcs.showCommandLine(_initOptions.getFeaturePrefix());
writer.newLine();
writer.flush();
}
if (s.contains("Release branches")){
if (s.contains("Release branches")) {
writer.write(_initOptions.getReleasePrefix());
myVcs.showCommandLine(_initOptions.getReleasePrefix());
writer.newLine();
writer.flush();
}
if (s.contains("Hotfix branches")){
if (s.contains("Hotfix branches")) {
writer.write(_initOptions.getHotfixPrefix());
myVcs.showCommandLine(_initOptions.getHotfixPrefix());
writer.newLine();
writer.flush();
}
if (s.contains("Support branches")){
if (s.contains("Support branches")) {
writer.write(_initOptions.getSupportPrefix());
myVcs.showCommandLine(_initOptions.getSupportPrefix());
writer.newLine();
writer.flush();
}
if (s.contains("Version tag")){
if (s.contains("Version tag")) {
writer.write(_initOptions.getVersionPrefix());
myVcs.showCommandLine(_initOptions.getVersionPrefix());
writer.newLine();
writer.flush();
}
if (s.contains("Hooks and filters")){
if (s.contains("Hooks and filters")) {
writer.newLine();
writer.flush();
}
Expand Down
34 changes: 17 additions & 17 deletions src/gitflow/Gitflow.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package gitflow;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import git4idea.commands.Git;
import git4idea.commands.GitCommandResult;
import git4idea.commands.GitLineHandlerListener;
import git4idea.repo.GitRemote;
import git4idea.repo.GitRepository;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
*
*
* @author Opher Vishnia / opherv.com / [email protected]
*/
public interface Gitflow extends Git {
Expand All @@ -23,26 +22,27 @@ public GitCommandResult initRepo(@NotNull GitRepository repository,

GitCommandResult startFeature(@NotNull GitRepository repository,
@NotNull String featureName,
@Nullable String baseBranch,
@Nullable GitLineHandlerListener... listeners);

GitCommandResult finishFeature(@NotNull GitRepository repository,
@NotNull String featureName,
@Nullable GitLineHandlerListener... listeners);

GitCommandResult publishFeature(@NotNull GitRepository repository,
@NotNull String featureName,
@Nullable GitLineHandlerListener... listeners);

GitCommandResult pullFeature(@NotNull GitRepository repository,
GitCommandResult publishFeature(@NotNull GitRepository repository,
@NotNull String featureName,
@NotNull GitRemote remote,
@Nullable GitLineHandlerListener... listeners);

GitCommandResult trackFeature(@NotNull GitRepository repository,
GitCommandResult pullFeature(@NotNull GitRepository repository,
@NotNull String featureName,
@NotNull GitRemote remote,
@Nullable GitLineHandlerListener... listeners);

GitCommandResult trackFeature(@NotNull GitRepository repository,
@NotNull String featureName,
@NotNull GitRemote remote,
@Nullable GitLineHandlerListener... listeners);

//release

GitCommandResult startRelease(@NotNull GitRepository repository,
Expand All @@ -61,22 +61,22 @@ GitCommandResult publishRelease(@NotNull GitRepository repository,
@Nullable GitLineHandlerListener... listeners);

GitCommandResult trackRelease(@NotNull GitRepository repository,
@NotNull String releaseName,
@Nullable GitLineHandlerListener... listeners);
@NotNull String releaseName,
@Nullable GitLineHandlerListener... listeners);

//hotfix

GitCommandResult startHotfix(@NotNull GitRepository repository,
@NotNull String hotfixName,
@Nullable String baseBranch,
@Nullable GitLineHandlerListener... listeners);

GitCommandResult finishHotfix(@NotNull GitRepository repository,
@NotNull String hotfixName,
@NotNull String tagMessage,
@Nullable GitLineHandlerListener... listeners);
@NotNull String hotfixName,
@NotNull String tagMessage,
@Nullable GitLineHandlerListener... listeners);

GitCommandResult publishHotfix(@NotNull GitRepository repository,
@NotNull String hotfixName,
@Nullable GitLineHandlerListener... listeners);

}
Loading

0 comments on commit 5b61f1c

Please sign in to comment.