Skip to content

Commit 119fe65

Browse files
committed
Project(Builder): Use Gradle and proguard
- Update Gitignore
1 parent 7134665 commit 119fe65

File tree

9 files changed

+236
-0
lines changed

9 files changed

+236
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
*.class
22
*.log
3+
4+
/build/
5+
/.gradle/

build.gradle

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
apply plugin: 'scala'
2+
apply plugin: 'com.github.johnrengelman.shadow'
3+
4+
buildscript {
5+
repositories {
6+
flatDir dirs: System.getProperty("user.home") + '/bin/proguard6.0.3/lib/'
7+
jcenter()
8+
}
9+
10+
dependencies {
11+
classpath ':proguard'
12+
classpath 'com.github.jengelman.gradle.plugins:shadow:5.+'
13+
}
14+
}
15+
16+
ext.mainClassName = rootProject.name
17+
ext.version = '1.1'
18+
ext.jarName = "${name}-bin"
19+
20+
allprojects {
21+
repositories {
22+
jcenter()
23+
}
24+
}
25+
26+
jar {
27+
manifest{
28+
attributes 'Main-Class': mainClassName
29+
}
30+
}
31+
32+
shadowJar {
33+
baseName = rootProject.name
34+
classifier = 'bin'
35+
version = version
36+
}
37+
38+
dependencies {
39+
implementation "org.scala-lang:scala-library:2.11.+"
40+
testImplementation "org.scalatest:scalatest_2.11:3.+"
41+
}
42+
43+
task proguard(type: proguard.gradle.ProGuardTask) {
44+
injars "./build/libs/${jarName}.jar"
45+
outjars "./build/libs/${jarName}-mini.jar"
46+
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
47+
48+
dontwarn
49+
dontnote
50+
ignorewarnings
51+
52+
keepattributes 'SourceFile,LineNumberTable'
53+
54+
keepclasseswithmembers 'public class * { \
55+
public static void main(java.lang.String[]); \
56+
}'
57+
}

gradle/wrapper/gradle-wrapper.jar

54.9 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

gw.sh

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
#!/usr/bin/env sh
2+
3+
##############################################################################
4+
##
5+
## Gradle start up script for UN*X
6+
##
7+
##############################################################################
8+
9+
# Attempt to set APP_HOME
10+
# Resolve links: $0 may be a link
11+
PRG="$0"
12+
# Need this for relative symlinks.
13+
while [ -h "$PRG" ] ; do
14+
ls=`ls -ld "$PRG"`
15+
link=`expr "$ls" : '.*-> \(.*\)$'`
16+
if expr "$link" : '/.*' > /dev/null; then
17+
PRG="$link"
18+
else
19+
PRG=`dirname "$PRG"`"/$link"
20+
fi
21+
done
22+
SAVED="`pwd`"
23+
cd "`dirname \"$PRG\"`/" >/dev/null
24+
APP_HOME="`pwd -P`"
25+
cd "$SAVED" >/dev/null
26+
27+
APP_NAME="Gradle"
28+
APP_BASE_NAME=`basename "$0"`
29+
30+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31+
DEFAULT_JVM_OPTS="-server -d64"
32+
33+
# Use the maximum available, or set MAX_FD != -1 to use that value.
34+
MAX_FD="maximum"
35+
36+
warn () {
37+
echo "$*"
38+
}
39+
40+
die () {
41+
echo
42+
echo "$*"
43+
echo
44+
exit 1
45+
}
46+
47+
# OS specific support (must be 'true' or 'false').
48+
cygwin=false
49+
msys=false
50+
darwin=false
51+
nonstop=false
52+
case "`uname`" in
53+
CYGWIN* )
54+
cygwin=true
55+
;;
56+
Darwin* )
57+
darwin=true
58+
;;
59+
MINGW* )
60+
msys=true
61+
;;
62+
NONSTOP* )
63+
nonstop=true
64+
;;
65+
esac
66+
67+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68+
69+
# Determine the Java command to use to start the JVM.
70+
if [ -n "$JAVA_HOME" ] ; then
71+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72+
# IBM's JDK on AIX uses strange locations for the executables
73+
JAVACMD="$JAVA_HOME/jre/sh/java"
74+
else
75+
JAVACMD="$JAVA_HOME/bin/java"
76+
fi
77+
if [ ! -x "$JAVACMD" ] ; then
78+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79+
Please set the JAVA_HOME variable in your environment to match the
80+
location of your Java installation."
81+
fi
82+
else
83+
JAVACMD="java"
84+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
85+
Please set the JAVA_HOME variable in your environment to match the
86+
location of your Java installation."
87+
fi
88+
89+
# Increase the maximum file descriptors if we can.
90+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
91+
MAX_FD_LIMIT=`ulimit -H -n`
92+
if [ $? -eq 0 ] ; then
93+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
94+
MAX_FD="$MAX_FD_LIMIT"
95+
fi
96+
ulimit -n $MAX_FD
97+
if [ $? -ne 0 ] ; then
98+
warn "Could not set maximum file descriptor limit: $MAX_FD"
99+
fi
100+
else
101+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
102+
fi
103+
fi
104+
105+
# For Darwin, add options to specify how the application appears in the dock
106+
if $darwin; then
107+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
108+
fi
109+
110+
# For Cygwin, switch paths to Windows format before running java
111+
if $cygwin ; then
112+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
113+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
114+
JAVACMD=`cygpath --unix "$JAVACMD"`
115+
116+
# We build the pattern for arguments to be converted via cygpath
117+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
118+
SEP=""
119+
for dir in $ROOTDIRSRAW ; do
120+
ROOTDIRS="$ROOTDIRS$SEP$dir"
121+
SEP="|"
122+
done
123+
OURCYGPATTERN="(^($ROOTDIRS))"
124+
# Add a user-defined pattern to the cygpath arguments
125+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
126+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
127+
fi
128+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
129+
i=0
130+
for arg in "$@" ; do
131+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
132+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
133+
134+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
135+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
136+
else
137+
eval `echo args$i`="\"$arg\""
138+
fi
139+
i=$((i+1))
140+
done
141+
case $i in
142+
(0) set -- ;;
143+
(1) set -- "$args0" ;;
144+
(2) set -- "$args0" "$args1" ;;
145+
(3) set -- "$args0" "$args1" "$args2" ;;
146+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
147+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
148+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
149+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
150+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
151+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
152+
esac
153+
fi
154+
155+
# Escape application args
156+
save () {
157+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
158+
echo " "
159+
}
160+
APP_ARGS=$(save "$@")
161+
162+
# Collect all arguments for the java command, following the shell quoting and substitution rules
163+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
164+
165+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
166+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
167+
cd "$(dirname "$0")"
168+
fi
169+
170+
exec "$JAVACMD" "$@"

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'WowCoolApk'

src/test/scala/HelperTests.scala

Whitespace-only changes.

src/test/scala/TokenTest.scala

Whitespace-only changes.

0 commit comments

Comments
 (0)