-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·70 lines (49 loc) · 2.18 KB
/
build.sh
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
#!/bin/bash
### Copyright 2012-2013 by Garth Johnson as weave.sh
#
# This script will build the alpha_engine for testing
#
#
# you can override the javac path by setting JAVAC_EXEC
#
## Configure debug
if [ "ALL" == "${DEBUG:-false}" ]; then
DEBUG_JAR_ARCHIVE="v"
CURL_SILENT=''
fi
## Default to silent curl
CURL_SILENT=${CURL_SILENT:=-s}
############### Set java compiler location ##################
## If you are using a raspberry pi with the ARM jdk, use the following line
JAVAC_EXEC=${JAVAC_EXEC:-/opt/jdk1.8.0/bin/javac}
## Otherwise, If java is currently in your executable path, we'll find it
if [ ! -x ${JAVAC_EXEC} ]; then
JAVAC_EXEC=$(which javac)
fi
## Make sure javac is here and executable
if [ ! -x ${JAVAC_EXEC} ]; then
echo "Unable to locate java compiler at: ${JAVAC_EXEC}"
exit 1
fi
## Look for the jar tool in the same location as javac
if [ "EMPTY" == "${JAVA_BASE:-EMPTY}" ]; then
JAVA_BASE=${JAVAC_EXEC%$(basename ${JAVAC_EXEC})}
fi
if [ ! -x ${JAVA_BASE}/jar ]; then
echo "Unable to locate java archive tool at: ${JAVA_BASE}jar"
fi
############### Install a network plugin ##################
# We need to include at least one grid processor feed to do any actual work.
# The following will download and install the library from PluraProcessing
# This will result in two directories being created (./com and ./META-INFO)
# containing the modules we need to do attach to plura's networ feed
curl ${CURL_SILENT} http://www.pluraprocessing.com/developer/downloads/plura-affiliate-app-connector.jar |${JAVA_BASE}jar -x${DEBUG_JAR_ARCHIVE}
# Please make sure you have read and understand the network's terms of use, available here:
# http://pluraprocessing.com/affiliatetou.pdf
echo "You will need to enter 'touch README-PluraProcessing.pdf.accept' to accept Plura's Terms of Use"
curl ${CURL_SILENT} http://pluraprocessing.com/affiliatetou.pdf > README-PluraProcessing.pdf
############### Build test client ##################
# Now we will attempt to compile the provided example code
# " -d ." will cause the compiled class to be installed properly as sh/weave/alpha_engine.class
echo "Compiling, this will take a moment..."
${JAVAC_EXEC} -d . src/alpha_engine.java