1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-15 19:30:31 +01:00
Commit Graph

4237 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
1b7a8f85fc parse targetSdkVersion from APKs
The default targetSdkVersion is minSdkVersion, according to the docs:
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target

https://gitlab.com/fdroid/fdroidclient/issues/682
2016-06-14 11:43:07 +02:00
Hans-Christoph Steiner
032dbc3e8d official Android default minSdkVersion is 1 not 0
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#min
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
1feccf9eb8 rename 'sdkversion' var to 'minSdkVersion' to avoid confusion
'sdkversion' is confusing when there is also 'targetSdkVersion' and
'maxSdkVersion'.
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
0ae257db15 rename maxSdkVersion variables to match Android
Since this variable is already different than the XML name ('maxsdkver'),
this eliminates one more name for the same thing.
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
547a57e693 fix "DeprecationWarning: Please use assertEqual instead."
They've been deprecated since python 3.2, which was released a long time
ago.
2016-06-14 10:06:02 +02:00
Daniel Martí
f68830127e CI: bump docker image 2016-06-13 19:45:12 +01:00
Daniel Martí
4ed95b1fa6 CI: remove debug ls 2016-06-13 19:44:52 +01:00
Daniel Martí
83a0be960d Merge branch 'fix-file-read-write-encoding' into 'master'
Fix file read/write encoding

This hopefully provides a reasonably complete set of fixes for handling file encoding when reading and writing files.  It is not perfect since it does not handle _.java_, _.gradle_, or _pom.xml_ in any encoding, as is allowed.  But I think it should only be an improvement of the current state, and at worst, should work only as bad as the current setup for most language setups 

See merge request !129
2016-06-09 15:13:27 +00:00
Hans-Christoph Steiner
733ef52424 gitlab-ci: make sure pip3 install dirs exist
It doesn't want to create them itself.
2016-06-09 12:15:11 +02:00
Hans-Christoph Steiner
2b6d692f06 use UTF8 as default instead of ASCII for .java .gradle pom.xml
.java .gradle and XML files all can use any encoding.  Most code is ASCII,
but authors' names, etc. can easily be non-ASCII.  UTF-8 is by far the most
common file encoding.  While UTF-8 is the default encoding inside the code
in Python 3, it still has to deal with the real world, so the encoding
needs to be explicitly set when reading and writing files. So this switches
fdroidserver to expect UTF-8 instead of ASCII when parsing these files. For
now, this commit means that we only support UTF-8 encoded *.java, pom.xml
or *.gradle files.  Ideally, the code would detect the encoding and use the
actual one, but that's a lot more work, and its something that will not
happen often. We can cross that bridge when we come to it.

One approach, which is taken in the commit when possible, is to keep the
data as `bytes`, in which case the encoding doesn't matter.

This also fixes this crash when parsing gradle and maven files with
non-ASCII chars:

ERROR: test_adapt_gradle (__main__.BuildTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/fdroidserver-eighthave/tests/build.TestCase", line 59, in test_adapt_gradle
    fdroidserver.build.adapt_gradle(testsdir)
  File "/var/lib/jenkins/workspace/fdroidserver-eighthave/fdroidserver/build.py", line 445, in adapt_gradle
    path)
  File "/var/lib/jenkins/workspace/fdroidserver-eighthave/fdroidserver/common.py", line 188, in regsub_file
    text = f.read()
  File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 9460: ordinal not in range(128)
2016-06-07 20:13:54 +02:00
Hans-Christoph Steiner
afd528731a read/write F-Droid files always as UTF-8
This makes UTF-8 the sole supported encoding for F-Droid's files. This is
mostly codifying the already existing practice for config.py and index.xml.
The other files where always just ASCII before.

* config.py
* metadata/*.txt
* known_apks.txt
* categories.txt
* latestapps.txt
* latestapps.dat
* index.xml

Note: this does not change the read/write encoding of stats files.  That is
still ASCII.
2016-06-07 14:10:04 +02:00
Hans-Christoph Steiner
444e8ad982 read/write Java .properties files in proper encoding
They are officially defined as always in ISO 8859-1:
https://docs.oracle.com/javase/6/docs/api/java/util/Properties.html
2016-06-07 13:37:32 +02:00
Daniel Martí
3eca9dd773 README: fix badge 2016-06-03 16:59:24 +01:00
Ciaran Gultnieks
401649e036 Add extra debug logging for move to/from archive 2016-05-29 15:36:58 +01:00
Ciaran Gultnieks
e410e7018e Merge branch 'bs-updates' into 'master'
buildserver updates



See merge request !127
2016-05-27 13:14:52 +00:00
Daniel Martí
ec7beb8388 Bump platform-23 to r03 2016-05-27 14:08:57 +01:00
Daniel Martí
fa9aa5d10f Do not install extra-android-support in the VM
It's m2repository that is actually used by maven-based builds. This one
is pretty much useless.
2016-05-27 14:08:57 +01:00
Daniel Martí
d5d22dbc99 Update android sdk version
Install version 25 now. Also use the smaller tools zip. While at it,
also remove the tools re-install - it's not worth it, as long as we keep
the initial tools zip up to date.
2016-05-27 14:08:57 +01:00
Daniel Martí
1edd9cde3c Add gradle 2.13 2016-05-27 14:08:57 +01:00
Daniel Martí
a7e227d0e3 Merge branch 'libtool' into 'master'
Add libtool to deps list



See merge request !126
2016-05-26 16:33:39 +00:00
Boris Kraut
3a45f6ebe0 Add libtool to deps list 2016-05-17 23:04:20 +02:00
Daniel Martí
bad9c3e804 Merge branch 'lint-unused-files' into 'master'
lint: error on unused files

For now, this is just patch files.

See merge request !124
2016-05-05 23:31:04 +00:00
Daniel Martí
3aeea6fc90 lint: Add check for missing and unused extlibs 2016-05-05 13:42:07 +01:00
Daniel Martí
0711ddb376 lint: make the check for format a regular check 2016-05-05 13:23:30 +01:00
Daniel Martí
0c6269bb67 lint: error on unused files
For now, this is just patch files.
2016-05-05 12:40:16 +01:00
Daniel Martí
736391d3d9 Merge branch 'ci-bump' into 'master'
CI: Bump image

This is basically just an SDK update. We're now using the tools zip,
which is about 200MB smaller. Not entirely sure why, but things still
work.

See merge request !123
2016-05-05 11:14:27 +00:00
Daniel Martí
38790830f4 CI: Update image, not using base anymore
Since base is now 200MB smaller, this one is smaller too. The
fdroidserver-only deps are now in the client image - mainly python3-dev,
gcc and all the build deps for stuff like pillow.
2016-04-29 20:27:39 +01:00
Daniel Martí
5117562df4 lint: gradle does have target= support 2016-04-20 11:23:27 +01:00
Daniel Martí
a2edc9da43 Merge branch 'fix-ci' into 'master'
CI: Install venv instead of virtualenv



See merge request !122
2016-04-15 10:30:24 +00:00
Daniel Martí
8dea6b896c gradle: forgot to actually install 2.12 2016-04-14 16:19:35 +01:00
Daniel Martí
bf0e5dde71 CI: Install venv instead of virtualenv 2016-04-14 16:16:58 +01:00
Daniel Martí
fd9ac1ad36 Merge branch 'defaults' into 'master'
docs: add archive-policy default



See merge request !121
2016-04-14 08:35:54 +00:00
Boris Kraut
00f940e937 docs: add archive-policy default 2016-04-14 10:28:24 +02:00
Daniel Martí
1539b67537 Merge branch 'fix-virtualenv' into 'master'
Prefer pyvenv instead of virtualenv for Python 3.3+

`virtualenv` uses python2 by default on my machine.
Using `pyvenv` (see https://docs.python.org/3/library/venv.html#module-venv) instead of `virtualenv` fixes the problem and let's me perform `python3 setup.py install` in the virtual environment.

See merge request !119
2016-04-14 08:04:28 +00:00
Lode Hoste
0da94fbf58 Prefer pyvenv instead of virtualenv for Python 3.3+ 2016-04-13 08:30:41 +02:00
Daniel Martí
e2ea213887 Merge branch 'apkcache_compatibility' into 'master'
Add a workaround to open apkcache created with Py2

A workaround for #163.
*May* help in some rare cases, should not break anything.

See merge request !120
2016-04-12 18:35:23 +00:00
Dmitriy Bogdanov
3f75c95e5f Add an encoding parameter to open apkcache created with Py2 2016-04-12 12:42:41 +04:00
Ciaran Gultnieks
4eb5fa88be Fix gradle download url for 2.12 2016-04-07 08:30:10 +01:00
Daniel Martí
1e6069e20e Merge branch 'fix-jpeg' into 'master'
Added libjpeg and zlib dependency in README

It seems these dependencies are also required.

See https://github.com/python-pillow/Pillow/issues/1457

See merge request !118
2016-04-06 06:56:32 +00:00
Lode Hoste
1ba346aa5a Added libjpeg and zlib dependency in README
See https://github.com/python-pillow/Pillow/issues/1457
2016-04-06 00:46:48 +02:00
Hans-Christoph Steiner
6846b77259 Merge branch 'ci-update' into 'master'
Gradle 2.12, build-tools 23.0.3



See merge request !117
2016-04-05 10:42:59 +00:00
Daniel Martí
ec9087d057 Add and switch to build-tools 23.0.3
Also bump to the CI image which contains it.
2016-04-05 10:49:30 +01:00
Daniel Martí
a345e351ba Add Gradle 2.12 to the buildserver 2016-04-05 10:49:15 +01:00
Daniel Martí
7dfc1c0449 common: never pass None to replace_config_vars
This fixes fdroid build com.umang.dashnotifier:18:

	ERROR: Could not build app com.umang.dashnotifier due to unknown error: Traceback (most recent call last):
	  File "/home/mvdan/git/fsr/fdroidserver/build.py", line 1121, in main
	    options.onserver, options.refresh):
	  File "/home/mvdan/git/fsr/fdroidserver/build.py", line 950, in trybuild
	    build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir, tmp_dir, force, onserver, refresh)
	  File "/home/mvdan/git/fsr/fdroidserver/build.py", line 480, in build_local
	    extlib_dir, onserver, refresh)
	  File "/home/mvdan/git/fsr/fdroidserver/common.py", line 1335, in prepare_source
	    srclibpaths.append(getsrclib(lib, srclib_dir, build, preponly=onserver, refresh=refresh))
	  File "/home/mvdan/git/fsr/fdroidserver/common.py", line 1258, in getsrclib
	    cmd = replace_config_vars(srclib["Prepare"], None)
	  File "/home/mvdan/git/fsr/fdroidserver/common.py", line 1822, in replace_config_vars
	    cmd = cmd.replace('$$NDK$$', build.ndk_path())
	AttributeError: 'NoneType' object has no attribute 'ndk_path'
2016-04-02 13:43:49 +01:00
Daniel Martí
e822627fd1 Fix build crash introduced in 3768d7a4
get_ndk_path was removed long ago when App and Build were introduced.
Now Build.ndk_path() should be used. Trying to use the object as a dict
resulted in a nasty crash:

	TypeError: 'Build' object is not subscriptable

This is probably a result from faulty rebasing and not enough test
coverage.
2016-03-30 22:54:37 +01:00
Hans-Christoph Steiner
7082e2f209 Merge branch 'base-image' into 'master'
CI: Use the new base image

Lighter, since it doesn't include all the stuff required to build and
test the client that we don't need here.

See merge request !116
2016-03-29 16:53:51 +00:00
Daniel Martí
a6e857985a CI: Use the new base image
Lighter, since it doesn't include all the stuff required to build and
test the client that we don't need here.
2016-03-29 12:44:00 +01:00
Hans-Christoph Steiner
b72fa0d5a2 Merge branch 'master' into 'master'
Fix error in build.py



See merge request !115
2016-03-28 08:01:00 +00:00
mimi89999
593a94ea7f Fix error in build.py 2016-03-27 21:36:16 +02:00
Daniel Martí
f46253a79f rewritemeta: fix after !62 breakage 2016-03-24 19:48:15 +00:00