2023-03-13 02:09:09 -07:00
|
|
|
plugins {
|
|
|
|
// Apply the java-library plugin for API and implementation separation.
|
|
|
|
id 'java-library'
|
2023-06-21 23:55:17 -07:00
|
|
|
id 'idea'
|
2023-08-02 00:58:34 -07:00
|
|
|
id 'eclipse'
|
2023-04-20 02:35:58 -07:00
|
|
|
id 'maven-publish'
|
2023-03-13 02:09:09 -07:00
|
|
|
}
|
|
|
|
|
2023-04-20 18:52:50 -07:00
|
|
|
group = "dev.zontreck"
|
2023-04-20 19:00:54 -07:00
|
|
|
archivesBaseName = "LibAC"
|
2023-08-02 00:58:34 -07:00
|
|
|
|
2024-09-06 13:01:05 -07:00
|
|
|
def ENV = System.getenv()
|
2024-02-06 20:52:50 -07:00
|
|
|
|
2023-08-02 00:58:34 -07:00
|
|
|
java {
|
2024-09-06 13:01:05 -07:00
|
|
|
|
2023-08-02 00:58:34 -07:00
|
|
|
withSourcesJar()
|
2023-11-19 05:08:53 -07:00
|
|
|
withJavadocJar()
|
2023-08-02 00:58:34 -07:00
|
|
|
}
|
2023-04-20 18:52:50 -07:00
|
|
|
|
2023-05-08 16:10:37 -07:00
|
|
|
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]
|
|
|
|
}
|
2024-02-10 16:35:01 -07:00
|
|
|
|
2023-05-08 16:19:09 -07:00
|
|
|
version = determinePatchVersion()
|
|
|
|
version = "${apiVer}.${version}"
|
2024-02-10 16:35:01 -07:00
|
|
|
|
2023-03-13 02:09:09 -07:00
|
|
|
repositories {
|
|
|
|
// Use Maven Central for resolving dependencies.
|
2023-07-30 13:18:03 -07:00
|
|
|
// mavenCentral()
|
2023-03-13 02:09:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
|
|
|
}
|
2023-04-20 02:35:58 -07:00
|
|
|
|
2024-09-12 01:38:45 -07:00
|
|
|
def MAVEN_PASSWORD = "AriasCreationsMavenPassword"
|
|
|
|
def MAVEN_USER = "AriasCreationsMavenUser"
|
|
|
|
|
2023-04-20 02:35:58 -07:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
artifact jar
|
2024-02-10 16:35:01 -07:00
|
|
|
artifact sourcesJar
|
2023-11-19 05:08:53 -07:00
|
|
|
artifact javadocJar
|
2023-04-20 02:35:58 -07:00
|
|
|
}
|
|
|
|
}
|
2024-09-12 01:38:45 -07:00
|
|
|
|
2023-04-20 02:35:58 -07:00
|
|
|
repositories {
|
|
|
|
maven {
|
2024-09-06 02:56:22 -07:00
|
|
|
url = "https://git.zontreck.com/api/packages/AriasCreations/maven"
|
2023-06-21 22:41:30 -07:00
|
|
|
name = "ariascreations"
|
2024-09-06 03:16:59 -07:00
|
|
|
|
|
|
|
credentials {
|
2024-09-12 01:38:45 -07:00
|
|
|
username = project.findProperty(MAVEN_USER)
|
|
|
|
password = project.findProperty(MAVEN_PASSWORD)
|
2023-06-21 22:41:30 -07:00
|
|
|
}
|
2023-04-20 02:35:58 -07:00
|
|
|
}
|
|
|
|
}
|
2023-08-02 00:17:44 -07:00
|
|
|
}
|
2023-12-05 11:31:58 -07:00
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
2024-02-06 20:52:50 -07:00
|
|
|
}
|
2024-02-06 20:59:16 -07:00
|
|
|
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
|
|
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
|
|
|
}
|