mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2024-11-24 20:17:38 +08:00
Eyre_S
459470be02
- Commons 工具组的一些实现改动 - _Convert.byteToHex 的实现从手动处理字母改为使用 java Integer.toHexString 方法(同时删除了私有的 hexArray 常量数组) - (WARN:breaking-changes) _Encrypt 中的命名从 encryptByX 改为 hashX - 添加了 junit 的 params 组件 (org.junit.jupiter:junit-jupiter-params) - 为 Commons 工具组的每个方法添加了其单元测试 - 单元测试添加了一个名为 MornyCLI 的执行 程序 main 方法 的程序入口包装...
114 lines
3.0 KiB
Groovy
114 lines
3.0 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'application'
|
|
id 'com.github.johnrengelman.shadow' version '7.1.0'
|
|
}
|
|
|
|
group 'cc.sukazyo'
|
|
version VERSION
|
|
project.ext.archiveBaseName = 'Coeur_Morny_Cono'
|
|
project.ext.artifactId = 'morny-coeur'
|
|
mainClassName = 'cc.sukazyo.cono.morny.ServerMain'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { name '-ws'; url 'https://mvn.sukazyo.cc/releases' }
|
|
}
|
|
|
|
String untitled (String lib, String upd = null) {
|
|
int majorCode = Integer.parseInt(project.libUntitledVersionMajor)
|
|
return "cc.sukazyo.untitled:$lib:[$majorCode${upd==null?"":".$upd"}, ${majorCode+1}["
|
|
}
|
|
dependencies {
|
|
|
|
compileOnlyApi "com.github.spotbugs:spotbugs-annotations:${libSpotbugsVersion}"
|
|
|
|
implementation untitled("util-command-parser","1.0")
|
|
implementation untitled("util-string-commons", "1.0")
|
|
implementation untitled("util-telegram-api", "2.1")
|
|
implementation untitled("util-telegram-api-formatter", "3.3")
|
|
implementation untitled("util-telegram-commons", "1.0")
|
|
api "cc.sukazyo:messiva:${libMessivaVersion}"
|
|
|
|
implementation "com.github.pengrad:java-telegram-bot-api:${libJavaTelegramBotApiVersion}"
|
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${libJunitVersion}"
|
|
testImplementation "org.junit.jupiter:junit-jupiter-params:${libJunitVersion}"
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${libJunitVersion}"
|
|
|
|
}
|
|
|
|
task updateVersionCode {
|
|
ant.replaceregexp(match:'VERSION = ["a-zA-Z0-9.\\-_+@]+;', replace:"VERSION = \"$project.version\";", flags:'g', byline:true) {
|
|
fileset(dir: 'src/main/java/cc/sukazyo/cono/morny', includes: 'GradleProjectConfigures.java')
|
|
}
|
|
ant.replaceregexp(match:'CODENAME = ["a-zA-Z0-9]+;', replace:"CODENAME = \"${CODENAME}\";", flags:'g', byline:true) {
|
|
fileset(dir: 'src/main/java/cc/sukazyo/cono/morny', includes: 'GradleProjectConfigures.java')
|
|
}
|
|
ant.replaceregexp(match:'COMPILE_TIMESTAMP = [0-9]+L;', replace:"COMPILE_TIMESTAMP = ${System.currentTimeMillis()}L;", flags:'g', byline:true) {
|
|
fileset(dir: 'src/main/java/cc/sukazyo/cono/morny', includes: 'GradleProjectConfigures.java')
|
|
}
|
|
}
|
|
|
|
compileJava.dependsOn updateVersionCode
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
java {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
tasks.withType(Javadoc) {
|
|
options.encoding = 'UTF-8'
|
|
options.docEncoding = 'UTF-8'
|
|
options.charSet = 'UTF-8'
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
shadowJar {
|
|
archiveBaseName.set("${project.ext.archiveBaseName}")
|
|
archiveVersion.set("${project.version}")
|
|
archiveClassifier.set("fat")
|
|
}
|
|
|
|
publishing {
|
|
repositories{
|
|
maven {
|
|
name 'builds'
|
|
url publishLocalArchiveRepoUrl
|
|
}
|
|
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
|
|
}
|
|
}
|
|
}
|