2022-11-06 20:07:11 +08:00
|
|
|
import java.nio.charset.Charset
|
|
|
|
import java.nio.charset.StandardCharsets
|
|
|
|
|
2021-10-07 20:50:59 +08:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
2021-11-27 21:07:40 +08:00
|
|
|
id 'java-library'
|
2021-11-26 14:09:40 +08:00
|
|
|
id 'maven-publish'
|
|
|
|
id 'application'
|
|
|
|
id 'com.github.johnrengelman.shadow' version '7.1.0'
|
2022-11-06 20:07:11 +08:00
|
|
|
id 'com.github.gmazzo.buildconfig' version '3.1.0'
|
2021-10-07 20:50:59 +08:00
|
|
|
}
|
|
|
|
|
2022-11-06 20:07:11 +08:00
|
|
|
final String proj_group = 'cc.sukazyo'
|
|
|
|
final String proj_package = "${proj_group}.cono.morny"
|
|
|
|
final String proj_archive_name = MORNY_ARCHIVE_NAME
|
|
|
|
|
|
|
|
final String proj_version_base = VERSION
|
|
|
|
final String proj_version_delta = VERSION_DELTA
|
|
|
|
final String proj_version_use_delta = Boolean.parseBoolean(VERSION_DELTA)
|
|
|
|
final String proj_version = proj_version_base + (proj_version_use_delta ? "-δ${proj_version_delta}" : "")
|
|
|
|
final String proj_version_codename = CODENAME
|
|
|
|
|
|
|
|
final JavaVersion proj_java = JavaVersion.VERSION_17
|
|
|
|
final Charset proj_file_encoding = StandardCharsets.UTF_8
|
|
|
|
|
|
|
|
group proj_group
|
|
|
|
version proj_version
|
|
|
|
project.ext.archiveBaseName = proj_archive_name
|
|
|
|
project.ext.artifactId = proj_archive_name
|
|
|
|
mainClassName = "${proj_package}.ServerMain"
|
2021-10-07 20:50:59 +08:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2022-09-19 23:54:02 +08:00
|
|
|
maven { name '-ws'; url 'https://mvn.sukazyo.cc/releases' }
|
2021-10-07 20:50:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2021-11-06 20:43:56 +08:00
|
|
|
|
2021-12-10 01:08:18 +08:00
|
|
|
compileOnlyApi "com.github.spotbugs:spotbugs-annotations:${libSpotbugsVersion}"
|
2021-11-27 21:07:40 +08:00
|
|
|
|
2021-12-11 00:10:22 +08:00
|
|
|
api "cc.sukazyo:messiva:${libMessivaVersion}"
|
|
|
|
|
2021-12-10 01:08:18 +08:00
|
|
|
implementation "com.github.pengrad:java-telegram-bot-api:${libJavaTelegramBotApiVersion}"
|
2021-11-06 20:43:56 +08:00
|
|
|
|
2021-12-10 01:08:18 +08:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${libJunitVersion}"
|
2022-10-02 02:18:26 +08:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-params:${libJunitVersion}"
|
2021-12-10 01:08:18 +08:00
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${libJunitVersion}"
|
2021-11-06 20:43:56 +08:00
|
|
|
|
2021-10-07 20:50:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
2021-11-09 17:33:56 +08:00
|
|
|
|
2021-11-26 14:09:40 +08:00
|
|
|
java {
|
2021-12-05 20:15:51 +08:00
|
|
|
|
2022-11-06 20:07:11 +08:00
|
|
|
sourceCompatibility proj_java
|
|
|
|
targetCompatibility proj_java
|
2021-12-05 20:15:51 +08:00
|
|
|
|
2021-11-26 14:09:40 +08:00
|
|
|
withSourcesJar()
|
2021-12-05 20:15:51 +08:00
|
|
|
|
2021-11-26 14:09:40 +08:00
|
|
|
}
|
|
|
|
|
2021-11-09 17:33:56 +08:00
|
|
|
tasks.withType(JavaCompile) {
|
2022-11-06 20:07:11 +08:00
|
|
|
options.encoding = proj_file_encoding.name()
|
2021-11-09 17:33:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(Javadoc) {
|
2022-11-06 20:07:11 +08:00
|
|
|
options.encoding = proj_file_encoding.name()
|
|
|
|
options.docEncoding = proj_file_encoding.name()
|
|
|
|
options.charSet = proj_file_encoding.name()
|
2021-11-09 17:33:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
2022-11-06 20:07:11 +08:00
|
|
|
buildConfig {
|
|
|
|
|
|
|
|
packageName(proj_package)
|
|
|
|
|
|
|
|
buildConfigField('String', 'VERSION', "\"${proj_version}\"")
|
|
|
|
buildConfigField('String', 'VERSION_DELTA', "\"${proj_version_delta}\"")
|
|
|
|
buildConfigField('String', 'CODENAME', "\"${proj_version_codename}\"")
|
|
|
|
buildConfigField('long', 'COMPILE_TIMESTAMP', "${System.currentTimeMillis()}L")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-11-26 14:09:40 +08:00
|
|
|
shadowJar {
|
|
|
|
archiveBaseName.set("${project.ext.archiveBaseName}")
|
|
|
|
archiveVersion.set("${project.version}")
|
|
|
|
archiveClassifier.set("fat")
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
repositories{
|
|
|
|
maven {
|
|
|
|
name 'builds'
|
2022-06-07 16:37:49 +08:00
|
|
|
url publishLocalArchiveRepoUrl
|
2021-11-26 14:09:40 +08:00
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name '-ws-'
|
|
|
|
url publishMvnRepoUrl
|
|
|
|
credentials {
|
|
|
|
username publishMvnRepoUsername
|
|
|
|
password publishMvnRepoPassword
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
publications {
|
|
|
|
main (MavenPublication) {
|
|
|
|
from components.java
|
|
|
|
groupId = project.group
|
|
|
|
artifactId = project.ext.artifactId
|
|
|
|
version = project.version
|
|
|
|
}
|
|
|
|
}
|
2021-11-09 17:33:56 +08:00
|
|
|
}
|