mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 19:05:02 -04:00
gradle: gitlab ci, build fat jar
This commit is contained in:
parent
162d0a97aa
commit
97392c9d20
@ -1,24 +1,63 @@
|
|||||||
variables:
|
image: gradle:jdk11
|
||||||
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
|
|
||||||
MAVEN_CLI_OPTS: "--errors --fail-at-end --show-version"
|
|
||||||
|
|
||||||
image: maven:3-openjdk-11
|
variables:
|
||||||
|
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- export GRADLE_USER_HOME=`pwd`/.gradle
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .m2/repository
|
- .gradle/wrapper
|
||||||
|
- .gradle/caches
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
- test
|
||||||
|
- package
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
script: ./gradlew --build-cache assemble
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- merge_requests
|
||||||
|
cache:
|
||||||
|
key: "$CI_COMMIT_REF_NAME"
|
||||||
|
policy: push
|
||||||
|
paths:
|
||||||
|
- build
|
||||||
|
- .gradle
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
script: ./gradlew check
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- merge_requests
|
- merge_requests
|
||||||
script:
|
|
||||||
- 'mvn $MAVEN_CLI_OPTS verify'
|
|
||||||
artifacts:
|
artifacts:
|
||||||
|
when: always
|
||||||
reports:
|
reports:
|
||||||
junit:
|
junit: build/test-results/**/TEST-*.xml
|
||||||
- target/surefire-reports/TEST-*.xml
|
cache:
|
||||||
|
key: "$CI_COMMIT_REF_NAME"
|
||||||
|
policy: pull
|
||||||
|
paths:
|
||||||
|
- build
|
||||||
|
- .gradle
|
||||||
|
|
||||||
|
package:
|
||||||
|
stage: package
|
||||||
|
script: ./gradlew fatJar
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- merge_requests
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- build/libs/minosoft-fat-*.jar
|
||||||
|
cache:
|
||||||
|
key: "$CI_COMMIT_REF_NAME"
|
||||||
|
policy: pull
|
||||||
|
paths:
|
||||||
|
- build
|
||||||
|
- .gradle
|
||||||
|
@ -16,8 +16,11 @@ import de.bixilon.kutil.os.OSTypes
|
|||||||
import de.bixilon.kutil.os.PlatformInfo
|
import de.bixilon.kutil.os.PlatformInfo
|
||||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||||
|
import org.gradle.configurationcache.extensions.capitalized
|
||||||
|
import org.gradle.jvm.tasks.Jar
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.7.20"
|
kotlin("jvm") version "1.7.20"
|
||||||
id("org.openjfx.javafxplugin") version "0.0.13"
|
id("org.openjfx.javafxplugin") version "0.0.13"
|
||||||
@ -314,3 +317,15 @@ javafx {
|
|||||||
version = javafxVersion
|
version = javafxVersion
|
||||||
modules("javafx.controls", "javafx.fxml")
|
modules("javafx.controls", "javafx.fxml")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val fatJar = task("fatJar", type = Jar::class) {
|
||||||
|
archiveBaseName.set("${project.name}-fat")
|
||||||
|
manifest {
|
||||||
|
attributes["Implementation-Title"] = project.name.capitalized()
|
||||||
|
attributes["Implementation-Version"] = project.version
|
||||||
|
attributes["Main-Class"] = application.mainClass
|
||||||
|
}
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
||||||
|
with(tasks["jar"] as CopySpec)
|
||||||
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
# This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||||
#
|
#
|
||||||
kotlin.daemon.jvmargs=-Xmx1500M
|
kotlin.daemon.jvmargs=-Xmx2G
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
javafx.version=19
|
javafx.version=19
|
||||||
lwjgl.version=3.3.2-SNAPSHOT
|
lwjgl.version=3.3.2-SNAPSHOT
|
||||||
|
@ -42,7 +42,7 @@ public final class ProtocolDefinition {
|
|||||||
|
|
||||||
public static final String DEFAULT_NAMESPACE = "minecraft";
|
public static final String DEFAULT_NAMESPACE = "minecraft";
|
||||||
public static final String MINOSOFT_NAMESPACE = "minosoft";
|
public static final String MINOSOFT_NAMESPACE = "minosoft";
|
||||||
public static final char TEXT_COMPONENT_SPECIAL_PREFIX_CHAR = '§';
|
public static final char TEXT_COMPONENT_SPECIAL_PREFIX_CHAR = '\u00A7';
|
||||||
|
|
||||||
public static final int DEFAULT_BUFFER_SIZE = 4096;
|
public static final int DEFAULT_BUFFER_SIZE = 4096;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user