leandro
11/12/2022, 3:13 PMafterEvaluate {}
? I wonder mostly in terms of correctness and performanceserver
11/12/2022, 9:45 PMBonsible Hou
11/14/2022, 3:18 AMjean
11/15/2022, 9:31 PMinto
location
tasks.register<Copy>("copyIosTestResources") {
from("src/commonTest/resources")
into("build/bin/iosX64/debugTest/resources")
}
tasks.findByName("iosX64Test")!!.dependsOn("copyIosTestResources")
But if I try to do the same for my js target with this
tasks.register<Copy>("copyJsTestResources") {
from("src/commonTest/resources")
into("build/js/test/resources")
}
tasks.findByName("jsTest")!!.dependsOn("copyJsTestResources")
I tried a bunch of different values for into
but it doesn’t seem to work at all. Any idea why?dave08
11/17/2022, 12:46 PMdave08
11/17/2022, 12:50 PM// in the root build.gradle.kts:
tasks.named<Test>("test") {
useJUnitPlatform()
testLogging {
showExceptions = true
showStandardStreams = true
exceptionFormat = FULL
}
}
hfhbd
11/17/2022, 2:30 PMpom
dependency for each dependency, transitively. At the moment, this is done in the task action, so the pom dependency is added during the task action, but this breaks the configuration cache. I moved the additional pom file dependency to the configuration stage, but now I have a problem with module substitution: Adding a dependency substitution rule to a configuration changes the timing of when that configuration is resolved.
Is there any workaround possible? https://github.com/cashapp/licensee/pull/141escodro
11/17/2022, 8:29 PM// detekt.gradle.kts
apply<DetektPlugin>()
configure<DetektExtension> {
config = files("$rootDir/config/filters/detekt.yml")
allRules = true
}
tasks.withType<Detekt>().configureEach {
exclude("**/resources/**,**/build/**")
}
Bonsible Hou
11/18/2022, 12:58 PMWARNING:/Users/alger/.jenkins/object_android_apk_pack_gradle7/VeSync_RN/android/app/build/intermediates/transforms/sensorsAnalyticsAutoTrack/check/releaseStaging/57.jar: R8: Expected stack map table for method with non-linear control flow. In later version of R8, the method may be assumed not reachable.
Pavel Meledin
11/20/2022, 11:32 AMtestImplementation
dependency on Gradle API
triggers a conflict of loggers and blocks further work, since SLF4J: Class path contains multiple SLF4J bindings.
Is it possible to “cut off” the gradle logger so it won’t be on the classpath?
Some context related details:
• It’s added just as a dependency testImplementation(gradleApi())
• The goal of adding Gradle API is for enabling an ability to run some custom gradle tasks during integration/end-to-end testing (I’m using JUnit)
• It doesn’t seem possible to exclude the logger as it’s built-in into the Gradle source, so it seems not even a dedicated module that could be possible to just exclude from the build 🤷♂️
an error messages:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:$HOME/.gradle/caches/7.5/generated-gradle-jars/gradle-api-7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:$HOME/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.11/4741689214e9d1e8408b206506cbe76d1c6a7d60/logback-classic-1.2.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See <http://www.slf4j.org/codes.html#multiple_bindings> for an explanation.
SLF4J: Actual binding is of type [org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext]
...
Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext loaded from file:$HOME/.gradle/caches/7.5/generated-gradle-jars/gradle-api-7.5.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext
...
Please suggest what are the options to resolve this conflict which 🙏janvladimirmostert
11/20/2022, 3:47 PMgradle build -t
allows you to always automatically build when you make changes
is there a way to automatically restart an application after a rebuild?
I was trying
gradle run -t
which is running the application, but it doesn't rebuild and restart when making changes.Carl Benson
11/22/2022, 9:49 AMJavier
11/23/2022, 1:17 PMe: java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.NoClassDefFoundError: org/jetbrains/kotlin/daemon/common/CompileService$CallResult$Dying
Could not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.
huehnerlady
11/23/2022, 4:14 PMallWarningsAsErrors
I do not want that in general, just on my local machine (as this would also fire when there are deprecations)
Currently my file includes:
allprojects {
afterEvaluate {
if (tasks.findByName("compileKotlin") == null) {
logger.lifecycle("[init.gradle.kts] no kotlin project")
}
else {
logger.lifecycle("[init.gradle.kts] adding 'allWarningsAsErrors = true'")
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
allWarningsAsErrors = true
}
}
}
}
}
When I run my project it is showing the [init.gradle.kts] adding 'allWarningsAsErrors = true'
log message, but the warnings do not make the build fail. if I add that flag to the build script, it does fail.
Any idea what I am doing wrong?David Rawson
11/25/2022, 3:53 AMmudasar187
11/25/2022, 12:32 PM./gradlew shadowJar
, it appears two jars files. One named app.jar and another named sokos-ktor-template.jar. Why do i get two jars ?
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask
val ktorVersion = "2.1.3"
val junitJupiterVersion = "5.9.1"
val logbackVersion = "1.4.4"
val logstashVersion = "7.2"
val jacksonVersion = "2.14.0"
val prometheusVersion = "1.10.0"
val kotlinLoggingVersion = "3.0.4"
plugins {
kotlin("jvm") version "1.7.21"
kotlin("plugin.serialization") version "1.7.21"
id("org.openapi.generator") version "6.2.1"
id("com.github.johnrengelman.shadow") version "7.1.2"
}
group = "no.nav.sokos.prosjektnavn"
java.sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
maven { url = uri("<https://maven.pkg.jetbrains.space/public/p/ktor/eap>") }
}
dependencies {
// Ktor
implementation("io.ktor:ktor-server-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-netty-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-server-metrics-micrometer:$ktorVersion")
implementation("io.ktor:ktor-server:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
// Jackson
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
// Monitorering
implementation("io.micrometer:micrometer-registry-prometheus:$prometheusVersion")
// Logging
implementation("ch.qos.logback:logback-core:$logbackVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashVersion")
implementation("io.github.microutils:kotlin-logging-jvm:$kotlinLoggingVersion")
// Test
testImplementation("io.ktor:ktor-server-tests-jvm:$ktorVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
}
sourceSets {
main {
java {
srcDirs("$buildDir/generated/src/main/kotlin")
}
}
}
tasks.named<GenerateTask>("openApiGenerate") {
generatorName.set("kotlin")
generateModelDocumentation.set(false)
inputSpec.set("$rootDir/specs/pets.json")
outputDir.set("$buildDir/generated")
globalProperties.set(
mapOf(
"models" to ""
)
)
configOptions.set(
mapOf(
"library" to "jvm-ktor",
"serializationLibrary" to "jackson"
)
)
}
tasks.named<ShadowJar>("shadowJar") {
archiveFileName.set("app.jar")
manifest {
attributes["Main-Class"] = "no.nav.sokos.prosjektnavn.BootstrapKt"
}
}
tasks.withType<KotlinCompile> {
dependsOn("openApiGenerate")
kotlinOptions.jvmTarget = "17"
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
exceptionFormat = FULL
events("passed", "skipped", "failed")
}
// For å øke hastigheten på build kan vi benytte disse metodene
maxParallelForks = Runtime.getRuntime().availableProcessors() / 2
reports.forEach { report -> report.required.value(false) }
}
Ayfri
11/25/2022, 4:25 PMPiotr Krzemiński
11/25/2022, 10:29 PMMultiple incompatible variants
error: https://pastebin.com/t3tx8SCy. See the PR to reproduce: https://github.com/krzema12/github-workflows-kt/pull/569Gabi
11/26/2022, 1:23 AMbuildSrc
file is simply:
plugins {
`kotlin-dsl`
}
repositories {
maven("<https://plugins.gradle.org/m2/>")
mavenCentral()
}
Can anyone help me?Karthick
11/26/2022, 3:10 AMRequired by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.21.
Caused by: org.gradle.api.resources.ResourceException: Could not get resource '<https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-scripting-compiler-impl-embeddable/1.7.21/kotlin-scripting-compiler-impl-embeddable-1.7.21.pom>'.
Cert validation is failing for
Caused by: org.gradle.api.resources.ResourceException: Could not get resource '<https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-scripting-compiler-impl-embeddable/1.7.21/kotlin-scripting-compiler-impl-embeddable-1.7.21.pom>'.
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET '<https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-scripting-compiler-impl-embeddable/1.7.21/kotlin-scripting-compiler-impl-embeddable-1.7.21.pom>'.
my config
➜ ~ java -version
openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 17.0.5+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.5+0, mixed mode, sharing)
➜ ~ gradle -v
------------------------------------------------------------
Gradle 7.6
------------------------------------------------------------
Build time: 2022-11-25 13:35:10 UTC
Revision: daece9dbc5b79370cc8e4fd6fe4b2cd400e150a8
Kotlin: 1.7.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.5 (Homebrew 17.0.5+0)
OS: Mac OS X 12.6.1 aarch64
➜ ~
I am using IntelliJ IDEA 2022.2.4 (Community Edition)
Is anyone facing this issue?Emil Kantis
11/26/2022, 2:02 PM* What went wrong:
A problem occurred configuring project ':kotest-framework:kotest-framework-multiplatform-plugin-gradle'.
> Failed to notify project evaluation listener.
> org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin: Provider org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverGradleSubplugin not a subtype
> org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin: Provider org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverGradleSubplugin not a subtype
Shabinder Singh
11/26/2022, 10:08 PMAdam S
11/27/2022, 10:20 AMtapchicoma
11/28/2022, 9:49 AMkotlin-dsl
plugins after updating to Gradle 7.6 should also add id("org.jetbrains.kotlin.plugin.sam.with.receiver") version "<kotlin_version>"
into plugins { .. }
block. Related issue that should be fixed in Kotlin 1.8.20 release.Tianyu Zhu
11/29/2022, 9:59 PMjava.targetCompatibility = JavaVersion.1_8
Is there a similar way I can set the jvmTarget
for my Kotlin code?Carter
11/30/2022, 11:52 AMeygraber
12/04/2022, 9:17 PMjvmToolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.jdk.get()))
vendor.set(JvmVendorSpec.AZUL)
}
Amanda Martin
12/05/2022, 4:11 PMjoney
12/07/2022, 2:58 PMjava.lang.UnsupportedOperationException: Unsupported receiver value: Cxt { context(org.gradle.api.Project) [...]
FunkyMuse
12/08/2022, 3:46 PMFunkyMuse
12/08/2022, 3:46 PMChris Lee
12/08/2022, 4:00 PMFunkyMuse
12/08/2022, 6:04 PMorg.json.simple.*
isn’t availableChris Lee
12/08/2022, 6:05 PMAdam S
12/08/2022, 6:14 PMorg.json.simple.*
, so this isn’t particular to Gradle 8. My guess is that you used to have a Gradle plugin that had a dependency on org.json, but you haven’t applied the plugin, or the plugin has been updated to remove that dependency.
If you want to add the JSON library back, you can either do it in ./buildSrc/build.gradle.kts
, or as a buildscript dependency.
Alternatively, Groovy can process JSONFunkyMuse
12/08/2022, 6:30 PM