Questions tagged [kotlin-dsl]

68 questions
0
votes
1 answer

Kotlin DSL migration project gradle build

I am migrating to kotlin DSL And this is my project level build gradle // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id 'com.android.application' version '7.2.2' apply false id…
WISHY
  • 11,067
  • 25
  • 105
  • 197
0
votes
0 answers

How to set Manifest's attributes in Gradle 8.x and Kotlin DSL

Recently I created a project in Kotlin that used Kotlin DSL for the build.gradle.kts file and I used Gradle 7.4.2 but after upgrading to 8.0.2 I'm unable to set attributes for manifest. I did that to set the main class for creating the jar file. A…
YaMiN
  • 3,194
  • 2
  • 12
  • 36
0
votes
0 answers

How to call closure from Kotlin DSL

I have a Gradle plugin in Groovy which has a setter method void setDynamicTokens(Map dynamicTokens) { this.dynamicTokens = dynamicTokens .collectEntries { k, v -> [(k): [refId: { v.refId }, defaultValue: {…
0
votes
0 answers

Configuring/Executing specific Modules in Gradle

I'm trying to only configure and execute one specific module of Gradle. The configuration step in the build contains module-specific things that will cause one module to fail if not executed against a specific environment (e.g. One Module is…
0
votes
1 answer

Can't pass password from credentialsJSON to commitStatusPublisher (bitbucket server) Teamcity

It seems that i have an old version of commitStatusPublisher plugin and it can't convert credentialsJSON string to its value. In any other situation I can access password with params.findRawParam("env.mypass")!!.value or in buildstep, script…
Sandzhaj
  • 53
  • 6
0
votes
1 answer

Adding custom data-* attributes to tags while using the new(non-legacy) kotlin react wrappers

What's the equivalent of this:
...
in react kotlin dsl non-legacy wrapper.
pnetm
  • 15
  • 4
0
votes
0 answers

Android - Conditional execution of externalNativeBuild possible?

Using Kotlin DSL, does anyone know how I can tell Gradle to only execute the instructions in my library module's externalNativeBuild block if a) CMakeLists.txt is present? or b) based on buildType (debug no, release yes). I've tried moving the…
michpohl
  • 852
  • 8
  • 30
0
votes
1 answer

grpc kotlin plugin is not generating dsl code

I have an existing project which is using gradle with kotlin DSL. I have setup protobuf code auto-generation with gradle build. Kotlin grpc code is generated and I am able to implement my backend using flows and coroutines. But the kotlin DSL code…
Gopinath
  • 12,981
  • 6
  • 36
  • 50
0
votes
1 answer

In kotlin what is this syntax: "fun ClassName.funcName(): (Type ) -> Type = {fun body}"

Edited: What and how it work? This is a kotlin dsl language. fun ClassName.funcName(): (Type ) -> Type = {func body} um this is one of the implementation I found, and also see the concrete syntax to this link:…
0
votes
1 answer

Kotlin BuildType 'XYZ': id 'XYZ' is already used in BuildType(uuid='', id='XYZ', name='Deploy to envr') error

I was trying to refactor my Kotlin file that contains the configuration for a TeamCity pipeline. However, I keep getting the following error: BuildType 'KotlinExperiments_DeployToEnvironment': id 'KotlinExperiments_DeployToEnvironment' is already…
0
votes
2 answers

Using "property" in HTML meta data with kotlin DSL

Hey how can i use html content like: with the Kotlin HTML Type Safe builder? I cannot find something like the property variable in the meta function
Infinity_dev
  • 129
  • 1
  • 6
0
votes
1 answer

Kotlin lambdas with receivers: seeking clarification on my mental model

I'm trying to build a good mental model for lambdas with receivers in Kotlin, and how DSLs work. The simples ones are easy, but my mental model falls apart for the complex ones. Part 1 Say we have a function changeVolume that looks like this: fun…
0
votes
1 answer

How to apply plugin from root directory in kotlin dsl

I have a plugin with the name of jacoco-report.gradle.kts in root directory of project(ProjectName/jacoco-report.gradle.kts). Now I want to add this plugin inside the plugins block of submodules. plugins{ //id of jacoco-report.gradle.kts } Can…
0
votes
1 answer

How to use Kotlin's Ktorm to perform WHERE clause operation on custom Postgres "object type" avoiding "PSQLException: ERROR: operator does not exist"

Whilst performing a WHERE clause operation on a custom Postgres "object type" I ended up the following PSQLException. Language: Kotlin. ORM Library: Ktorm ORM. Exception org.postgresql.util.PSQLException: ERROR: operator does not exist: rate =…
DaddyMoe
  • 990
  • 1
  • 14
  • 20
0
votes
2 answers

Kotlin DSL automatically add/generate to MutableList

I've been struggling making DSL to work like this. I'd like to add items inside the lambda to the mutableList inside the persons. Can anybody help with this? persons { Person("name") Person("name second") } the expected result after the…
DTechnlogy
  • 320
  • 4
  • 12