LibAC/build.gradle

94 lines
2.5 KiB
Groovy
Raw Normal View History

2023-03-13 02:09:09 -07:00
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/8.0.2/userguide/building_java_projects.html
*/
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-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"
archivesBaseName = "LibAC"
2023-04-20 21:55:11 -07:00
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
2023-04-20 18:52:50 -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]
}
2023-05-08 16:19:09 -07:00
version = determinePatchVersion()
version = "${apiVer}.${version}"
2023-03-13 02:09:09 -07:00
repositories {
// Use Maven Central for resolving dependencies.
2023-07-30 13:18:03 -07:00
// mavenCentral()
maven {
2023-07-30 13:24:36 -07:00
url = "https://maven.zontreck.dev/repository/internal"
2023-07-30 13:18:03 -07:00
name = "Aria's Creations"
}
2023-03-13 02:09:09 -07:00
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:31.1-jre'
}
2023-04-20 02:35:58 -07:00
2023-06-21 22:41:30 -07:00
def MAVEN_PASSWORD_PROPERTY = "AriasCreationsMavenPassword"
task sourceJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = "sources"
manifest {
attributes([
"Specification-Title": project.name,
"Specification-Vendor": "zontreck",
"Specification-Version":"${version}"
])
}
}
2023-04-20 02:35:58 -07:00
publishing {
publications {
mavenJava(MavenPublication) {
artifact sourceJar
2023-04-20 02:35:58 -07:00
artifact jar
}
}
repositories {
maven {
2023-07-30 13:23:17 -07:00
url = "https://maven.zontreck.dev/repository/zontreck"
2023-06-21 22:41:30 -07:00
name = "ariascreations"
if (project.findProperty(MAVEN_PASSWORD_PROPERTY) != null) {
credentials {
username = "admin"
password = project.findProperty(MAVEN_PASSWORD_PROPERTY)
}
}
2023-04-20 02:35:58 -07:00
}
}
}
compileJava.finalizedBy("sourceJar")
artifacts {
archives jar
archives sourceJar
2023-04-20 02:35:58 -07:00
}