Joey Heck
10/12/2018, 4:30 PMappToken { ApplicationVariant variant ->
switch (variant.buildType.name) {
case 'develop': 'XXXX'
break
case 'release': 'YYYY'
break
}
}
How can I access the same specific ApplicationVariant? The only thing I could think of was to use android.applicationVariants.first()
, but I get Build Failure error: Collection is empty.jcechace
10/14/2018, 9:32 AMbuild.gradle.kts
work? What I need is esentially a kotlin-dsl gradle project with latest ktorNikky
10/14/2018, 6:06 PMjlleitschuh
10/15/2018, 8:45 PMktlint-gradle
plugin author here.
What are you actually trying to achieve here?CamilleBC
10/16/2018, 9:29 AMEarly Access Preview 1.3
.
My project build.gradle has
buildscript {
ext.kotlin_version = '1.3.0-rc-146'
repositories {
google()
jcenter()
maven { url '<https://dl.bintray.com/kotlin/kotlin-eap>' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
But I cannot resolve this line in my app build.gradle: implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
It fails with the following message: Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0-rc-146
Do you now how to implement the stdlib for kotlin in the gradle file? I've been to MVN repository (https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib/1.3.0-rc-146) and used their gradle line.
It still displays Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib:1.3.0-rc-146
.
Help? 😄Nikky
10/16/2018, 9:32 AMNikky
10/16/2018, 1:27 PMbuildSrc
also helps with thatjmfayard
10/16/2018, 1:41 PMjmfayard
10/16/2018, 1:48 PMDias
10/16/2018, 3:41 PMbuildscript {
repositories {
jcenter()
maven { url "<https://packages.dns.ad.zopa.com/artifactory/maven-libs-virtual>" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71"
}
}
ribesg
10/18/2018, 10:32 AMkotlin-dsl
? IntelliJ keeps saying my function has no bodyrocketraman
10/19/2018, 4:53 AMenleur
10/19/2018, 9:04 AMval SourceSet.kotlin: SourceDirectorySet
get() = withConvention(KotlinSourceSet::class){ kotlin }
sourceSets {
getByName("main") {
kotlin.srcDirs("src")
resources.srcDirs("resources")
}
getByName("test") {
kotlin.srcDirs("test")
resources.srcDirs("testresources")
}
}
jmfayard
10/19/2018, 11:32 AMfun Project.doSomethingCool()
that would also works in a Groovy build.gradle
file?
Have a look at this pattern: project.kt.doSomethingCool()
https://github.com/jmfayard/gradledemo/commit/896ea008fea9d792d69dad122addc76d09ebce54JoeHegarty
10/19/2018, 8:58 PMKotlinBasePluginWrapper
is in Kotlin but obviously the majority of plugins are Groovy.
Are there any gotchas? Specifically around the fact that I assume Kotlin is already in the classpath in Gradle due to the DSL? Are there any lightweight examples of how to set up a project for this?Johan Vergeer
10/20/2018, 10:23 AMzachtib
10/20/2018, 12:30 PMPaul Woitaschek
10/21/2018, 7:16 AMNikky
10/21/2018, 12:48 PMdsvoronin
10/22/2018, 1:13 PMpluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("org.jetbrains.kotlin")) {
useVersion(kotlinVersion)
}
}
}
}
dsvoronin
10/22/2018, 1:16 PMsettings.gradle.kts
jcechace
10/22/2018, 1:17 PMeskatos
10/22/2018, 6:13 PMNikky
10/23/2018, 9:46 AMdsvoronin
10/23/2018, 12:50 PMorg.gradle.tooling.BuildException: Could not fetch model of type 'KotlinBuildScriptModel' using Gradle installation '/Users/dsvoronin/.gradle/wrapper/dists/gradle-4.10.2-bin/em75h4kbtmi6i8f32m058ve4q/gradle-4.10.2'.
…
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method api() for arguments [com.adjust.sdk:adjust-android-criteo:4.15.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
rewriting groovy script to kts in fact solves issue!
but thats weird, i have alots of groovy scripts in project (150+)dagguh
10/23/2018, 3:58 PMbreandan
10/24/2018, 7:33 AMorg.jetbrains.gradle.plugin.idea-ext
plugin, which required a bunch of trial and error to translate (and the result does not look very natural). Are plugin authors expected to make their API Kotlin DSL friendly, or is there some kind of migration process planned? This was the result: https://github.com/acejump/AceJump/blob/6d06723fc5f590e0b75ea78d260c7f23bc3b87aa/build.gradle.kts#L28:L41octylFractal
10/24/2018, 7:37 AMrunConfigurations
looks like it should extend one of Gradle's standard named collections, and the DSL adds special overrides for that, you should be able to do something like create<...Application>("runIde") { ...
if it doesbreandan
10/24/2018, 7:43 AMjmfayard
10/24/2018, 9:38 AMjmfayard
10/24/2018, 9:38 AMgildor
10/24/2018, 10:26 AMjmfayard
10/24/2018, 10:34 AM