Questions tagged [gradle-kotlin-dsl]

Kotlin language support for Gradle build scripts.

Gradle build scripts have historically been written in Groovy. The Gradle Kotlin DSL project was created to create statically typed, clear, concise,and descriptive build scripts with awesome IDE support.

Build scripts are written in the Kotlin programming language, but using a Kotlin DSL (domain specific language) designed specifically to support building software.

Questions that belong here:

  • What causes a specific build script error?
  • How to convert a specific construct of a Groovy build script to its Kotlin equivalent?
  • How to achieve a specific processing task in your Kotlin build script?

Do not use this tag for general gradle questions.

Note: Before version 0.10.1 the "Gradle Kotlin DSL" project was called "Gradle Script Kotlin".

1145 questions
0
votes
2 answers

How to get the exact copy of original Run task in Gradle?

Does anybody know what the simplest way to register several run tasks that represent exact copy of original one with changed app’s arguments ? Or may be how to supply run task with an optional argument that would represent app’s…
0
votes
1 answer

what's the benefits of using gradle on kotlin and android project?

i'm new on a kotlin developpment, i'm working on a mobile App on android studio and i use kotlin as language. so i wanted to know what's the importence of gradle by using tke kotlin and android?
user10445861
0
votes
1 answer

In gradle dependencies, why API configurations discards all transitive dependencies?

I have a gradle project that contains 2 subprojects: common & demo. The common project depends on a published library: dependencies { implementation("eu.timepit:singleton-ops_${vs.scalaBinaryV}:0.5.0") ... The demo project depends on common as…
tribbloid
  • 4,026
  • 14
  • 64
  • 103
0
votes
1 answer

After updating Android Studio to 4.0, it is unable to sync any project

Am receiving following issue: FAILURE: Build failed with an exception. * What went wrong: No model of type 'DummyModel' is available in this build. > No builders are available to build a model of type…
0
votes
1 answer

Calling a function declared in a third part gradle file from within the buildscript construct

I;m porting to Grade Kotlin Script the following: buildscript { repositories { maven { url = URI("https://plugins.gradle.org/m2/") } } dependencies { apply(from =…
elect
  • 6,765
  • 10
  • 53
  • 119
0
votes
0 answers

how can I enable the junit 5 unicode theme using gradle?

When using the ConsoleLauncher with the unicode theme enabled, execution of RepeatedTestsDemo results in the following output to the console. ├─ RepeatedTestsDemo ✔ │ ├─ repeatedTest() ✔ │ │ ├─ repetition 1 of 10 ✔ how can I enable the unicode…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
0
votes
1 answer

Cannot assign reason to dependency

I try to add a reason to a dependency like: implementation("foo:bar:0.1.0") { reason = "test" } But get an error, stating that "val cannot be reassigned". I can't find the source I got this from, but from my memory this was the way. What am I…
sschrass
  • 7,014
  • 6
  • 43
  • 62
0
votes
1 answer

How to convert "sourceSet" of Groovy -> Kotlin DSL (Gradle)?

Here is the sourceSet which I want to convert into Kotlin Gradle DSL. Basically it excludes all other directories inside src/main/resources/ except 'templates' and 'fonts'. sourceSets { main { resources { include…
Animesh Sahu
  • 7,445
  • 2
  • 21
  • 49
0
votes
1 answer

Spring Boot Application Deployment Issue

Hi Friends, I'm new to the spring boot framework. i have completed simple spring boot application so i'm going to deploy spring application in my server (Windows 10 64 Bits) I'm Using Gradle as my project build tool I'm Trying to get Jar / War File…
0
votes
1 answer

Why is springBoot {} not found?

I have a build script that looks something like this: plugins { id("org.springframework.boot") version "2.2.2.RELEASE" apply false id("io.spring.dependency-management") version "1.0.9.RELEASE" apply false id("java") } repositories { …
Marlon Ou
  • 471
  • 1
  • 6
  • 19
0
votes
1 answer

Kotlin delegation gradle task

I have something like this: fun doSomething(specifyInput: Base.() -> Unit) { val spec = BaseImpl() spec.apply { specifyInput() validate() } interface Base { var a: String? var b: String? } class…
borac
  • 19
  • 5
0
votes
1 answer

Add files to Gradle sourceSets in Kotlin DSL

I have started using Kotlin DSL in my Gradle builds. Before I could write the following in Groovy DSL: sourceSets.main.resources.srcDirs("src/main/resources").includes.addAll(["**/*.*"]) How can I write this in Kotlin DSL?
grustamli
  • 396
  • 4
  • 16
0
votes
1 answer

Kotlin Multiplatform: use Android specific libs inside 'androidMain'

I followed the Targeting iOS and Android with Kotlin Multiplatform tutorial and was able to setup the working project for both ios and android. As a next step I want to use android specific libs inside src/androidMain/. Example: package…
IIIIIIIIIIIIIIIIIIIIII
  • 3,958
  • 5
  • 45
  • 70
0
votes
1 answer

How to convert private signing information to Kotlin DSL?

I'm in the process of migrating to Kotlin DSL. I have followed most of the popular blogs out there to set it up initially. Now it's time to refactor build.gradle file. I have private signing information logic as shown below. if…
Renjith
  • 3,457
  • 5
  • 46
  • 67
0
votes
1 answer

Android studio compilation error from kotlin

I tried compiling android but it gives me the following error FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugResources'. > Could not resolve all files for configuration…