java-commons/build.gradle

72 lines
1.7 KiB
Groovy
Raw Normal View History

var cl = Calendar.instance
var day = "${cl.get(cl.YEAR)}.${cl.get(cl.MONTH) + 1}.${cl.get(cl.DATE)}"
2022-05-09 19:09:34 +02:00
var time = "${cl.get(cl.HOUR_OF_DAY)}-${cl.get(cl.MINUTE)}-${cl.get(cl.SECOND)}"
2022-05-09 19:09:34 +02:00
allprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
2022-04-28 20:52:32 +02:00
2022-05-09 19:09:34 +02:00
version = "$day+$time"
2022-04-28 20:52:32 +02:00
2022-05-09 19:09:34 +02:00
repositories {
mavenCentral()
maven {
url 'https://gitlab.com/api/v4/projects/35030495/packages/maven'
}
}
2022-04-28 20:52:32 +02:00
2022-05-09 19:09:34 +02:00
dependencies {
compileOnly 'org.jetbrains:annotations:23.0.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
test {
useJUnitPlatform()
}
java {
withSourcesJar()
}
2022-04-28 20:52:32 +02:00
2022-05-09 19:09:34 +02:00
publishing {
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()
}
2022-04-28 20:52:32 +02:00
}
2022-05-09 19:09:34 +02:00
subprojects {
dependencies {
implementation project(':')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
}
2022-04-28 20:52:32 +02:00
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'io.gitlab.jfronny'
artifactId = 'commons'
from components.java
}
}
}