2021-02-25 09:53:24 +00:00
|
|
|
plugins {
|
|
|
|
id "java"
|
2022-01-30 15:07:27 +00:00
|
|
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
|
|
|
id 'maven-publish'
|
|
|
|
id 'signing'
|
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
|
|
|
withJavadocJar()
|
|
|
|
withSourcesJar()
|
2021-02-25 09:53:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
version project.properties["pluginVersion"]
|
2021-12-05 23:55:00 +00:00
|
|
|
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/",
|
2021-12-05 23:55:00 +00:00
|
|
|
"https://os1.oss.sonatype.org/content/groups/public/"
|
2021-02-25 09:53:24 +00:00
|
|
|
].each { s ->
|
|
|
|
maven {
|
|
|
|
url s
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
//provided
|
|
|
|
[
|
2021-12-05 23:55:00 +00:00
|
|
|
"io.papermc.paper:paper-api:1.18-R0.1-SNAPSHOT",
|
2021-02-25 09:53:24 +00:00
|
|
|
].each {s ->
|
|
|
|
compileOnly s
|
|
|
|
}
|
|
|
|
//compile
|
|
|
|
[
|
2021-12-05 23:55:00 +00:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-05 23:55:00 +00:00
|
|
|
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"]}"
|
|
|
|
)
|
2022-01-30 15:07:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
artifactId = 'simplexcore'
|
|
|
|
from components.java
|
|
|
|
versionMapping {
|
|
|
|
usage('java-api') {
|
|
|
|
fromResolutionOf('runtimeClasspath')
|
|
|
|
}
|
|
|
|
usage('java-runtime') {
|
|
|
|
fromResolutionResult()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pom {
|
|
|
|
name = 'SimplexCore'
|
|
|
|
description = 'An API and Library designed for development of Paper plugins.'
|
|
|
|
url = 'https://simplexdev.app'
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name = 'GNU General Public License v2.0'
|
|
|
|
url = 'https://opensource.org/licenses/gpl-2.0.php'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = 'simplexdevelopment'
|
|
|
|
name = 'Simplex Development Group'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
connection = 'scm:git:git://github.com/simplexdevelopment/simplexcore.git'
|
|
|
|
developerConnection = 'scm:git:ssh://github.com/simplexdevelopment/simplexcore.git'
|
|
|
|
url = 'https://github.com/SimplexDevelopment/SimplexCore'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
// change URLs to point to your repos, e.g. http://my.org/repo
|
|
|
|
def releasesRepoUrl = layout.buildDirectory.dir('https://s01.oss.sonatype.org/content/repository/releases')
|
|
|
|
def snapshotsRepoUrl = layout.buildDirectory.dir('https://s01.oss.sonatype.org/content/repository/snapshots')
|
|
|
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
signing {
|
|
|
|
sign publishing.publications.mavenJava
|
|
|
|
}
|
|
|
|
javadoc {
|
|
|
|
if(JavaVersion.current().isJava9Compatible()) {
|
|
|
|
options.addBooleanOption('html5', true)
|
|
|
|
}
|
|
|
|
}
|