gradle-kotlin-dsl

SourceSets - Groovy -> Kotlin DSL

早过忘川 提交于 2021-01-05 06:46:00
问题 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:45:21
问题 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

Unresolved reference: compileKotlin in build.gradle.kts

大兔子大兔子 提交于 2020-12-30 05:33:27
问题 Kotlin project success build by build.gradle: compileKotlin { kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 } compileTestKotlin { kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 } Nice. But I need to change to build.gradle.kts : plugins { kotlin("jvm") version "1.2.10" id("application") } group = "com.myproject" version = "1.0-SNAPSHOT" application { mainClassName = "MainKt" } java.sourceCompatibility = JavaVersion.VERSION_1_8 repositories { mavenCentral() jcenter() } val kotlinVer = "1

Unresolved reference: compileKotlin in build.gradle.kts

一世执手 提交于 2020-12-30 05:29:27
问题 Kotlin project success build by build.gradle: compileKotlin { kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 } compileTestKotlin { kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 } Nice. But I need to change to build.gradle.kts : plugins { kotlin("jvm") version "1.2.10" id("application") } group = "com.myproject" version = "1.0-SNAPSHOT" application { mainClassName = "MainKt" } java.sourceCompatibility = JavaVersion.VERSION_1_8 repositories { mavenCentral() jcenter() } val kotlinVer = "1

Checker Framework argument.type.incompatible false positive with commons-lang3

给你一囗甜甜゛ 提交于 2020-12-15 03:43:00
问题 Here's my error (and yes there is an open bug on commons-lang3 jira). found : @Initialized @Nullable Console required: @Initialized @NonNull Console /Users/calebcushing/IdeaProjects/ppm/scaf/src/main/java/com/xenoterracide/scaf/PebbleTemplateProcessor.java:96: error: [argument.type.incompatible] incompatible argument for parameter str of toBoolean. if ( BooleanUtils.toBoolean( line ) ) { I tried making this src/java/main/org/apache/commons/lang3/BooleanUtils.astub and I tried putting that

How to use pom type dependency in Gradle

佐手、 提交于 2020-12-11 04:54:07
问题 I need to produce transitive dependency from my Java library which is of type pom. Here is an example on how I'm doing it: plugins { `java-library` `maven-publish` } repositories { // some maven repo } dependencies { // This is POM type dependency: api("org.apache.sshd:apache-sshd:1.6.0") { exclude(group = "org.slf4j") } } publications { create<MavenPublication>("maven") { from(components["java"]) } } The problem with this configuration is that in the published pom.xml of my library the

How to use pom type dependency in Gradle

倖福魔咒の 提交于 2020-12-11 04:49:36
问题 I need to produce transitive dependency from my Java library which is of type pom. Here is an example on how I'm doing it: plugins { `java-library` `maven-publish` } repositories { // some maven repo } dependencies { // This is POM type dependency: api("org.apache.sshd:apache-sshd:1.6.0") { exclude(group = "org.slf4j") } } publications { create<MavenPublication>("maven") { from(components["java"]) } } The problem with this configuration is that in the published pom.xml of my library the

How to use pom type dependency in Gradle

故事扮演 提交于 2020-12-11 04:46:38
问题 I need to produce transitive dependency from my Java library which is of type pom. Here is an example on how I'm doing it: plugins { `java-library` `maven-publish` } repositories { // some maven repo } dependencies { // This is POM type dependency: api("org.apache.sshd:apache-sshd:1.6.0") { exclude(group = "org.slf4j") } } publications { create<MavenPublication>("maven") { from(components["java"]) } } The problem with this configuration is that in the published pom.xml of my library the

How to use pom type dependency in Gradle

我与影子孤独终老i 提交于 2020-12-11 04:46:16
问题 I need to produce transitive dependency from my Java library which is of type pom. Here is an example on how I'm doing it: plugins { `java-library` `maven-publish` } repositories { // some maven repo } dependencies { // This is POM type dependency: api("org.apache.sshd:apache-sshd:1.6.0") { exclude(group = "org.slf4j") } } publications { create<MavenPublication>("maven") { from(components["java"]) } } The problem with this configuration is that in the published pom.xml of my library the

How to configure the processResources task in a Gradle Kotlin build

允我心安 提交于 2020-12-08 15:03:38
问题 I have the following in a groovy-based build script. How do I do the same in a kotlin-based script? processResources { filesMatching('application.properties'){ expand(project.properties) } } 回答1: I think task should look like: Edit : According this comment in gradle/kotlin-dsl repository. Task configuration should work this way: import org.gradle.language.jvm.tasks.ProcessResources apply { plugin("java") } (tasks.getByName("processResources") as ProcessResources).apply { filesMatching(