SimplexCore/build.gradle

79 lines
1.7 KiB
Groovy
Raw Normal View History

2021-02-25 09:53:24 +00:00
plugins {
id "java"
id "com.github.johnrengelman.shadow" version "6.1.0"
}
version project.properties["pluginVersion"]
targetCompatibility = sourceCompatibility = JavaVersion.VERSION_17
2021-02-25 09:53:24 +00:00
repositories {
mavenCentral()
//maven artifact repo urls
[
"https://jitpack.io",
"https://papermc.io/repo/repository/maven-public/",
"https://os1.oss.sonatype.org/content/groups/public/"
2021-02-25 09:53:24 +00:00
].each { s ->
maven {
url s
}
}
}
dependencies {
//provided
[
"io.papermc.paper:paper-api:1.18-R0.1-SNAPSHOT",
2021-02-25 09:53:24 +00:00
].each {s ->
compileOnly s
}
//compile
[
"org.jetbrains:annotations:23.0.0",
"org.reflections:reflections:0.10.2"
2021-02-25 09:53:24 +00:00
].each {s ->
implementation s
}
}
shadowJar {
classifier project.properties["pluginJarClassifier"].toString()
baseName project.properties["pluginName"].toString()
//shading and relocation
[
"org.reflections",
"javassist"
].each {s ->
relocate s, "${project.properties["pluginMainPackage"]}.shaded.$s"
}
}
apply plugin: 'maven-publish'
apply plugin: 'signing'
signing {
sign configurations.archives
}
group = "io.github.simplexdevelopment"
archivesBaseName = "simplex-core"
version = "1.0.0"
2021-02-25 09:53:24 +00:00
processResources {
//update resources when building
doFirst {
file("$buildDir/resources/main").listFiles().each {
it.delete()
}
}
//define variables
expand(
"pluginVersion": project.version,
"pluginName": project.properties["pluginName"],
"pluginMain": "${project.properties["pluginMainPackage"]}.${project.properties["pluginMain"]}"
)
}