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 {
|
plugins {
|
||||||
java
|
java
|
||||||
`java-library`
|
`java-library`
|
||||||
`maven-publish`
|
|
||||||
id("com.gradleup.shadow") version "8.3.6"
|
id("com.gradleup.shadow") version "8.3.6"
|
||||||
id("de.undercouch.download") version "5.0.1"
|
id("de.undercouch.download") version "5.0.1"
|
||||||
id("xyz.jpenilla.run-paper") version "2.3.1"
|
id("xyz.jpenilla.run-paper") version "2.3.1"
|
||||||
|
@ -14,15 +14,20 @@ import java.util.jar.JarOutputStream
|
|||||||
|
|
||||||
class ApiGenerator : Plugin<Project> {
|
class ApiGenerator : Plugin<Project> {
|
||||||
override fun apply(target: Project): Unit = with(target) {
|
override fun apply(target: Project): Unit = with(target) {
|
||||||
|
plugins.apply("maven-publish")
|
||||||
val task = tasks.register("irisApi", GenerateApiTask::class.java)
|
val task = tasks.register("irisApi", GenerateApiTask::class.java)
|
||||||
extensions.findByType(PublishingExtension::class.java)!!
|
extensions.findByType(PublishingExtension::class.java)!!.apply {
|
||||||
.publications
|
repositories.maven {
|
||||||
.create("maven", MavenPublication::class.java) {
|
it.name = "deployDir"
|
||||||
it.groupId = group.toString()
|
it.url = targetDirectory.toURI()
|
||||||
it.artifactId = name
|
}
|
||||||
|
|
||||||
|
publications.create("maven", MavenPublication::class.java) {
|
||||||
|
it.groupId = name
|
||||||
it.version = version.toString()
|
it.version = version.toString()
|
||||||
it.artifact(task)
|
it.artifact(task)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +50,7 @@ abstract class GenerateApiTask : DefaultTask() {
|
|||||||
.asFile
|
.asFile
|
||||||
|
|
||||||
@OutputFile
|
@OutputFile
|
||||||
val outputFile: File = targetDirectory().resolve(inputFile.name)
|
val outputFile: File = project.targetDirectory.resolve(inputFile.name)
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun generate() {
|
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
|
val dir = System.getenv("DEPLOY_DIR") ?: return project.layout.buildDirectory.dir("api").get().asFile
|
||||||
return File(dir)
|
return File(dir)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MethodClearingVisitor(
|
private class MethodClearingVisitor(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user