mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-21 11:43:27 +00:00
if it still doesn't work, idk what will
This commit is contained in:
parent
12777bc3f0
commit
fbc5cee300
@ -30,7 +30,6 @@ buildscript {
|
||||
plugins {
|
||||
java
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
id("com.gradleup.shadow") version "8.3.6"
|
||||
id("de.undercouch.download") version "5.0.1"
|
||||
id("xyz.jpenilla.run-paper") version "2.3.1"
|
||||
|
@ -14,16 +14,21 @@ import java.util.jar.JarOutputStream
|
||||
|
||||
class ApiGenerator : Plugin<Project> {
|
||||
override fun apply(target: Project): Unit = with(target) {
|
||||
plugins.apply("maven-publish")
|
||||
val task = tasks.register("irisApi", GenerateApiTask::class.java)
|
||||
extensions.findByType(PublishingExtension::class.java)!!
|
||||
.publications
|
||||
.create("maven", MavenPublication::class.java) {
|
||||
it.groupId = group.toString()
|
||||
it.artifactId = name
|
||||
extensions.findByType(PublishingExtension::class.java)!!.apply {
|
||||
repositories.maven {
|
||||
it.name = "deployDir"
|
||||
it.url = targetDirectory.toURI()
|
||||
}
|
||||
|
||||
publications.create("maven", MavenPublication::class.java) {
|
||||
it.groupId = name
|
||||
it.version = version.toString()
|
||||
it.artifact(task)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abstract class GenerateApiTask : DefaultTask() {
|
||||
@ -45,7 +50,7 @@ abstract class GenerateApiTask : DefaultTask() {
|
||||
.asFile
|
||||
|
||||
@OutputFile
|
||||
val outputFile: File = targetDirectory().resolve(inputFile.name)
|
||||
val outputFile: File = project.targetDirectory.resolve(inputFile.name)
|
||||
|
||||
@TaskAction
|
||||
fun generate() {
|
||||
@ -72,11 +77,11 @@ abstract class GenerateApiTask : DefaultTask() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun targetDirectory(): File {
|
||||
val Project.targetDirectory: File get() {
|
||||
val dir = System.getenv("DEPLOY_DIR") ?: return project.layout.buildDirectory.dir("api").get().asFile
|
||||
return File(dir)
|
||||
}
|
||||
}
|
||||
|
||||
private class MethodClearingVisitor(
|
||||
|
Loading…
x
Reference in New Issue
Block a user