rjw-plasticsurgeries/Source/build.gradle.kts
2022-01-15 03:43:57 +01:00

95 lines
2.7 KiB
Text

/*
* This file was generated by the Gradle "init" task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.3/samples
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
id("com.ullink.msbuild") version "3.15"
//id("com.ullink.nunit") version "1.12"
}
version = "4943.0.1.3"
val friendlyName = "rjw-plasticsurgeries"
tasks.register<com.ullink.Msbuild>("buildC#") {
// either a solution file
// solutionFile = "${rootProject.name}.sln"
// or a project file (.csproj or .vbproj)
projectFile = file("${rootProject.name}/${rootProject.name}.csproj")
targets = listOf("Clean", "Rebuild")
configuration = "Release"
// destinationDir = "build/msbuild/bin"
}
tasks.register<Exec>("sign") {
dependsOn("buildC#")
workingDir = project.projectDir.resolve("${rootProject.name}/obj/Release")
executable = "H:\\Windows Kits\\10\\bin\\10.0.22000.0\\x64\\signtool.exe"
args = listOf(
"sign",
"/seal",
"/t",
"http://timestamp.digicert.com",
"/a",
"/n",
"Stardust3D",
"/fd",
"certHash",
"${rootProject.name}.dll"
)
}
tasks.register("copyDll") {
dependsOn("copyDll_Assemblies", "copyDll_1.3")
}
tasks.register<Copy>("copyDll_Assemblies") {
dependsOn("sign", "clean")
from(project.projectDir.resolve("${rootProject.name}/obj/Release/${rootProject.name}.dll"))
into(project.projectDir.parentFile.resolve("Assemblies"))
}
tasks.register<Copy>("copyDll_1.3") {
dependsOn("sign", "clean")
from(project.projectDir.resolve("${rootProject.name}/obj/Release/${rootProject.name}.dll"))
into(project.projectDir.parentFile.resolve("1.3/Assemblies"))
}
tasks.register<Zip>("buildZip") {
dependsOn(":copyDll")
into("$friendlyName/1.3") {
from(project.projectDir.parentFile.resolve("1.3"))
}
into("$friendlyName/About") {
from(project.projectDir.parentFile.resolve("About"))
}
into("$friendlyName/Assemblies") {
from(project.projectDir.parentFile.resolve("Assemblies"))
}
into("$friendlyName/Defs") {
from(project.projectDir.parentFile.resolve("Defs"))
}
into("$friendlyName/Source/${rootProject.name}") {
from(project.projectDir.parentFile.resolve("Source/${rootProject.name}"))
excludes.add("**/obj/**")
}
}
tasks.clean {
dependsOn("buildC#")
delete.add(project.projectDir.parentFile.resolve("Assemblies"))
delete.add(project.projectDir.parentFile.resolve("1.3/Assemblies"))
}
tasks.build {
//dependsOn("buildC#")
}
tasks.assemble {
dependsOn("buildZip")
}