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
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
import org.gradle.api.DefaultTask | |
import org.gradle.api.file.DirectoryProperty | |
import org.gradle.api.file.RegularFileProperty | |
import org.gradle.api.provider.Property | |
import org.gradle.api.tasks.* | |
import org.gradle.workers.WorkAction | |
import org.gradle.workers.WorkParameters | |
import org.gradle.workers.WorkerExecutor | |
import java.net.HttpURLConnection | |
import java.net.URL |
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.api.DefaultTask | |
import org.gradle.api.file.DirectoryProperty | |
import org.gradle.api.file.RegularFileProperty | |
import org.gradle.api.provider.Property | |
import org.gradle.api.tasks.* | |
import java.security.MessageDigest | |
@CacheableTask | |
abstract class Checksum : DefaultTask() { |
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 org.gradle.api.attributes.LibraryElements | |
import org.gradle.api.component.ConfigurationVariantDetails | |
import org.gradle.api.plugins.JavaPlugin.SOURCES_ELEMENTS_CONFIGURATION_NAME | |
import org.gradle.jvm.tasks.Jar | |
import java.util.Locale | |
plugins { | |
id("com.android.library") | |
`maven-publish` | |
} |
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
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
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') |
NewerOlder