0
This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
ghast-tools/build.gradle
2021-10-21 22:24:23 +03:00

103 lines
2.9 KiB
Groovy

//file:noinspection GroovyAssignabilityCheck
plugins {
id 'java'
id 'maven-publish'
}
project.group = projectGroup
project.version = projectVersion
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://hub.spigotmc.org/nexus/content/groups/public' }
maven { url 'https://dmx-mc-project.gitlab.io/maven-repository/' }
maven { url "https://gitlab.com/api/v4/projects/${project.property('gitlab.projectid')}/packages/maven" }
}
ext {
junitVersion = '5.5.2'
libs = [
bukkit: [lib: 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT', exclude: [
'com.google.code.gson:gson',
'com.googlecode.json-simple:json-simple',
'commons-lang:commons-lang',
'org.yaml:snakeyaml'
]],
commons_text: 'org.apache.commons:commons-text:1.9',
lombok: 'org.projectlombok:lombok:1.18.12',
reflection_object: 'ru.dmitriymx:reflection-object:1.2',
test: [
junit5: [
"org.junit.jupiter:junit-jupiter-api:$junitVersion",
"org.junit.jupiter:junit-jupiter-engine:$junitVersion"
],
mock: ['org.mockito:mockito-core:1.10.19'],
h2db: 'com.h2database:h2:1.4.200'
]
]
}
def compileOnly2(library) {
dependencies.compileOnly library.lib, {
library.exclude.each { String excludeLibStr ->
String[] excludeLib = excludeLibStr.split(':')
exclude group: excludeLib[0], module: excludeLib[1]
}
}
}
def testImplementation2(library) {
dependencies.testImplementation library.lib, {
library.exclude.each { String excludeLibStr ->
String[] excludeLib = excludeLibStr.split(':')
exclude group: excludeLib[0], module: excludeLib[1]
}
}
}
dependencies {
compileOnly libs.lombok
annotationProcessor libs.lombok
compileOnly2 libs.bukkit
implementation libs.commons_text
implementation libs.reflection_object
testImplementation libs.test.junit5
testImplementation libs.test.mock
testImplementation2 libs.bukkit
testImplementation libs.test.h2db
}
test {
useJUnitPlatform()
}
publishing {
publications {
mavenBinary(MavenPublication) {
groupId = project.property('projectGroup')
artifactId = project.property('projectName')
version = project.property('projectVersion')
from components.java
}
}
repositories {
maven {
url "https://gitlab.com/api/v4/projects/${project.property('gitlab.projectid')}/packages/maven"
credentials(HttpHeaderCredentials) {
name = 'Job-Token'
value = System.getenv('CI_JOB_TOKEN')
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}