-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkotlinc
71 lines (67 loc) · 1.67 KB
/
kotlinc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
echo "Welcome To Kotlin Complier"
echo "System will Start in 2 Seconds"
sleep 2
echo "Here We Gooooo...."
sleep 0.5
clear
figlet -w 300 Kotlin Compiler
echo -e "\e[32m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo -e " Design and Develop "
echo -e " by "
echo -e " \e[5m \e[91m \e[4m \e[1m Samurai Ghost \e[0m "
echo
echo
echo
echo
cd Source
pwd
ls
echo
read -p "Enter The name of file that you want to compile..> " inputefilename
if [ -e $inputefilename ]
then
if [ "$inputefilename" == "\n" ]
then
echo "You accidently press 'Enter Key'..."
else
echo "$inputefilename Found"
fi
else
echo "File not Found"
read -p "Enter Path to File (Do not include file Name)....>" path
[ -d "$path" ] && echo "Directory $path exists." || echo "Path not found"
echo
echo "Directory Contain..."
cd $path && ls
echo
read -p "Enter name of file...>" inputefilename
if [ -e $inputefilename ]
then
if [ "$inputefilename" == "\n" ]
then
echo "You accidently press 'Enter Key'..."
else
echo "$inputefilename Found"
fi
else
echo "File not Found Provide Exact Path Exiting....."
exit
fi
fi
echo
read -p "Enter output file name..>" outputfilename
echo $outputfilename.jar
kotlinc $inputefilename -include-runtime -d $outputfilename.jar | grep -v 'WARNING'
cd ..
mv Source/$outputfilename.jar Output/
echo
cd Output/ && pwd && ls
echo
echo "If it Compiled well Then Press enter To run the program else ctrl+c"
read fakeenter
echo
echo "Running Program...."
java -jar $outputfilename.jar
cd ..
exit