diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000000..149651c18d --- /dev/null +++ b/.drone.yml @@ -0,0 +1,14 @@ +pipeline: + test: + image: nextcloudci/android:android-7 + commands: + - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 20M + - emulator -avd test -no-window & + - ./wait_for_emulator.sh + # build app + - ./gradlew clean build + + environment: + - ANDROID_TARGET=android-24 + - ANDROID_ABI=armeabi-v7a + - LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:/opt/android-sdk-linux/tools/lib64/gles_mesa/ diff --git a/.lgtm b/.lgtm index 59a8a38bf3..3ae801a20f 100644 --- a/.lgtm +++ b/.lgtm @@ -1 +1,3 @@ pattern = "(?i):shipit:|:\\+1:|LGTM" +self_approval_off=true +approvals = 1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1755dff616..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -sudo: false -language: android -android: - components: - - platform-tools - - tools - - build-tools-23.0.3 - - android-23 - - sys-img-armeabi-v7a-android-23 -branches: - only: - - master -before_install: -- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI - -c 20M -- emulator -avd test -no-skin -no-audio -no-window & -- rm pom.xml -- android update project -p . -- chmod +x ./wait_for_emulator.sh -- ./wait_for_emulator.sh -script: -#- ant clean -#- ant debug -#- cd test_client/tests -#- ant acceptance-test -#- cd ../.. -- ./gradlew clean build -env: - global: - # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created - # via the "travis encrypt" command using the project repo's public key -# - secure: epTZ0zZGDbHL3o6vSC9uNkZsi5j5SA6O/tvQBH7QW/dluuzIJxIjfhNbZHDyBReYDleirLzUFQpdWAUdvulCMLs/qZdIzFGlYXZSpxEnvPYMGQcilwADdJcxLw8L+3+ET5hSexxhjrTGw427IljkqGUpqQTxaLwFdFu98lDWSbc= - # The next 3 declarations are the variables needed to access the test server, - # added via "travis encrypt", using the repo public key -# - secure: gPCBnpGLA2sdSMtfhT+/InThmXNEU8XrrS54uuIP8iXBLvVe0yZrNl76GbMosV0ry3YtDngsmsbHwRjPPb0+3mTTdAqZ60HHzGaNPgEm6b5t0t4bpJ3LW9osLZsuf9jRsI2LD66zxblaMrK2+8hN/dUrj707ijsZHp3SPSQJ6g8= -# - secure: AnxLVarfwM7IhJ7Sca35USyRlFHFvlcBhWTt2TVDcyQ+ldDyb+U6IWXFK0Yy82QP0ZH/RCLu7FnmHK/rKG0BHNRt1Ymco1VkTQql0MZcHXP+4IKgEvgJyUn1TqYj+hSVmM6lgTA+QUjZYGSfwU8mhUFiU7644ZTdTe6ALdqa+v8= -# - secure: ezKyZbb3q1Phcv/vJntuJe0C2req+Hp4/C+tFZIWZ3o8wRO9jVI3bnED9TWQyQOOT0SoRYjJ5zqp0UcEOGCzPeWFO6bA7RWp+zA/R9sziLNcVWMVv3WXnuClQjPBHJeXRnP7YmNjxDmSfV97a14dk5d9LgJZYliTDepH4dLsxro= -# - secure: HV8REF7bB1i6cBEe4YCZvjgTf6tGiptAPzp9qZXGUH9Lxh6yUjYMXXP8flDaIFcE2JuAakW6P4SPr7/SQ+X4f8/84cNhmU1I+6Y1nG37WvelRHQVslOUDbl1TNUnynYZ+ybkb3BtrQvggCGMdQKvGZXYiggFhN/TWuDo0c7Q2Ro= - matrix: - - ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a -#addons: -# coverity_scan: -# project: -# name: nextcloud/android-library -# description: Build submitted via Travis CI -# notification_email: lukas@nextcloud.com -# build_command_prepend: gradle clean -# build_command: gradle build -# branch_pattern: coverity_scan diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 29d9f65000..1ed7ca2d60 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -30,7 +30,7 @@ + android:targetSdkVersion="24" /> diff --git a/README.md b/README.md index 5eabd3df1f..c73158cb47 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Using Nextcloud Android library it will be the easiest way to communicate with N Add this library in your project and integrate your application with Nextcloud seamlessly. ## Use Library -In the repository it is not only the library project but also the example project “sample_client”; +In the repository it is not only the library project but also the example project "sample_client"; thanks to it you will learn how to use the library. *There are different ways of adding this library to your code* @@ -37,14 +37,19 @@ The repository holds one main branch with an infinite lifetime: Branch __origin/master__ is considered the main branch where the source code of HEAD always reflects a state with the latest delivered development changes for the next release. -Other branches, some supporting branches are used to aid parallel development between team members, ease tracking of features, prepare for production releases and to assist in quickly fixing live production problems. Unlike the main branches, these branches always have a limited life time, since they will be removed eventually. +Other branches, some supporting branches are used to aid parallel development between team members, ease tracking of features and to assist in quickly fixing live production problems. Unlike the main branch, these branches always have a limited life time, since they will be removed eventually (feature branching). -The different types of branches we use: +## Development process +We are all about quality while not sacrificing speed so we use a very pragmatic workflow. -- Branch __perNewFeature__ -- Branch __releaseBranches__ - -Both of them branch off from master and must merge back into master branch through a [pull requests](https://github.com/nextcloud/android-library/pulls) in Github. Once the PR is approved and merged, the branch may be deleted. +* create an issue with feature request + * discuss it with other developers + * create mockup if necessary + * must be approved --> label approved + * after that no conceptual changes! +* develop code +* create [pull request](https://github.com/nextcloud/android-library/pulls) +* to assure the quality of the app, any PR gets reviewed, approved and tested by [two developers](https://github.com/nextcloud/android-library/blob/master/MAINTAINERS) before it will be merged to master ## License @@ -52,7 +57,7 @@ Nextcloud Android Library is available under MIT license. See [LICENSE.md](https ### Third party libraries ``` -Nextcloud Android Library uses Apache JackRabbit, version 2.2.5. +Nextcloud Android Library uses Apache JackRabbit, version 2.12.2. Copyright (C) 2004-2010 The Apache Software Foundation. Licensed under Apache License, Version 2.0. ``` @@ -65,6 +70,6 @@ Licensed under Apache License, Version 2.0. ## Compatibility -Nextcloud Android library is valid for Android version 3.0 and up (android:minSdkVersion="11" android:targetSdkVersion="23"). +Nextcloud Android library is valid for Android version 3.0 and up (with ```android:minSdkVersion="11"``` and ```android:targetSdkVersion="24"```). -Nextcloud Android library supports Nextcloud server from version 9. +Nextcloud Android library supports Nextcloud server from version 9+. diff --git a/build.gradle b/build.gradle index 780ded286c..33a0fd753c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.3' + classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' } } @@ -18,12 +18,12 @@ repositories { } dependencies { - compile 'org.apache.jackrabbit:jackrabbit-webdav:2.10.1' + compile 'org.apache.jackrabbit:jackrabbit-webdav:2.12.4' } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion 24 + buildToolsVersion "24.0.2" sourceSets { main { diff --git a/libs/jackrabbit-webdav-2.10.1.jar b/libs/jackrabbit-webdav-2.12.2.jar similarity index 85% rename from libs/jackrabbit-webdav-2.10.1.jar rename to libs/jackrabbit-webdav-2.12.2.jar index 068346888d..1be8d51a49 100644 Binary files a/libs/jackrabbit-webdav-2.10.1.jar and b/libs/jackrabbit-webdav-2.12.2.jar differ diff --git a/project.properties b/project.properties index b2ef7dccc5..34c8d58b38 100644 --- a/project.properties +++ b/project.properties @@ -11,5 +11,5 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-23 +target=android-24 android.library=true diff --git a/sample_client/AndroidManifest.xml b/sample_client/AndroidManifest.xml index 358405b614..47734a4c12 100644 --- a/sample_client/AndroidManifest.xml +++ b/sample_client/AndroidManifest.xml @@ -30,7 +30,7 @@ + android:targetSdkVersion="24" /> - ownCloud Sample Client + Nextcloud Sample Client Refresh Upload Delete remote file diff --git a/src/com/owncloud/android/lib/resources/shares/UpdateRemoteShareOperation.java b/src/com/owncloud/android/lib/resources/shares/UpdateRemoteShareOperation.java index a9c007e7f3..919cae7d5f 100644 --- a/src/com/owncloud/android/lib/resources/shares/UpdateRemoteShareOperation.java +++ b/src/com/owncloud/android/lib/resources/shares/UpdateRemoteShareOperation.java @@ -49,7 +49,6 @@ *

* Allow updating several parameters, triggering a request to the server per parameter. */ - public class UpdateRemoteShareOperation extends RemoteOperation { private static final String TAG = GetRemoteShareOperation.class.getSimpleName(); @@ -159,7 +158,7 @@ protected RemoteOperationResult run(OwnCloudClient client) { } if (mExpirationDateInMillis < 0) { // clear expiration date - parametersToUpdate.add(new Pair(PARAM_EXPIRATION_DATE, "")); + parametersToUpdate.add(new Pair<>(PARAM_EXPIRATION_DATE, "")); } else if (mExpirationDateInMillis > 0) { // set expiration date @@ -167,16 +166,16 @@ protected RemoteOperationResult run(OwnCloudClient client) { Calendar expirationDate = Calendar.getInstance(); expirationDate.setTimeInMillis(mExpirationDateInMillis); String formattedExpirationDate = dateFormat.format(expirationDate.getTime()); - parametersToUpdate.add(new Pair(PARAM_EXPIRATION_DATE, formattedExpirationDate)); + parametersToUpdate.add(new Pair<>(PARAM_EXPIRATION_DATE, formattedExpirationDate)); } // else, ignore - no update if (mPermissions > 0) { // set permissions - parametersToUpdate.add(new Pair(PARAM_PERMISSIONS, Integer.toString(mPermissions))); + parametersToUpdate.add(new Pair<>(PARAM_PERMISSIONS, Integer.toString(mPermissions))); } if (mPublicUpload != null) { - parametersToUpdate.add(new Pair(PARAM_PUBLIC_UPLOAD, Boolean.toString(mPublicUpload))); + parametersToUpdate.add(new Pair<>(PARAM_PUBLIC_UPLOAD, Boolean.toString(mPublicUpload))); } /// perform required PUT requests diff --git a/test_client/AndroidManifest.xml b/test_client/AndroidManifest.xml index 20b76ef1f5..d3b74d523d 100644 --- a/test_client/AndroidManifest.xml +++ b/test_client/AndroidManifest.xml @@ -39,7 +39,7 @@ + android:targetSdkVersion="24" /> - oc_framework-test-project + Nc_framework-test-project Settings Hello world! The test account %1$s could not be found in the device diff --git a/test_client/tests/project.properties b/test_client/tests/project.properties index 916037e334..7ce68660c4 100644 --- a/test_client/tests/project.properties +++ b/test_client/tests/project.properties @@ -11,4 +11,4 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-23 +target=android-24 diff --git a/test_client/tests/res/values/strings.xml b/test_client/tests/res/values/strings.xml index 66f25f1eec..dd37217303 100644 --- a/test_client/tests/res/values/strings.xml +++ b/test_client/tests/res/values/strings.xml @@ -25,6 +25,6 @@ - Oc_framework-testTest + Nc_framework-testTest diff --git a/wait_for_emulator.sh b/wait_for_emulator.sh old mode 100644 new mode 100755 index 7f6443c794..37fa325459 --- a/wait_for_emulator.sh +++ b/wait_for_emulator.sh @@ -1,14 +1,17 @@ #!/bin/bash +# Originally written by Ralf Kistner , but placed in the public domain + bootanim="" failcounter=0 checkcounter=0 + until [[ "$bootanim" =~ "stopped" ]]; do bootanim=`adb -e shell getprop init.svc.bootanim 2>&1` echo "($checkcounter) $bootanim" if [[ "$bootanim" =~ "not found" ]]; then let "failcounter += 1" - if [[ $failcounter -gt 30 ]]; then + if [[ $failcounter -gt 3 ]]; then echo "Failed to start emulator" exit 1 fi @@ -16,4 +19,6 @@ until [[ "$bootanim" =~ "stopped" ]]; do let "checkcounter += 1" sleep 10 done -echo "Done" +echo "($checkcounter) Done" +adb -e shell input keyevent 82 +echo "($checkcounter) Unlocked emulator screen" \ No newline at end of file