Griefed
7bf7ace66b
fix(deps): update dependency org.mockito:mockito-core to v4.8.1 See merge request Griefed/ServerPackCreatorExampleAddon!76
122 lines
3.1 KiB
Groovy
122 lines
3.1 KiB
Groovy
import java.text.SimpleDateFormat
|
|
|
|
plugins {
|
|
id 'java'
|
|
id 'idea'
|
|
}
|
|
|
|
//noinspection GroovyUnusedAssignment
|
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
|
|
/*
|
|
CHANGE THESE VALUES
|
|
FOR YOUR OWN
|
|
ADDON
|
|
|
|
Addon ID must be unique.
|
|
Set it carefully!
|
|
*/
|
|
group 'de.griefed'
|
|
def pluginClass = group + '.exampleaddon.Example'
|
|
def addon_id = 'example'
|
|
def addon_name = 'Example Addon'
|
|
def addon_description = 'An example addon for ServerPackCreator, demonstrating all extension points available.'
|
|
def addon_author = 'Griefed'
|
|
|
|
|
|
sourceSets {
|
|
//noinspection GroovyAssignabilityCheck
|
|
main {
|
|
java {
|
|
srcDirs = ['src/main/java']
|
|
}
|
|
//noinspection GroovyAssignabilityCheck
|
|
resources {
|
|
srcDirs = ['src/main/resources']
|
|
}
|
|
}
|
|
test {
|
|
java {
|
|
srcDirs = ['src/test/java']
|
|
}
|
|
//noinspection GroovyAssignabilityCheck
|
|
resources {
|
|
srcDirs = ['src/test/resources']
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url "https://jitpack.io" }
|
|
maven { url 'https://repo.spring.io/release' }
|
|
}
|
|
|
|
dependencies {
|
|
annotationProcessor 'org.pf4j:pf4j:3.7.0'
|
|
implementation 'de.griefed:serverpackcreator:3.14.7'
|
|
|
|
// Testing
|
|
testImplementation 'org.mockito:mockito-core:4.8.1'
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
|
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
// Mention test result in logs
|
|
testLogging {
|
|
events(
|
|
"passed",
|
|
"skipped",
|
|
"failed"
|
|
)
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
filesMatching("addon.toml") {
|
|
expand(
|
|
"version": project.version,
|
|
"addon_id": addon_id,
|
|
"addon_name": addon_name,
|
|
"addon_description": addon_description,
|
|
"addon_author": addon_author,
|
|
"addon_class": pluginClass
|
|
)
|
|
}
|
|
copy {
|
|
from layout.projectDirectory.file("LICENSE")
|
|
into layout.projectDirectory.dir("src/main/resources")
|
|
}
|
|
copy {
|
|
from layout.projectDirectory.file("README.md")
|
|
into layout.projectDirectory.dir("src/main/resources")
|
|
}
|
|
copy {
|
|
from layout.projectDirectory.file("CHANGELOG.md")
|
|
into layout.projectDirectory.dir("src/main/resources")
|
|
}
|
|
}
|
|
|
|
jar {
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
|
|
//noinspection GroovyAssignabilityCheck
|
|
manifest {
|
|
attributes(
|
|
"Main-Class": pluginClass,
|
|
"Description": addon_description,
|
|
"Built-By": System.getProperty("user.name"),
|
|
"Build-Timestamp": new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
|
|
"Created-By": "Gradle ${gradle.gradleVersion}",
|
|
"Build-Jdk": "${System.getProperty('java.version')} (${System.getProperty('java.vendor')} ${System.getProperty('java.vm.version')})",
|
|
"Build-OS": "${System.getProperty('os.name')} ${System.getProperty('os.arch')} ${System.getProperty('os.version')}",
|
|
"Plugin-Class": pluginClass,
|
|
"Plugin-Id": addon_id,
|
|
"Plugin-Name": addon_name,
|
|
"Plugin-Provider": addon_author,
|
|
"Plugin-Version": project.version,
|
|
"Plugin-Description": addon_description
|
|
)
|
|
}
|
|
} |