mirror of
https://github.com/GayPizzaSpecifications/dough.git
synced 2025-08-03 13:31:33 +00:00
dough sample jar and run tasks
This commit is contained in:
@ -9,4 +9,6 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
|
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
|
||||||
implementation("org.jetbrains.kotlin:kotlin-serialization:1.8.10")
|
implementation("org.jetbrains.kotlin:kotlin-serialization:1.8.10")
|
||||||
|
|
||||||
|
implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,34 @@
|
|||||||
|
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("dough_base")
|
id("dough_base")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val jvmMain = kotlin.targets.getByName<KotlinJvmTarget>("jvm").compilations.getByName("main")
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
val sampleJar = register<Jar>("sampleJar") {
|
||||||
|
group = "application"
|
||||||
|
|
||||||
|
manifest {
|
||||||
|
attributes["Main-Class"] = "MainKt"
|
||||||
|
}
|
||||||
|
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
|
||||||
|
archiveBaseName.set("${project.name}-sample")
|
||||||
|
from(jvmMain.output.classesDirs, jvmMain.compileDependencyFiles.map {
|
||||||
|
if (it.isDirectory) it else zipTree(it)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
register<JavaExec>("runSample") {
|
||||||
|
group = "application"
|
||||||
|
|
||||||
|
mainClass.set("MainKt")
|
||||||
|
classpath = jvmMain.output.classesDirs
|
||||||
|
classpath += jvmMain.compileDependencyFiles
|
||||||
|
}
|
||||||
|
|
||||||
|
assemble.get().dependsOn(sampleJar)
|
||||||
|
}
|
||||||
|
@ -10,4 +10,4 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
tools/ensure-new-lines.sh
Executable file
10
tools/ensure-new-lines.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
git ls-files -z | while IFS= read -rd '' f
|
||||||
|
do
|
||||||
|
if file --mime-encoding "$f" | grep -qv binary
|
||||||
|
then
|
||||||
|
tail -c1 < "$f" | read -r _ || echo >> "$f"
|
||||||
|
fi
|
||||||
|
done
|
Reference in New Issue
Block a user