Browse Source

versionDev as flavor

tobiasKaminsky 8 years ago
parent
commit
1b200a5bad

+ 1 - 0
.drone.yml

@@ -60,6 +60,7 @@ matrix:
     - Generic
     - Gplay
     - Modified
+    - VersionDev
     - Lint
 
 branches: master

+ 19 - 0
build.gradle

@@ -131,6 +131,10 @@ android {
         exclude 'META-INF/LICENSE'
     }
 
+    signingConfigs {
+        release
+    }
+
     task checkstyle(type: Checkstyle) {
         configFile = file("${rootProject.projectDir}/checkstyle.xml")
         configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
@@ -186,6 +190,20 @@ android {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
     }
+    
+    buildTypes {
+        release {
+            signingConfig signingConfigs.release
+        }
+    }
+
+}
+
+if (project.hasProperty('RELEASE_STORE_FILE')) {
+    android.signingConfigs.release.storeFile = file(RELEASE_STORE_FILE)
+    android.signingConfigs.release.storePassword = RELEASE_STORE_PASSWORD
+    android.signingConfigs.release.keyAlias = RELEASE_KEY_ALIAS
+    android.signingConfigs.release.keyPassword = RELEASE_KEY_PASSWORD
 }
 
 dependencies {
@@ -193,6 +211,7 @@ dependencies {
     implementation 'com.android.support:multidex:1.0.2'
     implementation 'com.github.nextcloud:android-library:1.0.33'
     versionDevImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT' // use always latest master
+    versionDevImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT'
     implementation "com.android.support:support-v4:${supportLibraryVersion}"
     implementation "com.android.support:design:${supportLibraryVersion}"
     implementation 'com.jakewharton:disklrucache:2.0.2'

+ 25 - 0
src/main/java/com/owncloud/android/ui/activity/Preferences.java

@@ -34,6 +34,7 @@ import android.content.res.Configuration;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.os.AsyncTask;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Environment;
@@ -77,6 +78,7 @@ import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.MimeTypeUtil;
 import com.owncloud.android.utils.ThemeUtils;
 
+import java.io.BufferedReader;
 import java.io.IOException;
 import java.util.concurrent.ExecutionException;
 
@@ -1061,4 +1063,27 @@ public class Preferences extends PreferenceActivity
     public void onCancelMigration() {
         // Migration was canceled so we don't do anything
     }
+
+    /**
+     *
+     * Class for loading the version number
+     *
+     */
+    private class LoadingVersionNumberTask extends AsyncTask<Void, Void, Integer> {
+        protected Integer doInBackground(Void... args) {
+            try {
+                URL url = new URL(getString(R.string.dev_latest));
+                BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
+
+                Integer latestVersion = Integer.parseInt(in.readLine());
+                in.close();
+
+                return latestVersion;
+
+            } catch (IOException e) {
+                Log_OC.e(TAG, "Error loading version number", e);
+            }
+            return -1;
+        }
+    }
 }

+ 8 - 0
src/main/res/values/strings.xml

@@ -727,4 +727,12 @@
     <string name="send">Send</string>
     <string name="share">Share</string>
     <string name="link">Link</string>
+
+    <string name="store_short_desc">The Nextcloud Android app allows you to access all your files on your Nextcloud</string>
+    <string name="store_full_desc">The Open Source Nextcloud Android app allows you to access all your files on your Nextcloud.\n\nFeatures:\n* Easy, modern interface, fully themed in alignment with your server\'s theming\n* Upload your files to your Nextcloud server\n* Share your files with others\n* Keep your favorite files and folders synced\n* Search across all folders on your server\n* Auto Upload for photos and videos taken by your device\n* Keep up to date with notifications\n* Multi-account support\n* Secure access to your data with fingerprint or pin\n* Integration with DAVdroid for easy setup of Calendar &amp; Contacts synchronization\n\nPlease report all issues at https://github.com/nextcloud/android/issues and discuss this app at https://help.nextcloud.com/c/clients/android\n\nNew to Nextcloud? Nextcloud is a private file sync &amp; share and communication server. It is fully open source and you can host it yourself or pay a company to do it for you. That way, you are in control of your photos, your calendar and contact data, your documents and everything else.\n\nCheck out Nextcloud at https://nextcloud.com</string>
+
+    <string name="store_short_dev_desc">The Nextcloud Dev app is a development snapshot and can be installed parallel.</string>
+    <string name="store_full_dev_desc">The Open Source Nextcloud Android app allows you to access all your files on your Nextcloud.\nThis is a dev version of the official Nextcloud app and includes brand-new, untested features which might lead to instabilities and data loss. The app is designed for users willing to test the new features and to report bugs if they occur. Do not use it for your productive work!\n\nThe dev version can be installed alongside the official Nextcloud app which is available at F-Droid, too. Once a day it is checked if the source code was updated, so there can be longer pauses between builds.</string>
+
+    <string name="prefs_category_dev">Dev</string>
 </resources>