diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 9be205f..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Dependabot configuration: -# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - # Maintain dependencies for Gradle dependencies - - package-ecosystem: "gradle" - directory: "/" - target-branch: "next" - schedule: - interval: "daily" - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - target-branch: "next" - schedule: - interval: "daily" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 711fc74..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,174 +0,0 @@ -# GitHub Actions Workflow created for testing and preparing the plugin release in following steps: -# - validate Gradle Wrapper, -# - run test and verifyPlugin tasks, -# - run buildPlugin task and prepare artifact for the further tests, -# - run IntelliJ Plugin Verifier, -# - create a draft release. -# -# Workflow is triggered on push and pull_request events. -# -# Docs: -# - GitHub Actions: https://help.github.com/en/actions -# - IntelliJ Plugin Verifier GitHub Action: https://github.com/ChrisCarini/intellij-platform-plugin-verifier-action -# -## JBIJPPTPL - -name: Build -on: - # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests) - push: - branches: [ develop ] - # Trigger the workflow on any pull request - pull_request: - -jobs: - - # Run Gradle Wrapper Validation Action to verify the wrapper's checksum - gradleValidation: - name: Gradle Wrapper - runs-on: ubuntu-latest - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 - - # Validate wrapper - - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.0.4 - - # Run verifyPlugin and test Gradle tasks - test: - name: Test - needs: gradleValidation - runs-on: ubuntu-latest - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 - - # Setup Java 11 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: 11 - cache: gradle - - # Set environment variables - - name: Export Properties - id: properties - shell: bash - run: | - PROPERTIES="$(./gradlew properties --console=plain -q)" - IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)" - - echo "::set-output name=ideVersions::$IDE_VERSIONS" - echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" - - # Cache Plugin Verifier IDEs - - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v2.1.6 - with: - path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides - key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }} - - # Run Qodana inspections - - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v2.1-eap - - # Run tests - - name: Run Tests - run: ./gradlew test - - # Run verifyPlugin Gradle task - - name: Verify Plugin - run: ./gradlew verifyPlugin - - # Run IntelliJ Plugin Verifier action using GitHub Action - - name: Run Plugin Verifier - run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} - - # Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs - # Requires test job to be passed - build: - name: Build - needs: test - runs-on: ubuntu-latest - outputs: - version: ${{ steps.properties.outputs.version }} - changelog: ${{ steps.properties.outputs.changelog }} - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 - - # Setup Java 11 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: 11 - cache: gradle - - # Set environment variables - - name: Export Properties - id: properties - shell: bash - run: | - PROPERTIES="$(./gradlew properties --console=plain -q)" - VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" - NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" - CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" - CHANGELOG="${CHANGELOG//'%'/'%25'}" - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" - - echo "::set-output name=version::$VERSION" - echo "::set-output name=name::$NAME" - echo "::set-output name=changelog::$CHANGELOG" - - # Build artifact using buildPlugin Gradle task - - name: Build Plugin - run: ./gradlew buildPlugin - - # Store built plugin as an artifact for downloading - - name: Upload artifacts - uses: actions/upload-artifact@v2.2.4 - with: - name: "${{ steps.properties.outputs.name }} - ${{ steps.properties.outputs.version }}" - path: ./build/distributions/* - - # Prepare a draft release for GitHub Releases page for the manual verification - # If accepted and published, release workflow would be triggered - releaseDraft: - name: Release Draft - if: github.event_name != 'pull_request' - needs: build - runs-on: ubuntu-latest - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 - - # Remove old release drafts by using the curl request for the available releases with draft flag - - name: Remove Old Release Drafts - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh api repos/{owner}/{repo}/releases \ - --jq '.[] | select(.draft == true) | .id' \ - | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} - - # Create new release draft - which is not publicly visible and requires manual acceptance - - name: Create Release Draft - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create v${{ needs.build.outputs.version }} \ - --draft \ - --title "v${{ needs.build.outputs.version }}" \ - --notes "${{ needs.build.outputs.changelog }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 597a17d..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,69 +0,0 @@ -# GitHub Actions Workflow created for handling the release process based on the draft release prepared -# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided. - -name: Release -on: - release: - types: [ prereleased, released ] - -jobs: - - # Prepare and publish the plugin to the Marketplace repository - release: - name: Publish Plugin - runs-on: ubuntu-latest - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 - with: - ref: ${{ github.event.release.tag_name }} - - # Setup Java 11 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: 11 - cache: gradle - - # Update Unreleased section with the current release note - - name: Patch Changelog - run: | - ./gradlew patchChangelog --release-note="`cat << EOM - ${{ github.event.release.body }} - EOM`" - - # Publish the plugin to the Marketplace - - name: Publish Plugin - env: - PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} - run: ./gradlew publishPlugin - - # Upload artifact as a release asset - - name: Upload Release Asset - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* - - # Create pull request - - name: Create Pull Request - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - VERSION="${{ github.event.release.tag_name }}" - BRANCH="changelog-update-$VERSION" - - git config user.email "action@github.com" - git config user.name "GitHub Action" - - git checkout -b $BRANCH - git commit -am "Changelog update - $VERSION" - git push --set-upstream origin $BRANCH - - gh pr create \ - --title "Changelog update - \`$VERSION\`" \ - --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \ - --base main \ - --head $BRANCH diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml deleted file mode 100644 index f549056..0000000 --- a/.github/workflows/run-ui-tests.yml +++ /dev/null @@ -1,60 +0,0 @@ -# GitHub Actions Workflow created for launching UI tests on Linux, Windows, and Mac in the following steps: -# - prepare and launch Idea with your plugin and robot-server plugin, which is need to interact with UI -# - wait for the Idea started -# - run UI tests with separate Gradle task -# -# Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ IDEA. -# -# Workflow is triggered manually. - -name: Run UI Tests -on: - workflow_dispatch - -jobs: - - testUI: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - runIde: | - export DISPLAY=:99.0 - Xvfb -ac :99 -screen 0 1920x1080x16 & - gradle runIdeForUiTests & - - os: windows-latest - runIde: start gradlew.bat runIdeForUiTests - - os: macos-latest - runIde: ./gradlew runIdeForUiTests & - - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 - - # Setup Java 11 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: 11 - cache: gradle - - # Run IDEA prepared for UI testing - - name: Run IDE - run: ${{ matrix.runIde }} - - # Wait for IDEA to be started - - name: Health Check - uses: jtalk/url-health-check-action@v1.5 - with: - url: http://127.0.0.1:8082 - max-attempts: 15 - retry-delay: 30s - - # Run tests - - name: Tests - run: ./gradlew test diff --git a/README.md b/README.md index 58a1c83..6f54907 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Git Flow Integration for Intellij +# Git Flow Integration Plus for Intellij + +### Available @ [JetBrains Plugins Repository][1] An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent [Driessen's branching model](http://nvie.com/git-model). @@ -17,9 +19,16 @@ Or have a look at this [cheat sheet](http://danielkummer.github.io/git-flow-chea Huge shoutout [to Kirill Likhodedov](https://github.com/klikh), who wrote much of the original git4idea plugin, without which this plugin could not exist -## Installation +## Online Installation -The plugin is available via the IntelliJ plugin manager. Just search for "Git Flow Integration" to get the latest version! +The plugin is available via the IntelliJ plugin manager. Just search for "Git Flow Integration Plus" to get the latest version! + +**The plugin requires that you have gitflow installed, specifically the [AVH edition](https://github.com/petervanderdoes/gitflow). This is because the [Vanilla Git Flow](https://github.com/nvie/gitflow) hasn't been maintained in years.** See this page [for details](https://github.com/RubinCarter/gitflow4idea-fix/blob/develop/GITFLOW_VERSION.md) + +## Offline Installation +download path: https://github.com/RubinCarter/gitflow4idea-fix/releases + +Installation document:https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_disk **The plugin requires that you have gitflow installed, specifically the [AVH edition](https://github.com/petervanderdoes/gitflow). This is because the [Vanilla Git Flow](https://github.com/nvie/gitflow) hasn't been maintained in years.** See this page [for details](https://github.com/RubinCarter/gitflow4idea-fix/blob/develop/GITFLOW_VERSION.md) @@ -43,5 +52,8 @@ Copyright 2013-2020, Opher Vishnia. This plugin was created by [Opher Vishnia](http://www.opherv.com), after I couldn't find any similar implementation. I saw this [suggestion page](http://youtrack.jetbrains.com/issue/IDEA-65491) on the JetBrains site has more than 220 likes and 80 comments, and decided to take up the gauntlet :) -This plugin is forked from original https://github.com/OpherV/gitflow4idea With adding some extended features missing. +This plugin is forked from original https://github.com/OpherV/gitflow4idea . + + +[1]: https://plugins.jetbrains.com/plugin/18320-git-flow-integration-plus diff --git a/build.gradle b/build.gradle deleted file mode 100644 index a7b4b03..0000000 --- a/build.gradle +++ /dev/null @@ -1,120 +0,0 @@ -plugins { - id 'java' - id 'org.jetbrains.intellij' version '0.6.4' -} - -compileJava { - options.compilerArgs += ["-Xlint"] -} - -group 'gitflow4idea-fix' -version '0.7.8' - -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 - -repositories { - mavenCentral() -} - -dependencies { - testCompile group: 'junit', name: 'junit', version: '4.12' -} - -intellij { - version '2021.3' - plugins 'git4idea', 'tasks' -} - -patchPluginXml { - pluginId "Gitflow-Fix" - pluginDescription """ -

Git Flow Integration for Intellij

- An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent Driessen's branching model - """ - version '0.7.8' - sinceBuild '212.0' -// untilBuild '*.*' - changeNotes """ - -

Changelog for 0.7.8

- - -

Changelog for 0.7.7

- - -

Changelog for 0.7.6

- - -

Changelog for 0.7.5

- - -

Changelog for 0.7.4

- - -

Changelog for 0.7.3

- - -

Changelog for 0.7.2

- - -

Changelog for 0.7.1

- - -

Changelog for 0.7.0

- - -

Changelog for 0.6.9

- - -

Changelog for 0.6.8

- - -

Note - if you see 'no gitflow' in the status bar you will need to re-init using git flow init -f

- """ -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..b8bf827 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,139 @@ +plugins { + id("java") + id("org.jetbrains.intellij") version "1.9.0" +} + +/*compileJava { + options.compilerArgs += ["-Xlint"] +}*/ + +repositories { + mavenLocal() + mavenCentral() +} + +group = "gitflow4idea-plus" +version = "0.7.11" + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +dependencies { + testImplementation("junit:junit:4.13.2") +} + +intellij { + version.set("2022.2.1") + plugins.set(listOf("git4idea", "tasks")) + updateSinceUntilBuild.set(false) +} + +tasks { + patchPluginXml { + pluginId.set("Gitflow-Fix") + pluginDescription.set(""" +

Git Flow Integration for Intellij

+ An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent Driessen's branching model + """) + version.set("${project.version}") + sinceBuild.set("222.3739.54") + changeNotes.set(""" +

Changelog for 0.7.11

+ + +

Changelog for 0.7.10

+ + +

Changelog for 0.7.9

+ + +

Changelog for 0.7.8

+ + +

Changelog for 0.7.7

+ + +

Changelog for 0.7.6

+ + +

Changelog for 0.7.5

+ + +

Changelog for 0.7.4

+ + +

Changelog for 0.7.3

+ + +

Changelog for 0.7.2

+ + +

Changelog for 0.7.1

+ + +

Changelog for 0.7.0

+ + +

Changelog for 0.6.9

+ + +

Changelog for 0.6.8

+ + +

Note - if you see 'no gitflow' in the status bar you will need to re-init using git flow init -f

+ """) + } +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..249e583 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4b4429..ae04661 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 2fe81a7..a69d9cb 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,78 +17,113 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -105,79 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 62bd9b9..f127cfd 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,38 +64,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/src/main/java/gitflow/GitflowConfigUtil.java b/src/main/java/gitflow/GitflowConfigUtil.java index 5374139..2eb6d29 100644 --- a/src/main/java/gitflow/GitflowConfigUtil.java +++ b/src/main/java/gitflow/GitflowConfigUtil.java @@ -2,6 +2,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; + import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Disposer; diff --git a/src/main/java/gitflow/JSONUtils.java b/src/main/java/gitflow/JSONUtils.java new file mode 100644 index 0000000..dd547ba --- /dev/null +++ b/src/main/java/gitflow/JSONUtils.java @@ -0,0 +1,27 @@ +package gitflow; + +import com.intellij.json.psi.JsonObject; +import com.intellij.json.psi.JsonProperty; +import com.intellij.json.psi.JsonPsiUtil; +import com.intellij.json.psi.JsonValue; +import org.apache.commons.lang3.ObjectUtils; + +import java.util.Optional; + +/** + * @author rubin 2022年01月12日 + */ +public class JSONUtils { + + @SuppressWarnings("unchecked") + public static T getValue(JsonObject obj, String property, Class clazz) { + String valueStr = JsonPsiUtil.stripQuotes(Optional.ofNullable(obj.findProperty(property)).map(JsonProperty::getValue).map(JsonValue::getText).orElse("")); + if(clazz == String.class) { + return (T)valueStr; + } else if(clazz == Boolean.class) { + return (T)Boolean.valueOf(valueStr); + } + return (T)valueStr; + } + +} diff --git a/src/main/java/gitflow/actions/GitflowPopupGroup.java b/src/main/java/gitflow/actions/GitflowPopupGroup.java index 1703cb4..cd459bf 100644 --- a/src/main/java/gitflow/actions/GitflowPopupGroup.java +++ b/src/main/java/gitflow/actions/GitflowPopupGroup.java @@ -35,7 +35,7 @@ public GitflowPopupGroup(@NotNull Project project, boolean includeAdvanced) { * Generates the popup actions for the widget */ private void createActionGroup(boolean includeAdvanced){ - actionGroup = new DefaultActionGroup(null, false); + actionGroup = new DefaultActionGroup(); if (gitRepositories.size() == 1){ diff --git a/src/main/java/gitflow/actions/RepoActions.java b/src/main/java/gitflow/actions/RepoActions.java index 0e48d5e..ebdc99a 100644 --- a/src/main/java/gitflow/actions/RepoActions.java +++ b/src/main/java/gitflow/actions/RepoActions.java @@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import javax.swing.*; import java.util.ArrayList; import java.util.Iterator; @@ -100,8 +101,10 @@ public String getInfoText() { } public void updateFavoriteIcon(){ - boolean isFavorite = GitBranchUtil.getCurrentRepository(myProject) == myRepo; - setFavorite(isFavorite); + SwingUtilities.invokeLater(() -> { + boolean isFavorite = GitBranchUtil.getCurrentRepository(myProject) == myRepo; + setFavorite(isFavorite); + }); } @Override diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 3e71712..c2eb552 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,6 +1,6 @@ - Git Flow Integration Fix + Git Flow Integration Plus SET_BY_GRADLE SET_BY_GRADLE SET_BY_GRADLE