i was thinking how to integrate it with the newest feature
we could have
rejectVersionContaining ("alpha","beta",...)which would be a shorter version of
| $ cd sample-kotlin | |
| $ gw --stacktrace dependencyUpdates | |
| executing gradlew instead of gradle | |
| > Task :dependencyUpdates FAILED | |
| FAILURE: Build failed with an exception. | |
| * What went wrong: | |
| Execution failed for task ':dependencyUpdates'. | |
| > Cannot change dependencies of configuration ':classpath' after it has been resolved. |
| object MoshiAdapters { | |
| val moshi : Moshi = Moshi.Builder().build() | |
| inline fun <reified T: Any> moshiAdapter(clazz: Class<T> = T::class.java): Lazy<JsonAdapter<T>> | |
| = lazy { moshi.adapter(clazz) } | |
| val movie: JsonAdapter<Movie> by moshiAdapter() | |
| val user: JsonAdapter<User> by moshiAdapter() |
i was thinking how to integrate it with the newest feature
we could have
rejectVersionContaining ("alpha","beta",...)which would be a shorter version of
| /** buildSrc/src/main/kotlin/Libs.kt **/ | |
| object Libs { | |
| const val okhttp = "com.squareup.okhttp3:okhttp:" + Versions.okhttp | |
| const val okio = "com.squareup.okio:okio:" + Versions.okio | |
| //... all others | |
| } | |
| /** buildSrc/src/main/kotlin/Versions.kt **/ | |
| object Versions { | |
| const val okhttp = "3.12.1" |
Originally published on https://github.com/m-rec/c325017f9e66db9320f99fdced6ac3d66abc9212
Coroutines documents
| # Open a new android project in Android Studio | |
| # From Android Studio, run the gradle task ":properties" | |
| # From the command-line, run | |
| $ ./gradlew :properties | |
| # Check if you see this message | |
| Starting a Gradle Daemon, 1 incompatible could not be reused | |
| # To debug the problem run this | |
| $ ps auxw | grep GradleDaemon |
| // buildSrc/src/main/kotlin/Config.kt | |
| object Config { | |
| const val ACTIVITY = "com.mautinoa.cardapp.MainActivity" | |
| const val PACKAGE = "com.mautinoa.cardapp" | |
| const val kotlinVersion = "1.2.71" | |
| object SdkVersions { | |
| val versionCode = 1 | |
| val compile = 28 | |
| val target = 26 |
| // buildSrc/src/main/java/GooglePlay.kt | |
| import java.io.File | |
| object GooglePlay { | |
| @JvmStatic | |
| fun updateWhatsNew(projectDir: File, version: String) { | |
| val files: List<File> = listOf( | |
| "src/production/play/en-US/listing/whatsnew-alpha", |
| fun app() = AppComponent.instance | |
| interface AppComponent { | |
| val context: Context | |
| val retrofit: Retrofit | |
| val okHttpClient: OkHttpClient | |
| val catRepository: CatRepository | |
| val catService: CatService | |
| val mainThreadScheduler: Scheduler |