gdubw / gng Goto Github PK
View Code? Open in Web Editor NEWGNG is Not Gradle
Home Page: https://gng.dsun.org
License: Apache License 2.0
GNG is Not Gradle
Home Page: https://gng.dsun.org
License: Apache License 2.0
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
Describe the bug
I tried the install instructions but get an error running the script after cloning the repo from master.
To Reproduce
cd gng
sudo ./install.sh
$ 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.
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:
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.
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
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.
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:
brew update
brew tap gdubw/gng
brew outdated
Expected behavior
No warning thrown.
Shell Info (please complete the following information):
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.
Currently installing gdub is cumbersome.
PS. Uploading it to some common package repository would also be nice.
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:
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.
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"
This would work similar to the way you setup homebrew on OSX (and some other cool software).
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):
$ bash --version
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu)
$ 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.
This script is pretty simple, but that doesn't mean it shouldn't have unit tests!
visit https://github.com/dodie/testing-in-bash for more testing frameworks
Currently installing gdub is cumbersome.
PS. Uploading it to some common package repository would also be nice.
Describe the bug
gng
clears GRADLE_OPTS
environment variable.
To Reproduce
Steps to reproduce the behavior:
task showEnv(type:Exec) {
commandLine 'env'
}
GRADLE_OPTS
, for example, export GRADLE_OPTS='-Dorg.gradle.daemon=false'
./gradlew showEnv | grep GRADLE_OPTS
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):
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.)
Describe the bug
In fact, it is a feature request, however, there is no that template :).
Using gng wrapper
it would be good to have also distributionSha256Sum
field added to gradle.properties. The proper value can be obtained from https://gradle.org/release-checksums/ .
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:
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.
$ 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.
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.
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 cd
ing in buildSrc
and running the task via gw <task>
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.