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'
|
2021-10-07 20:50:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
group 'cc.sukazyo'
|
2021-12-10 01:08:18 +08:00
|
|
|
version VERSION
|
2021-11-26 14:09:40 +08:00
|
|
|
project.ext.archiveBaseName = 'Coeur_Morny_Cono'
|
|
|
|
project.ext.artifactId = 'morny-coeur'
|
2021-12-08 12:51:50 +08:00
|
|
|
mainClassName = 'cc.sukazyo.cono.morny.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
|
|
|
}
|
|
|
|
|
2022-01-24 12:25:08 +08:00
|
|
|
String untitled (String lib, String upd = null) {
|
|
|
|
int majorCode = Integer.parseInt(project.libUntitledVersionMajor)
|
|
|
|
return "cc.sukazyo.untitled:$lib:[$majorCode${upd==null?"":".$upd"}, ${majorCode+1}["
|
|
|
|
}
|
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
|
|
|
|
2022-01-24 12:25:08 +08:00
|
|
|
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")
|
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
|
|
|
}
|
|
|
|
|
2021-11-28 18:16:58 +08:00
|
|
|
task updateVersionCode {
|
2021-11-26 22:26:02 +08:00
|
|
|
ant.replaceregexp(match:'VERSION = ["a-zA-Z0-9.\\-_+@]+;', replace:"VERSION = \"$project.version\";", flags:'g', byline:true) {
|
2021-12-05 20:15:51 +08:00
|
|
|
fileset(dir: 'src/main/java/cc/sukazyo/cono/morny', includes: 'GradleProjectConfigures.java')
|
2021-12-07 18:10:08 +08:00
|
|
|
}
|
2022-05-30 23:34:49 +08:00
|
|
|
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')
|
|
|
|
}
|
2021-12-07 18:10:08 +08:00
|
|
|
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')
|
2021-11-26 22:26:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-28 18:16:58 +08:00
|
|
|
compileJava.dependsOn updateVersionCode
|
|
|
|
|
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
|
|
|
|
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
|
|
|
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) {
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
options.docEncoding = 'UTF-8'
|
|
|
|
options.charSet = 'UTF-8'
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|