Rodrigo Quispe
07/20/2020, 1:20 PMbuild.gradle.kts
and I expected `build/libs/app-SNAPSHOT.jar`: (The .jar file does not generate for me)
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "2.2.6.RELEASE"
id("io.spring.dependency-management") version "1.0.9.RELEASE"
kotlin("jvm") version "1.3.71"
kotlin("plugin.spring") version "1.3.71"
kotlin("plugin.jpa") version "1.3.71"
}
group = "com.warlock"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-data-rest")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
runtimeOnly("org.postgresql:postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging.events( "passed", "skipped", "failed", "standardError")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
ursus
07/20/2020, 3:01 PMursus
07/20/2020, 3:05 PMDavide Giuseppe Farella
07/21/2020, 12:46 PMmyLib
) and a Gradle plugin.
Plugin got myLib
as dependency and example
is using the Plugin, but I got
> Failed to apply plugin [id 'studio.forface.easy-publish']
> Could not create an instance of type studio.forface.easygradle.publish.EasyPublishExtension.
> Could not generate a decorated class for type EasyPublishExtension.
> studio/forface/easygradle/internal/ConfigReadWriteProperty
ConfigReadWriteProperty
is part of myLib
and EasyPublishExtension
is something like:
abstract class EasyPublishExtension @Inject constructor(project: Project) {
var username by project("", propertyName = "bintray.user")
private operator fun <T : Any> Project.invoke(
default: T,
propertyName: String? = null,
envName: String? = null
) = object : ConfigReadWriteProperty<EasyPublishExtension, T>(
....
}
What is the problem here?Fredy
07/22/2020, 7:50 AMnapperley
07/23/2020, 3:08 AMSamyak Jain
07/23/2020, 5:43 AMThis JVM does not support getting OS memory, so no OS memory status updates will be broadcast
Initialized native services in: /home/samyak/Kotlin/master/kotlin-1.3.30/.gradle/native
:kotlin-gradle-plugin:compileGroovy FAILED
:kotlin-gradle-plugin:compileGroovy (Thread[Task worker for ':' Thread 4,5,main]) completed. Took 7.665 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':kotlin-gradle-plugin:compileGroovy'.
> android/databinding/tool/LayoutXmlProcessor$OriginalFileLookup has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':kotlin-gradle-plugin:compileGroovy'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
FULL LOGS: https://paste.ubuntu.com/p/MsvSXmh9bB/jean
07/28/2020, 8:24 AMinclude ':library'
project(':library').projectDir = new File(settingsDir, '../MyLibrary/library')
I don’t find any info on how to set the project path with kotlinVincent Williams
07/28/2020, 8:20 PMkotlinOptions
. Im using gradle version 6.5David Eriksson
07/30/2020, 5:52 PM/* Kotlin js output assumes window exists, which it won't on Workers. Hack around it */
(new File("$projectDir/index.js")).text = "const window=this; " + file("$projectDir/build/distributions/${rootProject.name}.js").getText()
How do I write this in build.gradle.kts?
File("$projectDir/index.js").text
Where .text seem to be some kind of extension to the File object that is not available in Kotlin?
PS. I don't know why they use kotlin.target.browser and not target.nodejs but maybe it is to get access to org.w3c.* stuff.
Thanks!Loboda Deni
07/31/2020, 7:20 AMe: /home/StudioProjects/sample-multimodule/f_main/src/main/java/com/company/projectName/feature/main/home/HomeViewModel.kt: (4, 39): Unresolved reference: di
in my vm class:
package com.company.projectName.feature.main.home
import com.company.projectName.domain.di.DomainModule
class HomeViewModel() : HomeContract.ViewModel {
val x = DomainModule.get()
}
I connected the module in dependencies:
dependencies {
applyDependencies(depends)
implementation(project(":domain"))
}
and when writing the code, all references to the classes of this module work, but errors occur during assembly. while in the app
module the link to this class works. what do you think could be the problem?Loboda Deni
07/31/2020, 8:30 AMLex Luthor
08/08/2020, 3:15 AMsrc/main/java
• src/test/java
My current configuration is:
$ ./gradlew -v
------------------------------------------------------------
Gradle 6.5.1
------------------------------------------------------------
Build time: 2020-06-30 06:32:47 UTC
Revision: 66bc713f7169626a7f0134bf452abde51550ea0a
Kotlin: 1.3.72
Groovy: 2.5.11
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.8 (<http://Amazon.com|Amazon.com> Inc. 11.0.8+10-LTS)
OS: Linux 5.4.0-42-generic amd64
I added the following to my build.gradle.kts
script but had no effect whatsoever:
sourceSets {
main {
java.srcDir("src/main/kotlin")
resources.srcDir("src/main/resources")
}
test {
java.srcDir("src/test/kotlin")
resources.srcDir("src/test/resources")
}
}
Gunslingor
08/09/2020, 7:10 PMJavier
08/11/2020, 7:24 AMon
, it said true
.
Is this a typo?
org.gradle.unsafe.configuration-cache=true
https://docs.gradle.org/6.6/userguide/configuration_cache.html
Option configuration-cache doesn't accept value 'true'. Possible values are [OFF, ON, WARN]
Holger Steinhauer [Mod]
08/11/2020, 12:07 PMNikola Milovic
08/11/2020, 4:55 PMdependencies {
implementation(project(":core"))
implementation(project(":app"))
}
While my app has
dependencies {
///...
implementation(project(":core"))
testImplementation(TestLibraryDependency.JUNIT) //neither does this
addTestDependencies() // this doesn't work
}
But rather I have to explicitly add testImplementation(TestLibraryDependency.JUNIT)
to my Dynamic Modules build.gradle
What is up with that?Christopher Elías
08/12/2020, 12:10 AMDavide Giuseppe Farella
08/12/2020, 6:26 PMbuildConfigField
doodla
08/12/2020, 7:16 PMnamed()
and getByName()
? Seems to be interchangeable in usage. This is in NamedDomainObjectCollection.java
poohbar
08/14/2020, 7:38 PMapollo {
customTypeMapping = [
"type" : "customType"
]
}
atsushi-koshikizawa
08/15/2020, 3:24 AMspierce7
08/18/2020, 12:49 PMsubprojects
block. Does anyone have any suggestions?
afterEvaluate {
kotlin.sourceSets.map {
it.apply {
languageSettings.apply {
useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
useExperimentalAnnotation("kotlinx.coroutines.FlowPreview")
useExperimentalAnnotation("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
}
}
}
spierce7
08/18/2020, 4:33 PMkotlin
extension, and instead I have. to define it. It's ugly, but works. Anyone know of a solution?
plugins.withType(KotlinMultiplatformPlugin::class) {
afterEvaluate {
val kotlin = (this as ExtensionAware).extensions.getByName("kotlin") as org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
kotlin.sourceSets.map {
it.apply {
languageSettings.apply {
useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
useExperimentalAnnotation("kotlinx.coroutines.FlowPreview")
useExperimentalAnnotation("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
}
}
}
}
David Eriksson
08/18/2020, 7:31 PMCannot access 'java.lang.Object' which is a supertype of 'org.gradle.kotlin.dsl.KotlinBuildScript'. Check your module classpath for missing or conflicting dependencies
darkmoon_uk
08/19/2020, 12:47 PMdependsOn(gradle.includedBuild("someNamedBuild").task(":build"))
...but I get:
Could not determine the dependencies of task ':build'.
> Task with path ':build' not found in project ':someNamedBuild'.
Even though build
is a task in that included build - I can even see it listed if I instead do:
dependsOn(gradle.includedBuild("someNamedBuild").task(":tasks"))
...which successfully lists the available tasks for someNamedBuild
, including build
.Shannon Lloyd
08/20/2020, 9:48 PMkotlin-dsl
in buildSrc bundles its own version of Kotlin (which I believe is currently 1.3.72), it is currently impossible to upgrade a Gradle kotlin project to 1.4.0 if we are also authoring plugins using kotlin-dsl
in buildSrc? We're seeing classpath issues (e.g. NoSuchMethodErrors) relating to still having 1.3.72 on the classpath after upgrading everything to 1.4.0 (we end up with both versions on the classpath). Are we basically stuck on 1.3.72 until Gradle releases a version with a bundled Kotlin 1.4.x?Samyak Jain
08/22/2020, 7:27 AMe: /home/samyak/kotlin/master/kotlin-1.3.30/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/kapt/Kapt3KotlinGradleSubplugin.kt: (302, 38): Type inference failed: Not enough information to infer parameter T in fun <T> emptyList(): List<T>
Please specify it explicitly.
e: /home/samyak/kotlin/master/kotlin-1.3.30/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/TaskProviderHolder.kt: (25, 59): Unresolved reference: register
:kotlin-gradle-plugin:compileKotlin FAILED
I'm unable to rectify upper bits, where is the register method implemented in gradle I checked for
• org.gradle.api.Project
• org.gradle.api.Task
• org.gradle.api.tasks.TaskProvider
But had no luck 😕Samyak Jain
08/22/2020, 7:32 AMmiqbaldc
08/22/2020, 12:11 PM// env variable inside bash/zsh profile
ORG_GRADLE_PROJECT_foo=bar
// app/build.gradle.kts
val foo: String? by project
miqbaldc
08/22/2020, 12:11 PM// env variable inside bash/zsh profile
ORG_GRADLE_PROJECT_foo=bar
// app/build.gradle.kts
val foo: String? by project