forked from ESAPI/esapi-java-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetenv-svn.sh
More file actions
executable file
·52 lines (44 loc) · 2.17 KB
/
setenv-svn.sh
File metadata and controls
executable file
·52 lines (44 loc) · 2.17 KB
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
#/bin/bash
# Purpose: Use to set up environment to compile and run examples if ESAPI
# downloaded from the Svn or Git repository.
# Usage: From csh, tcsh:
# $ source ./setenv-svn.sh
# From most other *nix shells:
# $ . ./setenv-svn.sh
#
# where '$' represents the shell command line prompt.
###########################################################################
# IMPORTANT NOTE: Since you may have multiple (say) log4j jars under
# your Maven2 repository under $HOME/.m2/respository, we
# look for the specific versions that ESAPI was using as of
# ESAPI 2.0_RC10 release on 2010/10/18. If these versions
# changed, they will have to be reflected here.
#
esapi_classpath=".:\
../../../target/classes:\
$(ls ../../../target/esapi-*.jar 2>&- || echo .):\
$(./findjar.sh log4j-1.2.17.jar):\
$(./findjar.sh commons-fileupload-1.3.1.jar):\
$(./findjar.sh servlet-api-2.5.jar)"
esapi_resources="$(\cd ../../../configuration/esapi >&- 2>&- && pwd)"
esapi_resources_test="$(\cd ../../../src/test/resources/esapi >&- 2>&- && pwd)"
log4j_properties="../../../src/test/resources/log4j.xml"
if [[ ! -r "$esapi_resources"/ESAPI.properties ]]
then echo 2>&1 "setenv-svn.sh: Can't read ESAPI.properties in $esapi_resources"
return 1 # Don't use 'exit' here or it will kill their current shell.
fi
if [[ ! -r "$esapi_resources_test"/ESAPI.properties ]]
then echo 2>&1 "setenv-svn.sh: Can't read ESAPI.properties in $esapi_resources_test"
return 1 # Don't use 'exit' here or it will kill their current shell.
fi
if [[ ! -r "$log4j_properties" ]]
then echo 2>&1 "setenv-svn.sh: Can't read log4j.xml: $log4j_properties"
return 1 # Don't use 'exit' here or it will kill their current shell.
fi
echo ############################################################
echo "esapi_resources=$esapi_resources"
echo "esapi_resources_test=$esapi_resources_test"
echo "log4j_properties=$log4j_properties"
echo "esapi_classpath=$esapi_classpath"
echo ############################################################
export esapi_classpath esapi_resources esapi_resources_test log4j_properties