Simplify Gradle build

This commit is contained in:
Daniel Wolf 2019-07-21 10:26:41 +02:00
parent df8fd3c1fe
commit 2f6e8bc549
2 changed files with 4 additions and 9 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.2)
add_custom_target( add_custom_target(
rhubarbForSpine ALL rhubarbForSpine ALL
"./gradlew" "shadowJar" "./gradlew" "build"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Building Rhubarb for Spine through Gradle." COMMENT "Building Rhubarb for Spine through Gradle."
) )

View File

@ -1,10 +1,8 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.File import java.io.File
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins { plugins {
kotlin("jvm") version "1.3.41" kotlin("jvm") version "1.3.41"
id("com.github.johnrengelman.shadow") version "5.1.0"
} }
fun getVersion(): String { fun getVersion(): String {
@ -43,13 +41,10 @@ tasks.test {
useJUnitPlatform() useJUnitPlatform()
} }
tasks.shadowJar { tasks.withType<Jar> {
dependsOn(tasks.test)
// Modified by shadow plugin
archiveClassifier.set(null as String?)
manifest { manifest {
attributes("Main-Class" to "com.rhubarb_lip_sync.rhubarb_for_spine.MainKt") attributes("Main-Class" to "com.rhubarb_lip_sync.rhubarb_for_spine.MainKt")
} }
from(configurations.compileClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
} }