Browse Source

Merge branch 'windows'

Conflicts:
	revel/setup.py
Rob Figueiredo 12 years ago
parent
commit
66c1a15a89
2 changed files with 24 additions and 0 deletions
  1. 13 0
      installer.ps1
  2. 11 0
      revel/setup.py

+ 13 - 0
installer.ps1

@@ -195,4 +195,17 @@ $env:Path += ";$maven_dir\bin"; [Environment]::SetEnvironmentVariable("Path", $e
 Write-Host "Configuring firewall...`n"
 New-NetFirewallRule -DisplayName "HTTP 8080" -Action Allow -Direction Inbound -LocalPort 8080 -Protocol TCP | Out-Null
 
+#
+# Mercurial
+#
+Write-Host "Installing Mercurial...`n"
+
+$hg_installer_file = "mercurial-2.6.1-x64.msi"
+$hg_installer_url = "https://bitbucket.org/tortoisehg/files/downloads/$hg_installer_file"
+$hg_installer_local = "$workdir\$hg_installer_file"
+(New-Object System.Net.WebClient).DownloadFile($hg_installer_url, $hg_installer_local)
+
+Start-Process $hg_installer_local '/passive' -Wait
+$env:Path += ";C:\Program Files\Mercurial"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
+
 cd $basedir

+ 11 - 0
revel/setup.py

@@ -6,12 +6,23 @@ import time
 
 def start(args):
   setup_util.replace_text("revel/src/benchmark/conf/app.conf", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
+  if os.name == 'nt':
+    env = os.environ.copy()
+    env["GOPATH"] = r"C:\FrameworkBenchmarks\revel"
+    subprocess.call("go get -u github.com/robfig/revel/revel", shell=True, cwd="revel", env=env)
+    subprocess.call(r"go build -o bin\revel.exe github.com/robfig/revel/revel", shell=True, cwd="revel", env=env)
+    subprocess.Popen(r"bin\revel.exe run benchmark prod".rsplit(" "), shell=True, cwd="revel", env=env)
+    return 0
   subprocess.call("go get -u github.com/robfig/revel/revel", shell=True, cwd="revel")
   subprocess.call("go build -o bin/revel github.com/robfig/revel/revel", shell=True, cwd="revel")
   subprocess.Popen("bin/revel run benchmark prod".rsplit(" "), cwd="revel")
   return 0
 
 def stop():
+  if os.name == 'nt':
+    subprocess.call("taskkill /f /im benchmark.exe > NUL", shell=True)
+    subprocess.call("taskkill /f /im revel.exe > NUL", shell=True)
+    return 0
   p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
   out, err = p.communicate()
   for line in out.splitlines():