Sebastien Leclerc Lavallee
03/11/2020, 3:49 PMapplication
plugin and when I installDist
, everything seems to work as expected. I see my app in the build dir and the associated jar file. The problem is when I run the app, I have an error saying it can’t find the main class I did specifiy in my build.gradle. When checking my jar file, it is totally empty. There is only the MANIFEST.MF
. Most of my classes are in the commonMain sourceset and some actual in the jvmMain sourceset. Anyone has encountered this ? Any things to check? Thanks 🙂fkrauthan
03/11/2020, 6:49 PMSebastien Leclerc Lavallee
03/11/2020, 7:03 PM./gradlew build
I still get an empty jar file for this subproject. From what I see… out of my 3 subprojects, only 1 produce a jar file with something in it but they all have a jvm sourcesetLuoqiaoyou
03/12/2020, 2:21 AMSebastien Leclerc Lavallee
03/12/2020, 2:31 AM@@ -1,198 +0,0 @@
import org.jetbrains.kotlin.gradle.plugin.*
buildscript {
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_gradle_plugin_version"
}
}
plugins {
id "org.jetbrains.kotlin.plugin.serialization"
}
apply plugin: "org.jetbrains.kotlin.multiplatform"
apply plugin: 'kotlinx-serialization'
apply plugin: 'application'
apply plugin: 'org.springframework.boot'
kotlin {
jvm()
sourceSets {
commonMain {
dependencies {
implementation project(":runtime")
implementation kotlin("stdlib-common")
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$kotlin_serialization_version"
}
archivesBaseName = "protoc-gen-kotlin-common"
publishSettings(project, archivesBaseName, "Common library for pbandk protobuf code generator")
}
commonTest {
dependencies {
implementation kotlin("test-common")
implementation kotlin("test-annotations-common")
}
}
jvmMain {
application {
mainClassName = "pbandk.gen.MainKt"
applicationName = "protoc-gen-kotlin"
}
dependencies {
implementation kotlin("stdlib")
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlin_serialization_version"
implementation "com.google.protobuf:protobuf-java:$protobuf_version"
}
sourceCompatibility = "1.8"
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
jar {
enabled = true
}
bootJar {
launchScript()
}
configurations.archives.artifacts.removeIf { it.name ==~ /.*-boot/ && it.type ==~ /zip|tar/ }
artifacts {
archives bootJar
}
archivesBaseName = 'protoc-gen-kotlin'
publishSettings(project, archivesBaseName, 'JVM library for pbandk protobuf code generator')
}
jvmTest {
dependencies {
implementation kotlin("test")
implementation kotlin("test-junit")
implementation "junit:junit:4.12"
}
}
/*
macosMain {
}
macosTest {
}
*/
}
}