Skip to content

Commit

Permalink
Download junit 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-from-spb committed Sep 10, 2011
1 parent f6e2d84 commit 0589214
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .hgignore
@@ -1,7 +1,7 @@
syntax: glob

out
lib/**/*
lib/*.jar
**/.svn
.idea/workspace.*
.idea/uiDesigner.*
Expand Down
2 changes: 1 addition & 1 deletion .idea/libraries/junit.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions lib/files.txt
@@ -1,16 +1,10 @@
Files that should be placed into this directory:

teamcity:
junit-4.8.2.jar

README.txt
common-api.jar
server-api.jar
agent-api.jar
runtime/runtime-util.jar
runtime/serviceMessages.jar
src/openApi-source.jar
src/serviceMessages-src.jar
javadoc/openApi-help.jar

Buildserver download URL:
http://buildserver/guestAuth/repository/download/bt457/latest.lastPinned/devPackage/<file>
In order to download them, run the following command

python scripts/getlibs.py

being in the checkout directory.
50 changes: 25 additions & 25 deletions scripts/getlibs.py
@@ -1,47 +1,47 @@
import os
import urllib.request

TeamCityLibPath = "lib/teamcity"

TeamCityLibDirectories = [ "runtime", "src", "javadoc" ]
Libs = \
{
"junit-4.8.2.jar" : "https://github.com/downloads/KentBeck/junit/junit-4.8.2.jar"
}

TeamCityLibFiles = [ "README.txt",
"common-api.jar",
"server-api.jar",
"agent-api.jar",
"runtime/runtime-util.jar",
"runtime/serviceMessages.jar",
"src/openApi-source.jar",
"src/serviceMessages-src.jar",
"javadoc/openApi-help.jar" ]
LibDir = "./lib"


def Main():

print("Downloading TeamCity libraries\n")
def Main():

ensureDir(TeamCityLibPath)
for dname in TeamCityLibDirectories:
ensureDir(TeamCityLibPath + '/' + dname)
print("Downloading libraries\n")

for fname in TeamCityLibFiles:
processOneLibFile(fname)
ensureDir(LibDir)
for lib in Libs.items():
processOneLibFile(lib)

print("Ok.")


def processOneLibFile(name):
def processOneLibFile(lib):

(name, url) = lib

print("\t" + name)
content = downloadTeamCityLibFile(name)
## print(name + " - downloaded.")
writeBinFile(TeamCityLibPath + '/' + name, content)
## print(name + " - writed.")

fileName = LibDir + '/' + name
if os.path.exists(fileName):
existentSize = os.path.getsize(fileName)
print("\t\tskipped; current file size is %d bytes" % existentSize)
return

content = downloadTeamCityLibFile(url)
writeBinFile(fileName, content)
resultSize = os.path.getsize(fileName)
print("\t\tdownloaded %d bytes" % resultSize)


def downloadTeamCityLibFile(name):
def downloadTeamCityLibFile(url):

url = r"http://buildserver/guestAuth/repository/download/bt457/latest.lastPinned/devPackage/" + name
response = urllib.request.urlopen(url)
content = response.read()
return content
Expand Down

0 comments on commit 0589214

Please sign in to comment.