PHondogo
08/15/2022, 10:02 PMAkram Bensalem
08/19/2022, 9:29 AMAkram Bensalem
08/19/2022, 9:45 AMJi Sungbin
08/19/2022, 1:41 PMandylamax
08/21/2022, 6:01 AMmoltendorf
08/21/2022, 3:18 PMRob Elliot
08/22/2022, 1:47 PMcompileGroovy
to see the Kotlin classes though. Could anyone give me some pointers?Tom Yuval
08/22/2022, 2:04 PM./gradlew allTests
or ./gradlew check
), this doesn’t work when I’ve already run the tests before. What happens is that the first time I run gradlew
it indeed fails because of the failing tests, but then if I run it a second time it doesn’t run the tests again as the tasks are already “up-to-date” – but it also doesn’t fail (as if the tasks being up-to-date is a good enough reason to pass, even though the tasks’ up-to-date state is that they’re failing).
Is there some way to tell Gradle to fail when the “up-to-date” tasks it doesn’t want to run again failed the last time?
Clarification: I’m not asking how to make Gradle rerun the tests – if nothing’s changed since the last run then I’m happy with Gradle considering everything up-to-date and not wasting time re-executing tasks. I just want it to fail (= return with a non-zero exit code) in that state, like it did upon the first run of the failing tests, and not “pretend” that everything’s OK.Ayfri
08/23/2022, 9:56 PMdependencies {
runtimeClasspath files ("../core/build/classes/kotlin/main")
runtimeClasspath files ("build/classes/kotlin/main")
}
?João Gabriel Zó
08/25/2022, 1:32 PMsettings.gradle
but I’m still receiving Plugin with id 'org.graalvm.buildtools.native' not found.
isto
08/26/2022, 5:56 AMtask buildZip(type: Zip) {
from compileJava
from processResources
into('lib') {
from configurations.runtime
}
}
into kotlin? There are many examples related to file copying but I have trouble finding info on how to refer to compileJava
and processResources
in ktshfhbd
08/30/2022, 12:07 PM@get:OutputDirectory
abstract val outputFolder: DirectoryProperty
init {
outputFolder.convention(project.layout.buildDirectory.dir("generated/foo"))
project.plugins.withId("org.jetbrains.kotlin.jvm") {
val srcSet = project.extensions.findByType(SourceSetContainer::class.java)!!.getByName("main")
val kotlin = srcSet.extensions.getByName("kotlin") as SourceDirectorySet
kotlin.srcDir(outputFolder.dir("kotlin"))
}
}
Stylianos Gakis
08/31/2022, 8:18 AMsrc/**/java
or src/**/kotlin
and then gradle recognizes those two as separate source sets. For example there’s a bug in ktlint-gradle
since it doesn’t handle that case. We’ve now migrated from that plugin and can use the kotlin
name, but question is, should we? Is there any build speed or anything really that would improve by doing such a move?
Our project is 100% Kotlin already and will stay so too.Gleb Minaev
09/03/2022, 5:04 PMexample
. But when I just add the new target Gradle sync fails saying that each of jvmMain
, exampleMain
, jvmTest
and exampleTest
source sets can not determine which artifacts of dependency projects to use, jvm
or example
ones. How can I specify which target to depend on? Or how to "hide" some targets from depending on (and publishing)?Ellen Spertus
09/03/2022, 7:02 PMpackage.md
files, regardless of what directories they appear in (the way all source code is included, regardless of directory). I tried:
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
dokkaSourceSets {
named("main") {
includes.from("package.md")
}
}
}
but this only looks for package.md
in the root directory:
C:\Users\ellen\IdeaProjects\gradle-test\package.md (The system cannot find the file specified)
How would I make it look for files named package.md
in any src
directory?PHondogo
09/09/2022, 6:35 AMGuilherme Delgado
09/09/2022, 3:43 PMrefreshVersions
or refreshVersionsMigrate
(with --debug flag) commands, it throws saying:
Invocation of ‘Task.project’ by task ‘:<command>’ at execution time is unsupported.Also, if I try to run with
--mode
flag it says
> Unknown command-line option ‘--mode’.I’m stuck here. The project was created from 0 with Versions Catalog (no versions.properties) and I’m using gradle 7.5.1
Matthew Murray
09/09/2022, 11:29 PMString.lowercase()
for some reason, and String.toLowerCase()
seems to be deprecated and doesn’t work. Anyone have any ideas on why my build.gradle.kts can’t access this method?Marco Pierucci
09/09/2022, 11:49 PMCaused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools.build:gradle:7.2.2.?
Venkataramanan Parameswaran
09/12/2022, 12:57 PMBhargav
09/14/2022, 12:14 PMGuilherme Delgado
09/14/2022, 3:17 PMplugins {
kotlin("multiplatform")
id("org.jetbrains.compose") version Versions.JetBrains.Compose.desktop
}
to a convention plugin where:
with(pluginManager) {
apply("org.jetbrains.kotlin.multiplatform:${catalog.findVersion("kotlin").get()}")
apply("org.jetbrains.compose:${catalog.findVersion("desktopCompose").get()}")
}
but when I run it throws saying (same for the second line if I comment the first):
Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'org.jetbrains.kotlin.multiplatform:1.7.10' not found.
at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:144)
I’ve checked here and the syntax of the plugin is correct. What am I missing here? 🤔
Thanks!jmfayard
09/15/2022, 4:09 PMgradle/libs.versions.gradle
?
refreshVersions just added support for Gradle Versions Catalog
It's a huge feature though, so we would love for gentle early adatopers to give it a try
https://github.com/jmfayard/refreshVersions/wiki/RefreshVersions-%E2%99%A5%EF%B8%8F-Gradle-Version-Catalogmkrussel
09/15/2022, 7:32 PM.aar
files that I’m trying to include as a dependency in my library. These libraries are intended to be part of my library group, but they are slow to build and don’t change often (and maintained by a different team). To use them I created some gradle projects declaring them as an artifact and then made other library depend on them using implementation(project(":project"))
. I also added plugins and configuration to publish the artifacts.
val artifact = file("$name.aar")
configurations.maybeCreate("default")
artifacts.add("default", artifact)
This works for building and when I publish those artifacts also get published with the correct versions and my other libraries correctly depend on them.
The problem is that I get some warnings when syncing Intellij with the projects that depend on those projects (in thread) and the commonMain source set (using KMM) is not getting treated as source code). So I want to do this right.
I found this https://youtrack.jetbrains.com/issue/IDEA-274929 that states what I’m doing is wrong. If I follow the recommendation everything syncs up right.
But this will break the publication goals that I have. Plus due to how gradle caches remote artifacts, I feel this will create problems when trying to update the files. I can probably make everything work, but I’m wondering if there is a proper way to create a project that does just provide a precompiled artifact like I’m doing.Guilherme Delgado
09/15/2022, 9:46 PMorg.gradle.api.InvalidUserDataException: Invalid TOML catalog definition:
- Problem: In version catalog libs, unknown top level elements [plugins].
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Although it seams to fail, it works 🤷♂️ . Bundles, Libraries and Plugins are generated and I can use them with no problem.Kristian Nedrevold
09/16/2022, 6:45 AMZach
09/16/2022, 7:02 PMksp()
it shows up as an unresolved reference. In an attempt to add ksp to my project, I followed the quickstart guide here https://kotlinlang.org/docs/ksp-quickstart.html but when I sync gradle I get a significant amount of errors. Am I doing something wrong?dsvoronin
09/16/2022, 7:47 PMnapperley
09/17/2022, 3:16 AM// ...
sourceSets {
commonMain {
dependencies {
// ...
}
}
val linuxCommonMain by creating {
// ...
}
@Suppress("UNUSED_VARIABLE")
val linuxX64Main by getting {
dependsOn(linuxCommonMain)
}
@Suppress("UNUSED_VARIABLE")
val frontendMain by getting {
resources.srcDir(webDir)
}
}
Norbi
09/19/2022, 12:55 PMkotlin {
jvm { // Java 8 compatible
???
}
jvm("java17") {// Java 17 compatible
???
}
Is it possible?
Thanks.