mirror of
https://github.com/Grasscutters/gcgm-plugin.git
synced 2024-11-22 21:02:51 +08:00
97 lines
2.4 KiB
Groovy
97 lines
2.4 KiB
Groovy
/*
|
|
* This file was generated by the Gradle 'init' task.
|
|
*
|
|
* This generated file contains a sample Java project to get you started.
|
|
* For more details take a look at the Java Quickstart chapter in the Gradle
|
|
* User Manual available at https://docs.gradle.org/5.6.3/userguide/tutorial_java_projects.html
|
|
*/
|
|
buildscript {
|
|
|
|
}
|
|
|
|
plugins {
|
|
// Apply the java plugin to add support for Java
|
|
id 'java'
|
|
|
|
id 'idea'
|
|
}
|
|
|
|
sourceCompatibility = 17
|
|
targetCompatibility = 17
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
repositories {
|
|
// Use Maven Central for resolving dependencies.
|
|
mavenCentral()
|
|
|
|
maven {
|
|
url "https://repo.spring.io/release"
|
|
}
|
|
|
|
maven {
|
|
url "https://s01.oss.sonatype.org/content/groups/public/"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'lib', include: ['*.jar'])
|
|
|
|
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.8'
|
|
|
|
implementation group: 'dev.morphia.morphia', name: 'morphia-core', version: '2.2.6'
|
|
|
|
//implementation group: 'tech.xigam', name: 'grasscutter', version: '1.0.2-dev'
|
|
|
|
implementation 'io.jsonwebtoken:jjwt-api:0.11.3'
|
|
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.3', 'io.jsonwebtoken:jjwt-gson:0.11.3'
|
|
|
|
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.10.0'
|
|
runtimeOnly project(':web-interface')
|
|
}
|
|
|
|
task copyWebApp(type: Copy) {
|
|
dependsOn ":web-interface:npm_run_build"
|
|
println ('Copying data from NPM output')
|
|
from "$rootDir/web-interface/build/"
|
|
into "$rootDir/gc-plugin/build/resources/main/static/."
|
|
}
|
|
|
|
task zipWebApp(type: Zip) {
|
|
dependsOn "processResources"
|
|
dependsOn "copyWebApp"
|
|
|
|
println ('Zipping web app files')
|
|
|
|
from "$rootDir/gc-plugin/build/resources/main/static/"
|
|
include '**/*'
|
|
archiveName 'DefaultWebApp.zip'
|
|
destinationDir(file("$rootDir/gc-plugin/build/resources/main/"))
|
|
}
|
|
|
|
task compileWebApp(type: Delete) {
|
|
dependsOn "zipWebApp"
|
|
println ('Deleting non-zipped web app files')
|
|
delete files("$rootDir/gc-plugin/build/resources/main/static")
|
|
}
|
|
|
|
jar {
|
|
dependsOn "compileWebApp"
|
|
jar.baseName = 'gcgm-plugin'
|
|
|
|
from {
|
|
configurations.runtimeClasspath.collect {
|
|
if(it.name.equalsIgnoreCase("zip4j-2.10.0.jar")) {
|
|
println ('Packaging ' + it.name)
|
|
zipTree(it);
|
|
}
|
|
}
|
|
}
|
|
|
|
//duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
|
|
destinationDir = file(".")
|
|
}
|