Custom dynamic variable generation script
This commit is contained in:
parent
4d6310600b
commit
4d5bf40aff
16
README.md
16
README.md
@ -2,14 +2,14 @@ This repository contains general build scripts and pipelines for all languages t
|
|||||||
```bash
|
```bash
|
||||||
#Short description about what I do
|
#Short description about what I do
|
||||||
#Language[Folder]
|
#Language[Folder]
|
||||||
/* The script's code goes in here.
|
# #The script's code goes in here.
|
||||||
rm -Rf out/*
|
# rm -Rf out/*
|
||||||
javac -Xlint:unchecked -cp ${PROJECT_DIR}/.. -d ${OUT_DIR} ${PROJECT_DIR}/*.java
|
# javac -Xlint:unchecked -cp ${PROJECT_DIR}/.. -d ${OUT_DIR} ${PROJECT_DIR}/*.java
|
||||||
printf "\n\n\nRunning Program...\n\n"
|
# printf "\n\n\nRunning Program...\n\n"
|
||||||
cd $OUT_DIR
|
# cd $OUT_DIR
|
||||||
java ${MAIN_CLASS} "$@"
|
# java ${MAIN_CLASS} "$@"
|
||||||
../scripts/clean.sh
|
# ../scripts/clean.sh
|
||||||
*/
|
|
||||||
```
|
```
|
||||||
Each language will be in the following structure:
|
Each language will be in the following structure:
|
||||||
```
|
```
|
||||||
|
6
scripts/commit.sh
Executable file
6
scripts/commit.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#Adds a commit message and pushes project to github repository.
|
||||||
|
#
|
||||||
|
git add -u
|
||||||
|
git add *
|
||||||
|
git commit -m "$*"
|
||||||
|
git push
|
17
sig
17
sig
@ -1,8 +1,9 @@
|
|||||||
export PROJECT_NAME="JavaProjectTemplate"
|
source utils/define.sh
|
||||||
export PROJECT_DIR="src/sig"
|
|
||||||
export MAIN_CLASS="sig.${PROJECT_NAME}"
|
|
||||||
export OUT_DIR="bin"
|
|
||||||
|
|
||||||
|
define PROJECT_NAME "JavaProjectTemplate"
|
||||||
|
define PROJECT_DIR "src/sig"
|
||||||
|
define MAIN_CLASS "sig.${PROJECT_NAME}"
|
||||||
|
define OUT_DIR "bin"
|
||||||
|
|
||||||
if [ -z "$1" ]
|
if [ -z "$1" ]
|
||||||
then
|
then
|
||||||
@ -11,10 +12,10 @@ if [ -z "$1" ]
|
|||||||
echo ""
|
echo ""
|
||||||
printf "====\tCurrent Configuration"
|
printf "====\tCurrent Configuration"
|
||||||
printf "\t====================="
|
printf "\t====================="
|
||||||
printf "\n\t%-15s%20s" PROJECT_NAME ${PROJECT_NAME}
|
for t in ${VARS[@]}
|
||||||
printf "\n\t%-15s%20s" PROJECT_DIR ${PROJECT_DIR}
|
do
|
||||||
printf "\n\t%-15s%20s" MAIN_CLASS ${MAIN_CLASS}
|
printf "\n\t%-15s%20s" $t ${!t}
|
||||||
printf "\n\t%-15s%20s" OUT_DIR ${OUT_DIR}
|
done
|
||||||
printf "\n====================================================="
|
printf "\n====================================================="
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
|
7
utils/define.sh
Executable file
7
utils/define.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
export VARS=("")
|
||||||
|
|
||||||
|
function define() {
|
||||||
|
VARS+=("$1")
|
||||||
|
value="${*:2}"
|
||||||
|
eval "$1"='$value'
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user