gradle-kotlin-dsl

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

て烟熏妆下的殇ゞ 提交于 2020-06-01 07:40:57
问题 I;m porting to Grade Kotlin Script the following: buildscript { repositories { maven { url = URI("https://plugins.gradle.org/m2/") } } dependencies { apply(from = "https://raw.githubusercontent.com/i-net-software/SetupBuilder/master/scripts/SetupBuilderVersion.gradle") classpath("gradle.plugin.de.inetsoftware:SetupBuilder:" + setupBuilderVersion()) classpath "gradle.plugin.io.sdkman:gradle-sdkvendor-plugin:1.2.1" } } where setupBuilderVersion() is a function defined in SetupBuilderVersion

How do you add local .jar file dependency to build.gradle.kt file?

南笙酒味 提交于 2020-05-29 04:17:04
问题 I have gone through similar questions regarding build.gradle and I have looked through the Gradle Kotlin Primer and I don't see how to add a .jar file to a build.gradle.kt file. I am trying to avoid using mavenLocal() 回答1: If you are looking for the equivalent of implementation fileTree(dir: 'libs', include: ['*.jar']) that would be: implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) 回答2: For Kotlin dsl in gradle 5.4.1 with build.gradle.kts use implementation(files

Kotlin DSL build scripts dependency updates

十年热恋 提交于 2020-05-27 04:13:51
问题 There has been a myriad of articles written about how migrating from using groovy scripts to using Kotlin DSL for Gradle dependency management is an ideal way to manage build scripts among other mentioned advantages. However, the limitation that I have found is the lack of this Gradle management way or process in highlighting when new versions of the current dependencies are available as was done previously using groovy scripts. The current solutions that I have found include the use of

Kotlin DSL build scripts dependency updates

那年仲夏 提交于 2020-05-27 04:11:32
问题 There has been a myriad of articles written about how migrating from using groovy scripts to using Kotlin DSL for Gradle dependency management is an ideal way to manage build scripts among other mentioned advantages. However, the limitation that I have found is the lack of this Gradle management way or process in highlighting when new versions of the current dependencies are available as was done previously using groovy scripts. The current solutions that I have found include the use of

Kotlin DSL build scripts dependency updates

谁都会走 提交于 2020-05-27 04:10:21
问题 There has been a myriad of articles written about how migrating from using groovy scripts to using Kotlin DSL for Gradle dependency management is an ideal way to manage build scripts among other mentioned advantages. However, the limitation that I have found is the lack of this Gradle management way or process in highlighting when new versions of the current dependencies are available as was done previously using groovy scripts. The current solutions that I have found include the use of

Spring Boot Application Deployment Issue

こ雲淡風輕ζ 提交于 2020-05-17 03:43:47
问题 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 Using the following Commands ./gradlew war ./gradlew bootWar ./gradlew bootJar I'm Successfully Getting Jar/War Files But I'm Try to Run the file using following Command java -jar application.jar But i'm getting the Following Error: Exception in

How to enable helpful NullPointerExceptions in gradle test

拜拜、爱过 提交于 2020-05-14 18:16:46
问题 I want to put the flag -XX:+ShowCodeDetailsInExceptionMessages to enable helpful NPEs (https://openjdk.java.net/jeps/358) on the tests I tried tasks.withType<Test> { jvmArgs("-XX:+ShowCodeDetailsInExceptionMessages") testLogging { setExceptionFormat("full") // Prints the message of the exception } } But the NPEs have still no messages. Here's my java version java -version openjdk version "14.0.1" 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7) OpenJDK 64-Bit Server VM (build 14.0.1+7,

How to enable helpful NullPointerExceptions in gradle test

戏子无情 提交于 2020-05-14 18:16:27
问题 I want to put the flag -XX:+ShowCodeDetailsInExceptionMessages to enable helpful NPEs (https://openjdk.java.net/jeps/358) on the tests I tried tasks.withType<Test> { jvmArgs("-XX:+ShowCodeDetailsInExceptionMessages") testLogging { setExceptionFormat("full") // Prints the message of the exception } } But the NPEs have still no messages. Here's my java version java -version openjdk version "14.0.1" 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7) OpenJDK 64-Bit Server VM (build 14.0.1+7,

Setting environment variables in build.gradle.kts

China☆狼群 提交于 2020-05-13 14:54:11
问题 In groovy you can set environment variables with environment key value . For example for run you can do: run { environment DB_HOST "https://nowhere" } How can I accomplish this in Kotlin in build.gradle.kts? 回答1: Like this: tasks { "run"(JavaExec::class) { environment("DB_HOST","https://nowhere") } } Or if you like the delegation property style: val run by tasks.getting(JavaExec::class) { environment("DB_HOST","https://nowhere") } 来源: https://stackoverflow.com/questions/53222927/setting

Configure Jacoco with gradle and kotlin DSL

江枫思渺然 提交于 2020-05-11 19:02:02
问题 I'm trying to configure Jacoco to exclude some classes from analysis but can't find any working example :( I found some samples with afterEvaluate but no success 回答1: src/main/java/org/example/A.java : package org.example; class A { } src/main/java/org/example/B.java : package org.example; class B { } src/test/java/org/example/ExampleTest.java : package org.example; public class ExampleTest { @org.junit.Test public void test() { new A(); new B(); } } build.gradle.kts : plugins { java jacoco }