1+ $env: JAVA_HOME = " C:\Program Files\Java\jdk1.8.0"
2+ $env: PATH = " $ ( $env: JAVA_HOME ) \bin;$ ( $env: PATH ) "
3+ $env: CCM_PATH = " C:\Users\appveyor\ccm"
4+ $env: CASSANDRA_VERSION = $env: cassandra_version
5+ python -- version
6+ python - c " import platform; print(platform.architecture())"
7+ # Install Ant
8+ Start-Process cinst - ArgumentList @ (" -y" , " ant" ) - Wait - NoNewWindow
9+ # Workaround for ccm, link ant.exe -> ant.bat
10+ If (! (Test-Path C:\ProgramData\chocolatey\bin\ant.bat )) {
11+ cmd / c mklink C:\ProgramData\chocolatey\bin\ant.bat C:\ProgramData\chocolatey\bin\ant.exe
12+ }
13+
14+
15+ $jce_indicator = " $target \README.txt"
16+ # Install Java Cryptographic Extensions, needed for SSL.
17+ If (! (Test-Path $jce_indicator )) {
18+ $zip = " C:\Users\appveyor\jce_policy-$ ( $env: java_version ) .zip"
19+ $target = " $ ( $env: JAVA_HOME ) \jre\lib\security"
20+ # If this file doesn't exist we know JCE hasn't been installed.
21+ $url = " https://www.dropbox.com/s/po4308hlwulpvep/UnlimitedJCEPolicyJDK7.zip?dl=1"
22+ $extract_folder = " UnlimitedJCEPolicy"
23+ If ($env: java_version -eq " 1.8.0" ) {
24+ $url = " https://www.dropbox.com/s/al1e6e92cjdv7m7/jce_policy-8.zip?dl=1"
25+ $extract_folder = " UnlimitedJCEPolicyJDK8"
26+ }
27+ # Download zip to staging area if it doesn't exist, we do this because
28+ # we extract it to the directory based on the platform and we want to cache
29+ # this file so it can apply to all platforms.
30+ if (! (Test-Path $zip )) {
31+ (new-object System.Net.WebClient).DownloadFile($url , $zip )
32+ }
33+
34+ Add-Type - AssemblyName System.IO.Compression.FileSystem
35+ [System.IO.Compression.ZipFile ]::ExtractToDirectory($zip , $target )
36+
37+ $jcePolicyDir = " $target \$extract_folder "
38+ Move-Item $jcePolicyDir \* $target \ - force
39+ Remove-Item $jcePolicyDir
40+ }
41+
42+ # Install Python Dependencies for CCM.
43+ Start-Process python - ArgumentList " -m pip install psutil pyYaml six numpy" - Wait - NoNewWindow
44+
45+ # Clone ccm from git and use master.
46+ If (! (Test-Path $env: CCM_PATH )) {
47+ Start-Process git - ArgumentList " clone https://github.com/pcmanus/ccm.git $ ( $env: CCM_PATH ) " - Wait - NoNewWindow
48+ }
49+
50+
51+ # Copy ccm -> ccm.py so windows knows to run it.
52+ If (! (Test-Path $env: CCM_PATH \ccm.py)) {
53+ Copy-Item " $env: CCM_PATH \ccm" " $env: CCM_PATH \ccm.py"
54+ }
55+
56+ $env: PYTHONPATH = " $ ( $env: CCM_PATH ) ;$ ( $env: PYTHONPATH ) "
57+ $env: PATH = " $ ( $env: CCM_PATH ) ;$ ( $env: PATH ) "
58+
59+ # Predownload cassandra version for CCM if it isn't already downloaded.
60+ If (! (Test-Path C:\Users\appveyor\.ccm\repository\$env: cassandra_version )) {
61+ Start-Process python - ArgumentList " $ ( $env: CCM_PATH ) \ccm.py create -v $ ( $env: cassandra_version ) -n 1 predownload" - Wait - NoNewWindow
62+ Start-Process python - ArgumentList " $ ( $env: CCM_PATH ) \ccm.py remove predownload" - Wait - NoNewWindow
63+ }
64+
65+ Start-Process python - ArgumentList " -m pip install -r test-requirements.txt" - Wait - NoNewWindow
66+ Start-Process python - ArgumentList " -m pip install nose-ignore-docstring" - Wait - NoNewWindow
0 commit comments