christophsturm
12/12/2018, 8:00 PMuser
12/13/2018, 7:09 AMchristophsturm
12/13/2018, 9:04 AMdavidasync
12/13/2018, 2:53 PMxenoterracide
12/14/2018, 5:30 AMproject.getPluginManager().apply( kotlin("jvm") );
what do I replace kotlin("jvm")
with?xenoterracide
12/15/2018, 1:51 PMinterface Identified<ID extends Serializable> : Persistable<ID> {
@JsonIgnore
override fun boolean isNew() {
return this.getId() == null;
}
fun sameIdAs( Identified<ID> that ) : Boolean {
return Objects.equals( this.getId(), that.getId() );
}
}
what's wrong with the generic definitiondave08
12/17/2018, 10:56 AMursus
12/17/2018, 10:42 PMdataBinding {
enabled = true
}
in android { }
lambda in every module from one place?Robert
12/18/2018, 8:53 AMsdeleuze
12/18/2018, 4:28 PMStandardJavadocDocletOptions.links
from tasks.withType<Javadoc> { }
to specify external Javadoc URL with Kotlin DSL?ursus
12/18/2018, 5:15 PMbuildToolsVersion
anymore, any reason for this? Build seems to work without it, but dont I get some randomly changing dependency?ursus
12/18/2018, 5:35 PMursus
12/18/2018, 5:44 PMursus
12/18/2018, 5:55 PMursus
12/18/2018, 6:16 PMRobert
12/18/2018, 7:30 PMprotoc {
^ Type mismatch: inferred type is () -> Unit but Closure<(raw) Any!>! was expected`
Raw? Any? protoc looks like this:
public void protoc(Closure configureClosure) {
ursus
12/20/2018, 12:43 AMapi project(:core)
the solution here? Id like to avoid that
or, rather, should I remove `@Provides`˛from fun okhttp()
, fun retrofit()
methods and have only my final ApiClient
be @Provides
?
which however then muddies up the params of the dependency which are before more explicit like:
@Singleton @Provides fun apiClient(api: Api): ApiClient {
(edited)
to
@Singleton @Provides fun apiClient(context: Context): ApiClient {
val okHttpClient = okHttpClient(context)
val moshi = moshi()
val retrofit = retrofit(okHttpClient, moshi)
val api = api(retrofit)
return ApiClient(api)
}
nikolaymetchev
12/21/2018, 2:08 PMx80486
12/22/2018, 10:54 PMLucas
12/23/2018, 9:41 PMbuild.gradle.kts
script into multiple short scripts that configure plugins and tasks? Do buildSrc
can help while https://github.com/gradle/kotlin-dsl/issues/424 and https://github.com/gradle/kotlin-dsl/issues/427 don't get fixed?dector
12/28/2018, 12:00 AMtasks.register("named") {}
in build.gradle.kts
. Can I get access to WorkerExecutor
somehow?bjonnh
12/30/2018, 2:13 AMjlleitschuh
01/03/2019, 9:23 PMfromPresets
from Kotlin?
https://github.com/JetBrains/kotlin/blob/8cec50e6e2b2fb268160144bac1bd9ca40bfafb5/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/KotlinMultiplatformPlugin.kt#L63ghedeon
01/06/2019, 9:18 PMbuildSrc
(good explanation: https://caster.io/lessons/gradle-dependency-management-using-kotlin-and-buildsrc-for-buildgradle-autocomplete-in-android-studio). Obviously, all the checks for updates are gone. How do you deal with it? Any custom plugins that tackle this inconvenience?jmfayard
01/07/2019, 5:33 AMzjuhasz
01/09/2019, 6:30 AMsourceSets {
main.java.srcDirs += 'src/main/kotlin'
test.java.srcDirs += 'src/test/kotlin'
}
ikej
01/09/2019, 10:42 AMjar {
archiveBaseName = "myJar"
}
instead of the
jar {
archiveBaseName.set("myJar")
}
that is required since Gradle 5.1.Slackbot
01/12/2019, 6:34 AMSlackbot
01/12/2019, 7:36 PMjrgonzalez
01/12/2019, 10:37 PMdep = dependencies.create('com.squareup.retrofit2:converter-simplexml:' + constants.versions.retrofit) {
// We need to exclude dependencies which are already provided by the Android platform
exclude module: 'stax-api'
exclude module: 'stax'
exclude module: 'xpp3'
}
But I can't figure out how to convert that to Kotlin DSL and I don't even have access to the "dependencies.create" method on the buildSrc object where I am declaring the dependencies. Is it possible to define a dependency with exclusions like that outside a DependencyHandler scope? Is there a standalone constructor / builder for dependencies that is not an extension method only available at specific places?jrgonzalez
01/12/2019, 10:37 PMdep = dependencies.create('com.squareup.retrofit2:converter-simplexml:' + constants.versions.retrofit) {
// We need to exclude dependencies which are already provided by the Android platform
exclude module: 'stax-api'
exclude module: 'stax'
exclude module: 'xpp3'
}
But I can't figure out how to convert that to Kotlin DSL and I don't even have access to the "dependencies.create" method on the buildSrc object where I am declaring the dependencies. Is it possible to define a dependency with exclusions like that outside a DependencyHandler scope? Is there a standalone constructor / builder for dependencies that is not an extension method only available at specific places?gildor
01/12/2019, 10:52 PMjrgonzalez
01/12/2019, 10:56 PMDependencies.retrofit2ConverterSimpleXML
as the ones that I have with no configuration. Also, don't know how to do the configuration like in Groovy.gildor
01/12/2019, 10:57 PMjrgonzalez
01/12/2019, 10:58 PMfun DependencyHandler.retrofit2ConverterSimpleXML()
inside the Dependencies objectgildor
01/12/2019, 10:59 PMjrgonzalez
01/12/2019, 11:02 PMimplementation(Dependencies.)
I don't get the function appearing at allimplementation(Dependencies.retrofit2ConverterSimpleXML())
or offers anything to import as implementation(retrofit2ConverterSimpleXML())
gildor
01/12/2019, 11:06 PMjrgonzalez
01/12/2019, 11:08 PMimplementation(retrofit2ConverterSimpleXML())
to offer to import it as import Dependencies.retrofit2ConverterSimpleXML
but that is not ideal either cause I lose autocompletion, so I have to look them up on the object manually and also to add imports, which the other dependencies do not needgildor
01/12/2019, 11:10 PMjrgonzalez
01/12/2019, 11:12 PMgildor
01/12/2019, 11:12 PMobject Dependencies {
fun retrofitSimpleXml(dep: DependencyHandler)
}
Than I don't see any problemjrgonzalez
01/12/2019, 11:12 PMclosureOf<ExternalModuleDependency> { }
? 😅Dependencies.retrofitSimpleXml(this)
?gildor
01/12/2019, 11:14 PMAlso the config does not work easily, it expects a Closure<Any>Just create dependency, cast it to ExternalDependency and use apply to configure
jrgonzalez
01/12/2019, 11:19 PMfun retrofit2ConverterSimpleXML(dependencyHandler: DependencyHandler): Dependency =
dependencyHandler.create(
"com.squareup.retrofit2:converter:-simplexml${Versions.retrofit}", closureOf<ExternalModuleDependency> {
exclude(module = "stax-api")
exclude(module = "stax")
exclude(module = "xpp3")
})
implementation(Dependencies.retrofitConverterSimplexml(this))
gildor
01/12/2019, 11:21 PMjrgonzalez
01/12/2019, 11:23 PMfun retrofit2ConverterSimpleXML(dependencyHandler: DependencyHandler): Dependency =
(dependencyHandler.create(
"com.squareup.retrofit2:converter:-simplexml${Versions.retrofit}"
) as ExternalDependency).apply {
exclude(module = "stax-api")
exclude(module = "stax")
exclude(module = "xpp3")
}
gildor
01/12/2019, 11:23 PMjrgonzalez
01/12/2019, 11:23 PMgildor
01/12/2019, 11:23 PMjrgonzalez
01/12/2019, 11:24 PMfun DependencyHandler.`implementation`(dependencyNotation: Any): Dependency?
fun <T : ModuleDependency> DependencyHandler.`implementation`(
dependency: T,
dependencyConfiguration: T.() -> Unit
): T
gildor
01/12/2019, 11:25 PMadd("implementation", dependency)
jrgonzalez
01/12/2019, 11:27 PMgildor
01/12/2019, 11:28 PMjrgonzalez
01/12/2019, 11:29 PMgildor
01/12/2019, 11:30 PMjrgonzalez
01/12/2019, 11:30 PMfun <T : ModuleDependency> DependencyHandler.`implementation`(
dependency: T,
dependencyConfiguration: T.() -> Unit
): T
gildor
01/12/2019, 11:31 PMjrgonzalez
01/12/2019, 11:31 PMgildor
01/12/2019, 11:31 PMjrgonzalez
01/12/2019, 11:32 PMimplementation(Dependencies.retrofitConverterSimplexml(this), {})
implementation(Dependencies.retrofitConverterSimplexml(this), {})
^ None of the following functions can be called with the arguments supplied:
public fun <T : Dependency> DependencyHandler.implementation(dependency: TypeVariable(T), action: Action<TypeVariable(T)>): TypeVariable(T) defined in org.gradle.kotlin.dsl
public fun DependencyHandler.implementation(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ..., dependencyConfiguration: Action<ExternalModuleDependency>? = ...): ExternalModuleDependency defined in org.gradle.kotlin.dsl
public fun DependencyHandler.implementation(dependencyNotation: String, dependencyConfiguration: Action<ExternalModuleDependency>): ExternalModuleDependency defined in org.gradle.kotlin.dsl
gildor
01/12/2019, 11:35 PMjrgonzalez
01/12/2019, 11:36 PMgildor
01/12/2019, 11:36 PMjrgonzalez
01/12/2019, 11:36 PMgildor
01/12/2019, 11:37 PMjrgonzalez
01/12/2019, 11:37 PMgildor
01/12/2019, 11:37 PMadd()
, it probably also will workadd
Imo just destroying all the idea of type safe dependency definitionjrgonzalez
01/12/2019, 11:41 PMimplementation(Dependencies.retrofitConverterSimplexml) {
exclude(module = "stax-api")
exclude(module = "stax")
exclude(module = "xpp3")
}
gildor
01/12/2019, 11:53 PMjrgonzalez
01/12/2019, 11:56 PMwithGroovyBuilder { "implementation(${Dependencies.retrofit2ConverterSimpleXML(this@dependencies)})"
}
gildor
01/13/2019, 1:19 AMjrgonzalez
01/13/2019, 9:36 AMisTransitive = true
which I am not sure if it has a global way.gildor
01/13/2019, 9:59 AMjrgonzalez
01/13/2019, 10:30 AMisTransitive
either.gildor
01/13/2019, 10:38 AMjrgonzalez
01/13/2019, 11:06 AMimplementation("com.twitter.sdk.android:tweet-composer:3.3.0@aar") {
isTransitive = true
}
com.twitter.sdk.android.core
packagegildor
01/13/2019, 11:17 AM<@U27HSU2U9>
and isTransitivejrgonzalez
01/13/2019, 11:40 AM@aar
also should get rid of it. I thought it was something to distinguish aar vs jar or something like that.implementation(Dependencies.twitterSdkTweetComposer)
🎉gildor
01/14/2019, 5:49 AM