68 lines
1.5 KiB
Groovy
68 lines
1.5 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
|
}
|
|
|
|
version = rootProject.version
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven {
|
|
url 'https://gitlab.com/api/v4/projects/35030495/packages/maven'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
shadow implementation('io.gitlab.jfronny:gson:+')
|
|
|
|
implementation project(':')
|
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
|
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
|
|
}
|
|
|
|
shadowJar {
|
|
configurations = [ project.configurations.shadow ]
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
groupId = 'io.gitlab.jfronny'
|
|
artifactId = 'commons-gson'
|
|
|
|
project.shadow.component(it)
|
|
|
|
pom.withXml {
|
|
asNode().dependencies.dependency.each { dep ->
|
|
if(dep.artifactId.last().value() in ["gson"]) {
|
|
assert dep.parent().remove(dep)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
def ENV = System.getenv()
|
|
if (project.hasProperty("maven")) {
|
|
repositories.maven {
|
|
url = project.getProperty("maven")
|
|
name = "dynamic"
|
|
|
|
credentials(HttpHeaderCredentials) {
|
|
name = "Job-Token"
|
|
value = ENV.CI_JOB_TOKEN
|
|
}
|
|
authentication {
|
|
header(HttpHeaderAuthentication)
|
|
}
|
|
}
|
|
}
|
|
repositories.mavenLocal()
|
|
}
|