123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- plugins {
- id 'java'
- id 'application'
- id "com.github.johnrengelman.shadow" version "8.1.1"
- }
- group = 'com.incubator.game'
- version = '1.0-SNAPSHOT'
- sourceSets {
- main {
- resources {
- srcDirs += 'conf'
- }
- }
- }
- application {
-
- mainClass.set('com.incubator.game.GameServerStart')
-
- applicationDefaultJvmArgs
- "-XX:+UseZGC",
- "-XX:+UnlockExperimentalVMOptions",
- "-XX:ZUncommitDelay=300",
- "-XX:MaxHeapSize=2G",
- "-XX:+HeapDumpOnOutOfMemoryError",
- "--enable-preview",
- "-Dlog4j.configurationFile=conf/log4j2.xml"
- ]
- }
- tasks.jar
- enabled
- }
- tasks.shadowJar
- zip64
-
- archiveBaseName.set('incubator-game')
-
- archiveVersion.set(project.version)
-
- archiveClassifier.set('')
-
- manifest
-
- attributes
- }
-
- from('conf') { into('conf') }
-
- exclude
-
- duplicatesStrategy
- }
- dependencies
-
- implementation
-
- testImplementation
- testRuntimeOnly
- }
- tasks.test
- useJUnitPlatform()
- testLogging
- events
- }
- maxParallelForks // 并行测试
- }
- tasks.assemble.dependsOn(tasks.shadowJar)
- tasks.register("buildInfo") {
- doLast
- println
- println
- println
- println
- }
- }
- tasks.clean
- delete // 使用现代 清理构建目录
- }
|