1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-08-16 03:10:09 +02:00

Merge branch 'full-bsd-osx-port' into 'master'

Full BSD/OSX port

This finishes up the OSX port by getting the full test suite running on OSX.  It also sets up an OSX CI job travis-ci.org, run as part of the github mirror here: https://github.com/f-droid/fdroidserver  You can see those CI builds here: https://travis-ci.org/f-droid/fdroidserver

This should translate entirely to *BSD since OSX's user land is merged with FreeBSD.

See merge request !100
This commit is contained in:
Hans-Christoph Steiner 2016-02-15 22:09:55 +00:00
commit f861faa86d
7 changed files with 71 additions and 14 deletions

49
.travis.yml Normal file
View File

@ -0,0 +1,49 @@
# Use the Android base system since it provides the SDK, etc.
language: java
matrix:
allow_failures:
- os: linux # this is really about OSX, Ubuntu is just bonus
include:
- os: linux
language: android
sudo: required
# this doesn't actually work yet https://github.com/travis-ci/travis-ci/issues/5337
dist: trusty
- os: osx
env: ANDROID_HOME=/usr/local/opt/android-sdk
licenses:
- 'android-sdk-preview-license-52d11cd2'
- 'android-sdk-license-.+'
# the PPA is needed on Ubuntu 14.04 precise, and with python3, trusty too
# the pip thing is a hack that can go away with trusty
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update;
brew install android-sdk dash gnu-sed jpeg python;
sudo pip install pep8 pyflakes pylint;
sudo pip install -e .;
sudo rm -rf fdroidserver.egg-info;
echo y | android --verbose update sdk --no-ui --filter platform-tools,build-tools-23.0.2;
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo add-apt-repository ppa:guardianproject/fdroidserver -y;
sudo apt-get -q update -y;
sudo apt-get -q install -y --no-install-recommends python
python-git python-imaging python-libcloud python-logilab-astng
python-paramiko python-pip python-pyasn1 python-pyasn1-modules
python-requests python-virtualenv python-yaml rsync
pylint pep8 dash bash ruby
python-dev libjpeg-dev zlib1g-dev;
fi
script:
- cd tests
- ./complete-ci-tests
after_failure:
- cd $TRAVIS_BUILD_DIR
- ls -lRa env
- ls -lR | curl -F 'clbin=<-' https://clbin.com

View File

@ -523,7 +523,7 @@ def build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir,
cmd = [config['gradle']]
if build.gradleprops:
cmd += ['-P'+kv for kv in build.gradleprops]
cmd += ['-P' + kv for kv in build.gradleprops]
cmd += ['clean']
@ -731,7 +731,7 @@ def build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir,
cmd = [config['gradle']]
if build.gradleprops:
cmd += ['-P'+kv for kv in build.gradleprops]
cmd += ['-P' + kv for kv in build.gradleprops]
cmd += gradletasks

View File

@ -66,17 +66,17 @@ def main():
# find root install prefix
tmp = os.path.dirname(sys.argv[0])
examplesdir = None
if os.path.basename(tmp) == 'bin':
prefix = None
egg_link = os.path.join(tmp, '..', 'local/lib/python2.7/site-packages/fdroidserver.egg-link')
if os.path.exists(egg_link):
# installed from local git repo
examplesdir = os.path.join(open(egg_link).readline().rstrip(), 'examples')
else:
prefix = os.path.dirname(os.path.dirname(__file__)) # use .egg layout
if not prefix.endswith('.egg'): # use UNIX layout
prefix = os.path.dirname(tmp)
examplesdir = prefix + '/share/doc/fdroidserver/examples'
# try .egg layout
examplesdir = os.path.dirname(os.path.dirname(__file__)) + '/share/doc/fdroidserver/examples'
if not os.path.exists(examplesdir): # use UNIX layout
examplesdir = os.path.dirname(tmp) + '/share/doc/fdroidserver/examples'
else:
# we're running straight out of the git repo
prefix = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))

View File

@ -211,7 +211,7 @@ def scan_source(build_dir, root_dir, build):
for i, line in enumerate(lines):
if is_used_by_gradle(line):
for name in suspects_found(line):
count += handleproblem('usual supect \'%s\' at line %d' % (name, i+1), fd, fp)
count += handleproblem('usual supect \'%s\' at line %d' % (name, i + 1), fd, fp)
noncomment_lines = [l for l in lines if not common.gradle_comment.match(l)]
joined = re.sub(r'[\n\r\s]+', ' ', ' '.join(noncomment_lines))
for m in gradle_mavenrepo.finditer(joined):

View File

@ -63,6 +63,10 @@ err() {
exit 1
}
warn() {
echo WARNING: "$@"
}
cmd_exists() {
command -v $1 1>/dev/null
}
@ -72,7 +76,8 @@ if cmd_exists pyflakes-python2; then
elif cmd_exists pyflakes; then
PYFLAKES=pyflakes
else
err "pyflakes is not installed!"
PYFLAKES=echo
warn "pyflakes is not installed, using dummy placeholder!"
fi
if cmd_exists pep8-python2; then

View File

@ -7,7 +7,7 @@
if [ `dirname $0` != "." ]; then
echo "only run this script like ./`basename $0`"
exit
exit 1
fi
set -e
@ -22,7 +22,7 @@ if [ -z $ANDROID_HOME ]; then
. ~/.android/bashrc
else
echo "ANDROID_HOME must be set!"
exit
exit 1
fi
fi

View File

@ -33,7 +33,7 @@ create_fake_android_home() {
create_test_dir() {
test -e $WORKSPACE/.testfiles || mkdir $WORKSPACE/.testfiles
TMPDIR=$WORKSPACE/.testfiles mktemp -d
mktemp -d $WORKSPACE/.testfiles/run-tests.XXXX
}
create_test_file() {
@ -115,7 +115,10 @@ $fdroid --version
echo_header "build the TeX manual"
cd $WORKSPACE/docs
./gendocs.sh -o html --email admin@f-droid.org fdroid "F-Droid Server Manual"
# this is only ever generated officially on GNU/Linux
if [ `uname -s` == "Linux" ]; then
./gendocs.sh -o html --email admin@f-droid.org fdroid "F-Droid Server Manual"
fi
#------------------------------------------------------------------------------#
@ -503,7 +506,7 @@ test -e repo/index.jar
grep -F '<application id=' repo/index.xml > /dev/null
# now set fake repo_keyalias
sed -i 's,^ *repo_keyalias.*,repo_keyalias = "fake",' $REPOROOT/config.py
sed -i.tmp 's,^ *repo_keyalias.*,repo_keyalias = "fake",' $REPOROOT/config.py
set +e
$fdroid update
if [ $? -eq 0 ]; then