rjw-patch-autopsy/Source/build.gradle.kts
2022-01-04 21:19:07 +01:00

77 lines
2.6 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-patch-autopsy"
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("sign", "copyDll_Assemblies", "copyDll_1.3")
}
tasks.register<Copy>("copyDll_Assemblies") {
dependsOn("buildC#", "clean_Assemblies")
from(project.projectDir.resolve("${rootProject.name}/obj/Release/${rootProject.name}.dll"))
into(project.projectDir.parentFile.resolve("Assemblies"))
}
tasks.register<Copy>("copyDll_1.3") {
dependsOn("buildC#", "clean_1.3")
from(project.projectDir.resolve("${rootProject.name}/obj/Release/${rootProject.name}.dll"))
into(project.projectDir.parentFile.resolve("1.3/Assemblies"))
}
tasks.register<Delete>("clean_Assemblies") {
delete.add(project.projectDir.parentFile.resolve("Assemblies"))
}
tasks.register<Delete>("clean_1.3") {
delete.add(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("${rootProject.friendlyName}/Defs") {
from(project.projectDir.parentFile.resolve("Defs"))
}*/
into("$friendlyName/Source/${rootProject.name}") {
from(project.projectDir.parentFile.resolve("Source/${rootProject.name}"))
excludes.add("**/obj/**")
}
}