gradle-kotlin-dsl

Kotlin DSL Unresolved reference on settings.gradle.ktl

空扰寡人 提交于 2021-01-28 14:41:30
问题 I am getting an unresolved reference build error on settings.gradle.kts when I am referencing variables from the buildSrc module. The strange thing is that when I am using the variables from buildSrc, for example to the app level build.gradle.kts, everything works fine. Also the error occurs only when I build/sync and I am not getting that error(red highlights) on the text editor and the navigation to that variable works fine. Attached you find an image with the setup, thanks a lot. Edit:

Convert to gradle-kotlin-dsl Jfrog.Artifactory config

独自空忆成欢 提交于 2021-01-24 09:21:22
问题 I'm trying to migrate from groovy to gradle-kotlin dsl, but I'm new to it, so I dont know how to configure Jfrog Artifactory. Please help me with converting that part of code to gradle-kotlin dsl: task sourceJar(type: Jar) { from sourceSets.main.allJava } artifactory { contextUrl = "http://10.0.0.49:8081/artifactory" publish { repository { repoKey = 'gradle-dev-local' username = artifactory_username password = artifactory_password } defaults { publications('mavenJava') publishArtifacts = true

Convert to gradle-kotlin-dsl Jfrog.Artifactory config

佐手、 提交于 2021-01-24 09:20:11
问题 I'm trying to migrate from groovy to gradle-kotlin dsl, but I'm new to it, so I dont know how to configure Jfrog Artifactory. Please help me with converting that part of code to gradle-kotlin dsl: task sourceJar(type: Jar) { from sourceSets.main.allJava } artifactory { contextUrl = "http://10.0.0.49:8081/artifactory" publish { repository { repoKey = 'gradle-dev-local' username = artifactory_username password = artifactory_password } defaults { publications('mavenJava') publishArtifacts = true

Convert to gradle-kotlin-dsl Jfrog.Artifactory config

≡放荡痞女 提交于 2021-01-24 09:19:16
问题 I'm trying to migrate from groovy to gradle-kotlin dsl, but I'm new to it, so I dont know how to configure Jfrog Artifactory. Please help me with converting that part of code to gradle-kotlin dsl: task sourceJar(type: Jar) { from sourceSets.main.allJava } artifactory { contextUrl = "http://10.0.0.49:8081/artifactory" publish { repository { repoKey = 'gradle-dev-local' username = artifactory_username password = artifactory_password } defaults { publications('mavenJava') publishArtifacts = true

Convert to gradle-kotlin-dsl Jfrog.Artifactory config

梦想与她 提交于 2021-01-24 09:18:21
问题 I'm trying to migrate from groovy to gradle-kotlin dsl, but I'm new to it, so I dont know how to configure Jfrog Artifactory. Please help me with converting that part of code to gradle-kotlin dsl: task sourceJar(type: Jar) { from sourceSets.main.allJava } artifactory { contextUrl = "http://10.0.0.49:8081/artifactory" publish { repository { repoKey = 'gradle-dev-local' username = artifactory_username password = artifactory_password } defaults { publications('mavenJava') publishArtifacts = true

Gradle Kotlin DSL: access objects defined in settings.gradle.kts

 ̄綄美尐妖づ 提交于 2021-01-05 13:23:46
问题 I have objects I define in settings.gradle.kts . How can I get them from build.gradle.kts ? With the groovy DSL, I could put these objects in gradle.ext , but the gradle object doesn't seem to support extra in the Kotlin DSL (using Gradle 5.2). 回答1: You could access extension objects using following code: (gradle as ExtensionAware).extra["myObject"] 回答2: I realize this is a bit old of a post, but I just struggled with this for the last 2 weeks. Hopefully it'll help the next poor developer

Gradle Kotlin DSL: access objects defined in settings.gradle.kts

╄→гoц情女王★ 提交于 2021-01-05 13:23:45
问题 I have objects I define in settings.gradle.kts . How can I get them from build.gradle.kts ? With the groovy DSL, I could put these objects in gradle.ext , but the gradle object doesn't seem to support extra in the Kotlin DSL (using Gradle 5.2). 回答1: You could access extension objects using following code: (gradle as ExtensionAware).extra["myObject"] 回答2: I realize this is a bit old of a post, but I just struggled with this for the last 2 weeks. Hopefully it'll help the next poor developer

Gradle Kotlin DSL: access objects defined in settings.gradle.kts

喜夏-厌秋 提交于 2021-01-05 13:23:22
问题 I have objects I define in settings.gradle.kts . How can I get them from build.gradle.kts ? With the groovy DSL, I could put these objects in gradle.ext , but the gradle object doesn't seem to support extra in the Kotlin DSL (using Gradle 5.2). 回答1: You could access extension objects using following code: (gradle as ExtensionAware).extra["myObject"] 回答2: I realize this is a bit old of a post, but I just struggled with this for the last 2 weeks. Hopefully it'll help the next poor developer

SourceSets - Groovy -> Kotlin DSL

久未见 提交于 2021-01-05 06:49:57
问题 sourceSets { main { java.srcDirs = ['src/main/kotlin', 'src/main/java'] res.srcDirs = [ 'src/main/res/layouts/activity', 'src/main/res/layouts/fragment', 'src/main/res/layouts/dialog', 'src/main/res/layouts/items', 'src/main/res/layouts/views', 'src/main/res/layouts', 'src/main/res' ] } } Here for java.srcDirs we convert it in kotlin DSL like java.sourceSets { getByName("main").java.srcDirs("src/main/kotlin") } But I don't know how to change sub folders within 'layout' res folder code in DSL

SourceSets - Groovy -> Kotlin DSL

試著忘記壹切 提交于 2021-01-05 06:46:25
问题 sourceSets { main { java.srcDirs = ['src/main/kotlin', 'src/main/java'] res.srcDirs = [ 'src/main/res/layouts/activity', 'src/main/res/layouts/fragment', 'src/main/res/layouts/dialog', 'src/main/res/layouts/items', 'src/main/res/layouts/views', 'src/main/res/layouts', 'src/main/res' ] } } Here for java.srcDirs we convert it in kotlin DSL like java.sourceSets { getByName("main").java.srcDirs("src/main/kotlin") } But I don't know how to change sub folders within 'layout' res folder code in DSL