Skip to content
Snippets Groups Projects
Commit af9a3191 authored by Jawnnypoo's avatar Jawnnypoo
Browse files

Build updates, convert a few more classes to Kotlin

parent 21a2f500
No related branches found
No related tags found
No related merge requests found
Showing
with 100 additions and 71 deletions
Loading
Loading
@@ -3,7 +3,7 @@ image: openjdk:8-jdk
 
variables:
ANDROID_COMPILE_SDK: "25"
ANDROID_BUILD_TOOLS: "25.0.2"
ANDROID_BUILD_TOOLS: "25.0.3"
ANDROID_SDK_TOOLS: "25.2.3"
 
before_script:
Loading
Loading
Loading
Loading
@@ -7,9 +7,9 @@ android:
components:
- platform-tools
- tools
- build-tools-25.0.2
- build-tools-25.0.3
- android-25
- extra-android-m2repository
- extra-google-m2repository
 
script: "./gradlew assembleDebug"
script: "./gradlew testFdroidDebug"
Loading
Loading
@@ -23,7 +23,7 @@ def versionBuild = 0 // bump for dogfood builds, public betas, etc.
 
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
buildToolsVersion "25.0.3"
 
project.ext {
LABCOAT_FABRIC_KEY = project.hasProperty("LABCOAT_FABRIC_KEY") ? project.LABCOAT_FABRIC_KEY : "";
Loading
Loading
@@ -78,7 +78,7 @@ ext {
okHttpVersion = '3.7.0'
butterknifeVersion = '8.5.1'
loganSquareVersion = '1.3.7'
parcelerVersion = '1.1.6'
parcelerVersion = '1.1.8'
reptarVersion = '2.4.1'
adapterLayout = '1.1.0'
materialDialogsVersion = '0.9.4.4'
Loading
Loading
@@ -123,7 +123,7 @@ dependencies {
 
compile 'org.greenrobot:eventbus:3.0.0'
 
compile 'io.reactivex.rxjava2:rxjava:2.0.9'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
 
compile 'com.trello.rxlifecycle2:rxlifecycle-components:2.0.1'
Loading
Loading
@@ -155,14 +155,14 @@ dependencies {
compile 'com.github.Commit451:MorphTransitions:2.0.0'
compile 'com.github.Commit451.Alakazam:alakazam:1.0.1'
compile 'com.github.Commit451:Lift:1.2.0'
compile 'com.github.Commit451:okyo:1.2.0'
compile 'com.github.Commit451:okyo:2.0.0'
compile 'com.github.Commit451:OkioProGuardRules:1.11.0.0'
compile 'com.github.Commit451:RetrofitProguardRules:2.2.0.0'
compile 'com.github.Commit451:LoganSquareProGuardRules:1.3.7.0'
compile 'com.github.Commit451:EventBusProGuardRules:3.0.0.0'
compile 'com.github.chrisbanes:PhotoView:2.0.0'
 
compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'
compile 'me.zhanghai.android.materialprogressbar:library:1.4.1'
 
compile 'com.github.Jawnnypoo:PhysicsLayout:2.1.0'
 
Loading
Loading
@@ -174,7 +174,7 @@ dependencies {
 
compile 'com.github.alorma:diff-textview:1.3.0'
 
compile 'com.wdullaer:materialdatetimepicker:3.1.3'
compile 'com.wdullaer:materialdatetimepicker:3.2.0'
 
compile 'com.github.novoda:simple-chrome-custom-tabs:0.1.5'
 
Loading
Loading
@@ -193,7 +193,7 @@ dependencies {
transitive = true;
}
 
normalCompile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
normalCompile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
 
Loading
Loading
package com.commit451.gitlab.util;
import android.content.Context;
import android.support.annotation.NonNull;
/**
* Does not enable Fabric
*/
public class FabricUtil {
public static void init(@NonNull Context context) {
//do nothing
}
}
package com.commit451.gitlab.util
import android.content.Context
/**
* Does not enable Fabric
*/
object FabricUtil {
fun init(context: Context) {
//do nothing
}
}
Loading
Loading
@@ -73,7 +73,7 @@ object FileUtil {
fun saveBlobToProviderDirectory(context: Context, bytes: ByteArray, fileName: String): File {
val targetFile = File(getProviderDirectory(context), fileName)
targetFile.createNewFile()
Okyo.writeByteArrayToFile(targetFile, bytes)
Okyo.writeByteArrayToFile(bytes, targetFile)
return targetFile
}
 
Loading
Loading
package com.commit451.gitlab.widget;
package com.commit451.gitlab.widget
 
import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.Intent;
import android.appwidget.AppWidgetManager
import android.content.Context
import android.content.Intent
 
/**
* Oh the woes of a weird widget
*/
public class WidgetUtil {
object WidgetUtil {
 
/**
* Update any widget
* @param context context
* *
* @param clazz class of the widget provider
* *
* @param widgetId the widget id
* @see <a href="http://stackoverflow.com/a/7738687/895797">http://stackoverflow.com/a/7738687/895797</a>
* *
* @see [http://stackoverflow.com/a/7738687/895797](http://stackoverflow.com/a/7738687/895797)
*/
public static void triggerWidgetUpdate(Context context, Class clazz, int widgetId) {
Intent intent = new Intent(context, clazz);
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
fun triggerWidgetUpdate(context: Context, clazz: Class<*>, widgetId: Int) {
val intent = Intent(context, clazz)
intent.action = AppWidgetManager.ACTION_APPWIDGET_UPDATE
// Use an array and EXTRA_APPWIDGET_IDS instead of AppWidgetManager.EXTRA_APPWIDGET_ID,
// since it seems the onUpdate() is only fired on that:
int[] ids = {widgetId};
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids);
context.sendBroadcast(intent);
val ids = intArrayOf(widgetId)
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids)
context.sendBroadcast(intent)
}
}
package com.commit451.gitlab.util;
import android.util.Log;
import com.crashlytics.android.Crashlytics;
import timber.log.Timber;
/**
* Logs all {@link timber.log.Timber#wtf(String, Object...)} calls to Crashlytics
*/
public class CrashlyticsWtfTree extends Timber.Tree {
@Override
protected void log(int priority, String tag, String message, Throwable t) {
if (priority == Log.ASSERT) {
Crashlytics.log(Log.ASSERT, tag, message);
}
}
}
package com.commit451.gitlab.util
import android.util.Log
import com.crashlytics.android.Crashlytics
import timber.log.Timber
/**
* Logs all [timber.log.Timber.wtf] calls to Crashlytics
*/
class CrashlyticsWtfTree : Timber.Tree() {
@Override
protected fun log(priority: Int, tag: String, message: String, t: Throwable) {
if (priority == Log.ASSERT) {
Crashlytics.log(Log.ASSERT, tag, message)
}
}
}
package com.commit451.gitlab.util;
import android.content.Context;
import android.support.annotation.NonNull;
import com.commit451.gitlab.BuildConfig;
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;
import timber.log.Timber;
/**
* Enables Fabric
*/
public class FabricUtil {
public static void init(@NonNull Context context) {
// Start crashlytics if enabled
if (!BuildConfig.DEBUG) {
Fabric.with(context, new Crashlytics());
Timber.plant(new CrashlyticsWtfTree());
}
}
}
package com.commit451.gitlab.util
import android.content.Context
import com.commit451.gitlab.BuildConfig
import com.crashlytics.android.Crashlytics
import io.fabric.sdk.android.Fabric
import timber.log.Timber
/**
* Enables Fabric
*/
object FabricUtil {
fun init(@NonNull context: Context) {
// Start crashlytics if enabled
if (!BuildConfig.DEBUG) {
Fabric.with(context, Crashlytics())
Timber.plant(CrashlyticsWtfTree())
}
}
}
Loading
Loading
@@ -2,7 +2,7 @@
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.commit451.updatewrapper'
buildscript {
ext.kotlinVersion = '1.1.2'
ext.kotlinVersion = '1.1.2-3'
repositories {
jcenter()
maven { url "https://jitpack.io" }
Loading
Loading
Loading
Loading
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment