Code Monkey home page Code Monkey logo

gng's People

Contributors

candrews avatar crepetl avatar dantesun avatar guyboltonking avatar yantonov 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

Watchers

 avatar  avatar  avatar  avatar  avatar

gng's Issues

Need new release for python 3.x

The last gng release was in 1.0.3 and doesn't support python 3.

This is not a problem for anyone installing the latest version directly, but is a little bit for packaging systems which wish to include gng, as they either have to pick an arbitrary tag, or local patch - e.g. https://pkgsrc.se/devel/gng

Thanks

Install script broken when run on WSL?

Describe the bug

I tried the install instructions but get an error running the script after cloning the repo from master.

To Reproduce

  1. Clone from master at time of writing this report
  2. cd gng
  3. sudo ./install.sh
  4. Result:
$ sudo ./install.sh
./install.sh: line 2: $'\r': command not found
Failed to change to script's directory!(./install.sh)
: numeric argument required 1

Expected behavior

It would have been nice if it worked.

Shell Info (please complete the following information):

$ bash --version
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
$ DEBUG=1 ./bin/gng
./bin/gng: line 5: $'\r': command not found
: invalid option6: shopt: -
shopt: usage: shopt [-pqsu] [-o] [optname ...]
: invalid option7: shopt: -
shopt: usage: shopt [-pqsu] [-o] [optname ...]
./bin/gng: line 28: syntax error near unexpected token `$'in\r''
'/bin/gng: line 28: `    case "${k}" in

Additional context

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"

Running WSL on latest Windows 10.

Is this project is still supported?

  1. There are a couple of PRs, some of them were created one year ago, that's why the question arose.
  2. The latest release (not-prerelease) was done in 2021 (here is the request for last release #31)

Feature: provide a Powershell module

Describe the need
Gradle is available on windows 10.
It is difficult to use 'gw' on windows 10.

Proposed Change
Provide the capabilities of the 'gng' bash script:

  • 'gng.psm1' a Powershell module providing
    • 'Invoke-Gradle' : a function which finds 'gradle.bat' and runs it with the specified tasks
    • 'Install-GradleWrapper' : a function which initializes the specified directory with a gradle wrapper
    • 'Get-GradleCert' : a function which runs keytool
  • 'install.ps1' : a script to install from the git repository into a PowerShell module directory
  • 'index-powershell.asciidoc' : documentation for the thing

I have been working on a fork which has these features.
babeloff#1

I am seeking guidance to get the changes incorporated into this upstream project.

Do not require gradlew execution permission when gw/gng is used

Currently, when gw/gng is used in a project with gradle wrapper, it's required for gradew to be executable to run, which is often not executable when created from Windows and pulled on Unix

I think it's an unnecessary limitation, which can be easily avoided by running sh gradlew on Unix-like systems. After all this permission is required only to avoid accidental execution of files from local directory

An alternative solution is changing permission on runtime, but I don't think it's better, it would change file permissions on every gng run

Permissions on install too restrictive

This is on CentOS 7.

I used the installation procedure described in README.md

# Downloading the latest release
 curl -fsSL https://github.com/gdubw/gng/releases/latest/download/gng-installer.sh -o gng-installer.sh
 sudo bash ./gng-installer.sh

This resulted in the /opt/gng directory as well as several symbolic links being created with 700 permissions.
This makes gng protected from normal users.

I did a chmod 755 -R /opt/gng and created an alternative.

sudo alternatives --install /usr/bin/gw gw /opt/gng/bin/gng 1

It now seems to be working correctly.

Deprecation warning about calling bottle

Describe the bug
Using the tap with Homebrew version 3.2.17-63-g5a5a8d5 results in a deprecation warning:

Warning: Calling bottle :unneeded is deprecated! There is no replacement.
Please report this issue to the gdubw/gng tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/gdubw/homebrew-gng/Formula/gng.rb:8

To Reproduce
Steps to reproduce the behavior:

  1. brew update
  2. brew tap gdubw/gng
  3. Run a Homebrew command that checks the available formulas, e.g. brew outdated

Expected behavior
No warning thrown.

Shell Info (please complete the following information):

  • Shell Version: zsh 5.8 (x86_64-apple-darwin19.6.0)
  • DEBUG Output: not applicable

Consider validating project-specific gradle-wrapper.jar

Describe the bug

As far as I understand, gw uses project-specific wrapper.jar which might result in security issues.

To Reproduce
Steps to reproduce the behavior:
1)git clone https://github.com/apache/jmeter.git; cd jmeter
2) gw jar <-- I guess here gng would use project-provided wrapper jar which might result in security issues

Expected behavior

gw should perform wrapper validation before it executes the jar.
For instance, gw might have a set of golden checksums or something like that.

Create gdub rpm package

Currently installing gdub is cumbersome.

PS. Uploading it to some common package repository would also be nice.

Deprecate this tool by a non feature equivalent new one

Seems like @dantesun is taking over this project.
Happy to hear this project is evolving in a way, even if it's for replacing it but I feel the replacement is not as good as the original:

  1. gw are 2 consecutive letters, where gng is longer / not as convenient to enter (on a qwerty keyboard at least)
  2. gng is not available with homebrew (which is the most popular way to install things for OSX users)

Create an alias gw=gng is easy on my side, but it would be sad to lose users because they cannot install the new replacement tool.

Unable to run 'gng'

There's a bug in execute_gradle function:

  # Say what we are gonna do, then do it.
  die "Using gradle at '${gradle}' to run buildfile '${build_gradle}':\n"
  "${gradle}" "$@"

Should be

echo "Using gradle at '${gradle}' to run buildfile '${build_gradle}':\n"

update brew release

Describe the bug

 $ gng wrapper
 Fetching the latest Gradle version from services.gradle.org

/home/linuxbrew/.linuxbrew/bin/gng: line 186: python: command not found
curl: (23) Failed writing body
Failed to fetch the version info!

To Reproduce
This is happening on a new PC (received in Dec 2021) on which I installed Ubuntu 21.10, then homebrew, then followed the instructions from this repo to install the brew cask gng.

Expected behavior
The gradle wrapper in my project should be updated to the latest version.

Screenshots
If applicable, add screenshots to help explain your problem.

Shell Info (please complete the following information):

  • Shell&Version:
$ bash --version
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu)
  • DEBUG Output:
$ DEBUG=1 gng wrapper
++ export SHELLOPTS
++ readonly 'INFO_COLOR=\033[1;96m'
++ INFO_COLOR='\033[1;96m'
++ readonly 'NO_COLOR=\033[0m'
++ NO_COLOR='\033[0m'
++ readonly 'ERROR_COLOR=\033[0;31m'
++ ERROR_COLOR='\033[0;31m'
++ [[ 1 == 1 ]]
++ trap __errorCallBack__ ERR
+ readonly GRADLEW=gradlew
+ GRADLEW=gradlew
+ declare -a __GNG_CONFIG
++ basename /home/linuxbrew/.linuxbrew/bin/gng
+ readonly SCRIPT_NAME=gng
+ SCRIPT_NAME=gng
+ '[' gng = gng ']'
+ case "${1:-}" in
+ shift
+ bootstrap
+ local _arg_version _arg_distribution_type _arg_destination_dir
+ _arg_version=latest
+ _arg_distribution_type=all
+ _arg_destination_dir=/home/edward/github/edward3h/ethelred_util
+ test 0 -gt 0
+ [[ latest == \l\a\t\e\s\t ]]
+ info 'Fetching the latest Gradle version from services.gradle.org'
+ echo -e '\033[1;96m Fetching the latest Gradle version from services.gradle.org\033[0m\n'
Fetching the latest Gradle version from services.gradle.org

++ curl -m 60 -sSL https://services.gradle.org/versions/current
++ python -c 'import json,sys;obj=json.load(sys.stdin);print obj['\''version'\''];'
/home/linuxbrew/.linuxbrew/bin/gng: line 186: python: command not found
curl: (23) Failed writing body
+ _arg_version=
+ die 'Failed to fetch the version info!'
+ local exit_status=127
+ [[ 1 == 0 ]]
++ caller
+ err 'Failed to fetch the version info!' '(185 /home/linuxbrew/.linuxbrew/bin/gng)'
+ echo -e '\033[0;31mFailed to fetch the version info! (185 /home/linuxbrew/.linuxbrew/bin/gng)\033[0m\n'
Failed to fetch the version info! (185 /home/linuxbrew/.linuxbrew/bin/gng)

+ '[' 127 = 0 ']'
+ exit 127

Additional context

Looking at this repo I can see that the problem may have been fixed with #21, but that is not what I'm getting from brew.

Create gdub deb package

Currently installing gdub is cumbersome.

PS. Uploading it to some common package repository would also be nice.

gng resets GRADLE_OPTS environment variable

Describe the bug
gng clears GRADLE_OPTS environment variable.

To Reproduce
Steps to reproduce the behavior:

  1. Create a gradle task to help with observation
    task showEnv(type:Exec) {
        commandLine 'env'
    }
  2. Put something in GRADLE_OPTS, for example, export GRADLE_OPTS='-Dorg.gradle.daemon=false'
  3. Inspect ./gradlew showEnv | grep GRADLE_OPTS
  4. Inspect gw showEnv | grep GRADLE_OPTS

Expected behavior
./gradlew showEnv and gw showEnv should show the same GRADLE_OPTS.

Actual output:

$ ./gradlew showEnv | grep GRADLE_OPTS
GRADLE_OPTS=-Dorg.gradle.daemon=false "-Xdock:name=Gradle" "-Xdock:icon=/Users/me/workspace/my-project/media/gradle.icns"
$ gw showEnv | grep GRADLE_OPTS
sh: SHELLOPTS: readonly variable
GRADLE_OPTS= "-Xdock:name=Gradle" "-Xdock:icon=/Users/me/workspace/my-project/media/gradle.icns"

Shell Info (please complete the following information):

  • zsh 5.3 (x86_64-apple-darwin18.0)

Please remove administrative privileges requirement

From what I understand there is no reason for administrative privileges except for installation into a system directory.
Users who do not want that should be able to install gng into their home directory without administrative privileges.
In some environments, there is no possibility to get admin privileges at all (shared remote Linux accounts, non-rooted android phones, etc.)

Fails when using Jenv for Java version management

I just migrated from gdub to gng and my first attempt to use it caused the following error:

$ gw build
/usr/local/Cellar/jenv/0.5.4/libexec/libexec/jenv-version-file-read: line 17: syntax error near unexpected token `<'
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.10.3/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Unrecognized VM option 'CMSClassUnloadingEnabled'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

To Reproduce
Steps to reproduce the behavior:

  1. brew install jenv
  2. brew install gng
  3. gw build
  4. see error

More Information

I am able to run the java command directly, so I don't think the error is in jenv itself.
I can also run ./gradlew build and it works correctly.
So the problem seems to be in gng/gw.

  • Shell&Version: 3.2.57(1)-release (x86_64-apple-darwin20)
  • DEBUG Output:
$ DEBUG=1 gw build
++ export SHELLOPTS
++ readonly 'INFO_COLOR=\033[1;96m'
++ INFO_COLOR='\033[1;96m'
++ readonly 'NO_COLOR=\033[0m'
++ NO_COLOR='\033[0m'
++ readonly 'ERROR_COLOR=\033[0;31m'
++ ERROR_COLOR='\033[0;31m'
++ [[ 1 == 1 ]]
++ trap __errorCallBack__ ERR
+ readonly GRADLEW=gradlew
+ GRADLEW=gradlew
+ declare -a __GNG_CONFIG
++ basename /usr/local/bin/gw
+ readonly SCRIPT_NAME=gw
+ SCRIPT_NAME=gw
+ '[' gng = gw ']'
+ case "${1:-}" in
+ gradle build
+ local gradle
++ select_gradle /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr
++ local dir=/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr
++ local gradlew
+++ lookup gradlew /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr
+++ local file=gradlew
+++ local curr_path=/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr
+++ [[ -z /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr ]]
+++ [[ /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr == \/ ]]
+++ [[ -e /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew ]]
+++ echo /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew
+++ break
++ gradlew=/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew
++ [[ -z /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew ]]
++ echo /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew
++ return 0
+ gradle=/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew
+ debug 'Using gradle at '\''/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew'\'' to run'
+ [[ 1 == 0 ]]
+ echo -e '\033[1;96mUsing gradle at '\''/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew'\'' to run\033[0m\n'
Using gradle at '/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew' to run

++ dirname /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradlew
+ load_config /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr
+ unset __GNG_CONFIG
+ local curr_path=/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr
+ local cfg_file=/Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradle/gng.cfg
+ '[' -f /Users/USERNAME/Documents/Projects/Production/heimdallr/heimdallr/gradle/gng.cfg ']'
+ readonly __GNG_CONFIG
+ eval 'set +o allexport
set -o braceexpand
set +o emacs
set +o errexit
set +o errtrace
set +o functrace
set -o hashall
set +o histexpand
set +o history
set +o ignoreeof
set -o interactive-comments
set +o keyword
set +o monitor
set +o noclobber
set +o noexec
set +o noglob
set +o nolog
set +o notify
set +o nounset
set +o onecmd
set +o physical
set +o pipefail
set +o posix
set +o privileged
set +o verbose
set +o vi
set +o xtrace
shopt -u cdable_vars
shopt -u cdspell
shopt -u checkhash
shopt -u checkwinsize
shopt -s cmdhist
shopt -u compat31
shopt -u dotglob
shopt -u execfail
shopt -u expand_aliases
shopt -u extdebug
shopt -u extglob
shopt -s extquote
shopt -u failglob
shopt -s force_fignore
shopt -u gnu_errfmt
shopt -u histappend
shopt -u histreedit
shopt -u histverify
shopt -s hostcomplete
shopt -u huponexit
shopt -s interactive_comments
shopt -u lithist
shopt -u login_shell
shopt -u mailwarn
shopt -u no_empty_cmd_completion
shopt -u nocaseglob
shopt -u nocasematch
shopt -u nullglob
shopt -s progcomp
shopt -s promptvars
shopt -u restricted_shell
shopt -u shift_verbose
shopt -s sourcepath
shopt -u xpg_echo'
++ set +o allexport
++ set -o braceexpand
++ set +o emacs
++ set +o errexit
++ set +o errtrace
++ set +o functrace
++ set -o hashall
++ set +o histexpand
++ set +o history
++ set +o ignoreeof
++ set -o interactive-comments
++ set +o keyword
++ set +o monitor
++ set +o noclobber
++ set +o noexec
++ set +o noglob
++ set +o nolog
++ set +o notify
++ set +o nounset
++ set +o onecmd
++ set +o physical
++ set +o pipefail
++ set +o posix
++ set +o privileged
++ set +o verbose
++ set +o vi
++ set +o xtrace
/usr/local/Cellar/jenv/0.5.4/libexec/libexec/jenv-version-file-read: line 17: syntax error near unexpected token `<'
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

Support 'gng init'

gradle init will initialize a new gradle project without build.gradle. But gng init won't work because it will fail if 'build.gradle' is missing.

Support composite builds

When detecting a composite build (settings.gradle is in a different location than build.gradle), the script should use -p option to specify the build location.
In addition, it should special case buildSrc directory. This will make running tasks from buildSrc as simple as cding in buildSrc and running the task via gw <task>

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.