Skip to content

Commit

Permalink
devonfw#849: documentation and other changes according to DoD
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedagdmoun committed Aug 25, 2022
1 parent 78d5207 commit 23d98ab
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 14 deletions.
1 change: 1 addition & 0 deletions documentation/LICENSE.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The following table shows the components that may be used. The column `inclusion
|https://aws.amazon.com/cli/[AWS cli] |Optional|https://github.com/aws/aws-cli/blob/develop/LICENSE.txt[ASL 2.0]
|https://dotnet.microsoft.com/[Dotnet] |https://github.com/dotnet/core/blob/master/LICENSE.TXT[MIT] (https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx[Terms])
|https://github.com/openshift/oc[OpenShiftCLI]|Optional|https://github.com/openshift/oc/blob/master/LICENSE[ASL 2.0]
|https://github.com/chewiebug/gcviewer[GCViewer]|Optional|https://github.com/chewiebug/GCViewer/blob/develop/LICENSE.txt[ASL 2.0]
|=======================

== Apache Software License - Version 2.0
Expand Down
1 change: 1 addition & 0 deletions documentation/cli.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The following commandlets are currently available:
* link:docker.asciidoc[docker]
* link:dotnet.asciidoc[dotnet]
* link:eclipse.asciidoc[eclipse]
* link:gcviewer.asciidoc[gcviewer]
* link:graalvm.asciidoc[graalvm]
* link:gradle.asciidoc[gradle]
* link:helm.asciidoc[helm]
Expand Down
2 changes: 2 additions & 0 deletions documentation/devonfw-ide-usage.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ include::dotnet.asciidoc[leveloffset=3]

include::eclipse.asciidoc[leveloffset=3]

include::gcviewer.asciidoc[leveloffset=3]

include::graalvm.asciidoc[leveloffset=3]

include::gradle.asciidoc[leveloffset=3]
Expand Down
28 changes: 28 additions & 0 deletions documentation/gcviewer.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
:toc:
toc::[]

= GCViewer

The gcviewer commandlet is used to install the GCViewer App if not already installed or launch the App if already installed.
GCViewer is a little tool that visualizes verbose GC (Garbage Collection) output generated by Java Virtual Machines.
To learn more about GC Loggings please refer to https://sematext.com/blog/java-garbage-collection-logs/ or https://www.baeldung.com/java-gc-logging-to-file.

*ATTENTION:*
Currently this feature is new and therefore experimental.
It may change in incompatible ways in the next releases until we reach a stable state.
We hope that all is working fine for you.
However, do not expect everything to work out of the box.
In case you are facing issues (e.g. network problems with Cisco AnyConnect, etc.) please give us feedback so we can improve.


The arguments (`devon oc «args»`) are explained in the following table:

.Usage of `devon gcviewer`
[options="header"]
|=======================
|*Argument(s)* |*Meaning*
|`setup` |install the latest version of GCViewer on your machine.
|`setup <version>`|install the specified version of GCViewer on your machine.
|`start` |launch the GCViewer App.
|`«args»` |call gcviewer with the specified arguments."
|=======================
1 change: 1 addition & 0 deletions documentation/scripts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This directory is the heart of the `devonfw-ide` and contains the required link:
│ ├── link:docker.asciidoc[docker]
│ ├── link:dotnet.asciidoc[dotnet]
│ ├── link:eclipse.asciidoc[eclipse]
│ ├── link:gcviewer.asciidoc[gcviewer]
│ ├── link:graalvm.asciidoc[graalvm]
│ ├── link:gradle.asciidoc[gradle]
| ├── link:helm.asciidoc[helm]
Expand Down
40 changes: 26 additions & 14 deletions scripts/src/main/resources/scripts/command/gcviewer
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,28 @@ if [ -n "${DEVON_IDE_TRACE}" ]; then set -vx; fi
# shellcheck source=scripts/functions
source "$(dirname "${0}")"/../functions

doEcho "Checking if the latest realease of GCViewer is installed..."
LATEST_VERSION=$(curl "https://github.com/chewiebug/GCViewer/tags" | awk -F "/tag/" '/GCViewer/ {print $2}' | sort -r | head -1 | awk -F "\">" '{print $1}')

GCVIEWER_HOME="${DEVON_IDE_HOME}/software/gcviewer/${LATEST_VERSION}/"
GCVIEWER_HOME="${DEVON_IDE_HOME}/software/gcviewer/"

# gcviewer installation
function doSetup(){

doDownload "-" "${GCVIEWER_HOME}" "gcviewer" "${LATEST_VERSION}"
local GCVIEWER_VERSION="${1}"

if [ ! -z "${GCVIEWER_VERSION}" ]
then
doEcho "Getting GCviewer in version ${GCVIEWER_VERSION}..."
doDownload "-" "${GCVIEWER_HOME}" "gcviewer" "${GCVIEWER_VERSION}"
else
doEcho "Getting the latest release of GCViewer..."
GCVIEWER_VERSION=$(curl "https://github.com/chewiebug/GCViewer/tags" | awk -F "/tag/" '/GCViewer/ {print $2}' | sort -r | head -1 | awk -F "\">" '{print $1}')
doDownload "-" "${GCVIEWER_HOME}" "gcviewer" "${GCVIEWER_VERSION}"
fi

if doIsMacOs
then
cd ${GCVIEWER_HOME}
doRunCommand "unzip ${GCVIEWER_HOME}gcviewer-${LATEST_VERSION}-mac.zip"
rm -r GCViewer.app
doRunCommand "unzip ${GCVIEWER_HOME}gcviewer-${GCVIEWER_VERSION}-mac.zip"
fi

doSuccess "GCViewer has been installed successfully!"
Expand All @@ -37,38 +45,41 @@ function doStart(){

if doIsWindows
then
if [ ! -d "${GCVIEWER_HOME}" ] || [ ! -f "${GCVIEWER_HOME}/gcviewer-${LATEST_VERSION}-windows.jar" ]
if [ ! -d "${GCVIEWER_HOME}" ] || [ compgen -G "${GCVIEWER_HOME}/gcviewer*.jar" > /dev/null! ]
then
doSetup
else
doEcho "Checking if Java is installed..."
doDevonCommand "java"
cd ${GCVIEWER_HOME}
doEcho "Starting GCViewer..."
doRunCommand "java -jar gcviewer-${LATEST_VERSION}-windows.jar&"
local gcviewer_jar_file=$(ls -t | head -1)
doRunCommand "java -jar ${gcviewer_jar_file}&"
fi
elif doIsMacOs
then
if [ ! -d "${GCVIEWER_HOME}" ] || [ ! -f "${GCVIEWER_HOME}GCViewer.app/Contents/Java/gcviewer-${LATEST_VERSION}.jar" ]
if [ ! -d "${GCVIEWER_HOME}" ] || [ compgen -G "${GCVIEWER_HOME}GCViewer.app/Contents/Java/gcviewer*.jar" > /dev/null! ]
then
doSetup
else
doEcho "Checking if Java is installed..."
doDevonCommand "java"
cd ${GCVIEWER_HOME}GCViewer.app/Contents/Java/
doEcho "Starting GCViewer..."
doRunCommand "java -jar gcviewer-${LATEST_VERSION}.jar&"
local gcviewer_jar_file=$(ls -t | head -1)
doRunCommand "java -jar ${gcviewer_jar_file}&"
fi
else
if [ ! -d "${GCVIEWER_HOME}" ] || [ ! -f "${GCVIEWER_HOME}gcviewer-${LATEST_VERSION}-linux-gnu.jar" ]
if [ ! -d "${GCVIEWER_HOME}" ] || [ compgen -G "${GCVIEWER_HOME}gcviewer*.jar" > /dev/null! ]
then
doSetup
else
doEcho "Checking if Java is installed..."
doDevonCommand "java"
cd ${GCVIEWER_HOME}
doEcho "Starting GCViewer..."
doRunCommand "java -jar gcviewer-${LATEST_VERSION}-linux-gnu.jar&"
local gcviewer_jar_file=$(ls -t | head -1)
doRunCommand "java -jar ${gcviewer_jar_file}&"
fi
fi

Expand All @@ -81,12 +92,13 @@ case ${1} in
echo "Setup or run gcviewer"
echo
echo "Arguments:"
echo " setup setup gcviewer on your machine."
echo " setup setup the latest version gcviewer on your machine."
echo " setup <version> setup the gcviewer specified version on your machine."
echo " start start gcviewer UI."
echo
;;
"setup" | "s")
doSetup
doSetup ${2}
;;
"start" | "")
doStart
Expand Down

0 comments on commit 23d98ab

Please sign in to comment.