GithubHelp home page GithubHelp logo

scrappers-glitch / clijavaapplicationexample Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 97 KB

CLI Java Application project example using both gradle CLI & github CLI tools w/o IDEs.

Java 100.00%
gradle java cli text-editors

clijavaapplicationexample's Introduction

CLiJavaApplicationExample

Welcome to the Java Application Training Plugin Example, using only github CLI gh tool, and gradle CLI :

Steps to install both gradle CLI & github CLI :

gradle build tool

1-Type sdk install gradle 6.8.3 if you are on UNIX based system
2-Type gradle -v command to check the version

github CLI (gh tool)

1-install git cores first : - >sudo apt-get update - >sudo apt-get install git-all - >git version
2-then install gitCLI, using snap install gh if you have snap-store
3-Type gh --version to check it

eg :

┌─[twisted@parrot]─[~/GradleProjects/training1/lib/build/libs]
└──╼ $gradle -v

------------------------------------------------------------
Gradle 6.7
------------------------------------------------------------

Build time:   2020-10-14 16:13:12 UTC
Revision:     312ba9e0f4f8a02d01854d1ed743b79ed996dfd3

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          11.0.7-ea (Debian 11.0.7-ea+9-post-Debian-1)
OS:           Linux 5.5.0-1parrot1-amd64 amd64

┌─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $git version
git version 2.26.2

┌─[twisted@parrot]─[~/GradleProjects/training1/lib/build/libs]
└──╼ $gh --version
gh version 1.8.1-15-g9a9bad90 (2021-04-03)
https://github.com/cli/cli/releases/latest

------------------------------------------------------------------------------------------------------------

Steps to the workflow :

Creating the Java App Using Gradle :

1-Generate a Java Application Sourcesets & buildScripts using gradle CLI using gradle init command in the project folder
2-Configure a manifest block inside the build.gradle to accept building jar files with the main.java class in mind
3-Compile & build files using build.gradle
4-Run the raw java main class using ./gradlew run
5-Building a jar file for the SourceSets using gradle jar command or to zip files using gradle assemble
6-Find the java jar build inside applicationExample/app/build/libs/app.jar & run it using java -jar app.jar to be sure of your results

Creating the git repo & pushing files :

1-run git init command in your root project directory, to initiliaze git local for this repo
2-run git add . command to add the current directory to the local it files inside .git folder in your root directory
3-run git commit -m "Commit Message" to do commit the current files to the master branch
4-run gh repo create REPO-NAME to create a new empty git repository with the specified name
5-run git checkout -b main to switch from the branch(-b) to a new branch named main (it will create it anyway)
6-run git push origin main to push your code to the main origin branch

eg :

┌─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $git init
Initialized empty Git repository in /home/twisted/GradleProjects/applicationExample/.git/
┌─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $git add
Nothing specified, nothing added.
hint: Maybe you wanted to say 'git add .'?
hint: Turn this message off by running
hint: "git config advice.addEmptyPathspec false"
┌─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $git add.
git: 'add.' is not a git command. See 'git --help'.

The most similar command is
	add
┌─[✗]─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $git add .
┌─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $git commit -m "Initial Commit"
[master (root-commit) a755c89] Initial Commit
 10 files changed, 364 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 .gitignore
 create mode 100644 app/build.gradle
 create mode 100644 app/src/main/java/javaApp/App.java
 create mode 100644 app/src/test/java/javaApp/AppTest.java
 create mode 100644 gradle/wrapper/gradle-wrapper.jar
 create mode 100644 gradle/wrapper/gradle-wrapper.properties
 create mode 100755 gradlew
 create mode 100644 gradlew.bat
 create mode 100644 settings.gradle
┌─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $gh repo create CLiJavaApplicationExample
? Visibility Public
? This will add an "origin" git remote to your local repository. Continue? Yes
✓ Created repository Scrappers-glitch/CLiJavaApplicationExample on GitHub
fatal: Unable to find remote helper for 'https'
error: Could not fetch origin
/snap/gh/345/usr/bin/git: exit status 1
┌─[✗]─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $git checkout -b main
Switched to a new branch 'main'
┌─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $git push origin main
Username for 'https://github.com': [email protected]
Password for 'https://[email protected]@github.com': 
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 4 threads
Compressing objects: 100% (15/15), done.
Writing objects: 100% (22/22), 57.63 KiB | 2.74 MiB/s, done.
Total 22 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/Scrappers-glitch/CLiJavaApplicationExample.git
 * [new branch]      main -> main
┌─[twisted@parrot]─[~/GradleProjects/applicationExample]
└──╼ $

$ Ref :

https://gradle.org/install/

clijavaapplicationexample's People

Contributors

scrappers-glitch avatar

Stargazers

 avatar

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.