75 lines
1.5 KiB
Groovy
75 lines
1.5 KiB
Groovy
plugins {
|
|
// Apply the java-library plugin for API and implementation separation.
|
|
id 'java-library'
|
|
id 'idea'
|
|
id 'eclipse'
|
|
id 'maven-publish'
|
|
}
|
|
|
|
group = "dev.zontreck"
|
|
archivesBaseName = "LibAC"
|
|
|
|
|
|
|
|
java {
|
|
toolchain.languageVersion = JavaLanguageVersion.of(8)
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
|
|
def determinePatchVersion = {
|
|
// get the name of the last tag
|
|
def tagInfo = new ByteArrayOutputStream()
|
|
exec {
|
|
commandLine 'git', 'describe', '--tags'
|
|
standardOutput = tagInfo
|
|
}
|
|
tagInfo = tagInfo.toString()
|
|
|
|
if (!tagInfo.contains('-')) {
|
|
return 0
|
|
}
|
|
return tagInfo.split("-")[1]
|
|
}
|
|
|
|
version = determinePatchVersion()
|
|
version = "${apiVer}.${version}"
|
|
|
|
repositories {
|
|
// Use Maven Central for resolving dependencies.
|
|
// mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifact jar
|
|
artifact sourcesJar
|
|
artifact javadocJar
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url = "https://git.zontreck.com/api/packages/AriasCreations/maven"
|
|
name = "ariascreations"
|
|
def ENV = System.getenv()
|
|
|
|
credentials {
|
|
username = ENV.MVN_USER
|
|
password = ENV.ACMVN
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
|
}
|