This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A lightweight Kotlin extension for java.util.logging.Logger simple support | |
* | |
* Usage: | |
* | |
* At top level add: | |
* private val log = logger<MyClass>() | |
* | |
* Then on class body: | |
* log.info "Some log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A Jsoup body converter for Retrofit | |
* | |
* Sample usage (with Rx): | |
* Retrofit.Builder() | |
* .addCallAdapterFactory(RxJava2CallAdapterFactory.createAsync()) | |
* .addConverterFactory(JsoupConverterFactory) | |
* .build() | |
* | |
* Then you can declare in you Retrofit interface return type: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.database.Cursor; | |
import android.support.v4.content.LocalBroadcastManager; | |
import android.support.v4.util.LongSparseArray; | |
import android.util.SparseArray; | |
import io.reactivex.Observable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sourceSets { | |
integrationTest { | |
compileClasspath += sourceSets.main.output + configurations.testRuntime | |
runtimeClasspath += output + compileClasspath | |
} | |
} | |
configurations { | |
integrationTestCompile { | |
extendsFrom configurations.testCompile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.gradle.process.internal.ExecActionFactory | |
import org.gradle.process.internal.JavaExecAction | |
import javax.inject.Inject | |
configurations { | |
jaxws | |
} | |
dependencies.add('jaxws', 'com.sun.xml.ws:jaxws-tools:2.2.10') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'jacoco' | |
jacoco { | |
toolVersion = '0.8.2' | |
} | |
android { | |
buildTypes { | |
debug { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.reactivex.Completable | |
import io.reactivex.Completable.defer | |
import io.reactivex.CompletableObserver | |
import java.util.concurrent.atomic.AtomicReference | |
class CompletableSemaphore( | |
private val hasPermission: () -> Boolean, | |
private val acquirePermission: Completable | |
) : Completable() { | |
private val complete = complete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kotlin.native.concurrent | |
fun <T> AtomicReference<T>.computeAndSet(transform: T.() -> T) = with(value) { | |
@Suppress("ControlFlowWithEmptyBody") | |
while (!compareAndSet(this, transform().freeze())); | |
this | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id("com.android.library") | |
`maven-publish` | |
} | |
publishing { | |
repositories { | |
// TODO define your publish repos here | |
} | |
publications { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id("com.android.library") | |
`maven-publish` | |
} | |
publishing { | |
repositories { | |
// TODO define your publish repos here | |
} | |
publications { |
OlderNewer