add extension for loader, add esnesnon maven
All checks were successful
Publish to snapshot maven / build (push) Successful in 18s
All checks were successful
Publish to snapshot maven / build (push) Successful in 18s
This commit is contained in:
parent
bdcd5c6146
commit
5840712e5e
|
@ -18,30 +18,34 @@ import kotlin.io.path.exists
|
|||
|
||||
class NonsenseGradlePlugin : Plugin<Project> {
|
||||
|
||||
val toInject = listOf("com.electronwill.night-config:toml:3.6.0")
|
||||
|
||||
override fun apply(project: Project) {
|
||||
println("> Applying Nonsense Gradle Plugin")
|
||||
project.apply {
|
||||
mapOf("plugin" to "java-library")
|
||||
mapOf("plugin" to "java")
|
||||
mapOf("plugin" to "eclipse")
|
||||
mapOf("plugin" to "idea")
|
||||
mapOf("plugin" to "maven-publish")
|
||||
}
|
||||
|
||||
project.repositories.maven {
|
||||
project.repositories.apply {
|
||||
maven {
|
||||
it.name = "Esnesnon Releases"
|
||||
it.url = URI.create("https://maven-esnesnon.ecorous.org/releases")
|
||||
}
|
||||
maven {
|
||||
it.name = "Esnesnon Snapshots"
|
||||
it.url = URI.create("https://maven-esnesnon.ecorous.org/snapshots")
|
||||
}
|
||||
maven {
|
||||
it.name = "Minecraft/Local"
|
||||
it.url = project.gradle.gradleUserHomeDir.resolve("caches/nonsense-gradle/").toURI()
|
||||
}
|
||||
project.repositories.maven {
|
||||
maven {
|
||||
it.name = "Minecraft Libraries"
|
||||
it.url = URI.create("https://libraries.minecraft.net/")
|
||||
}
|
||||
}
|
||||
project.repositories.mavenCentral()
|
||||
project.dependencies.apply {
|
||||
toInject.forEach {
|
||||
add("implementation", it)
|
||||
}
|
||||
}
|
||||
|
||||
project.task("genSources").apply {
|
||||
group = "nonsense"
|
||||
|
@ -96,6 +100,14 @@ class NonsenseGradlePlugin : Plugin<Project> {
|
|||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
val includeConfiguration = project.configurations.create("include").apply {
|
||||
extendsFrom(project.configurations.getByName("implementation"))
|
||||
}
|
||||
|
||||
project.tasks.getByName("jar").actions.addLast {
|
||||
it.outputs.files(includeConfiguration.artifacts.files)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -53,3 +53,8 @@ fun Project.minecraft(
|
|||
}
|
||||
return this
|
||||
}
|
||||
|
||||
fun Project.loader(version: String){
|
||||
dependencies.add("implementation", "org.ecorous.esnesnon:nonsense-loader:$version")
|
||||
dependencies.add("annotationProcessor", "net.fabricmc:sponge-mixin:0.13.4-mixin.0.8.5")
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.ecorous.esnesnon.gradle.run.adapter.EclipseAdapter
|
|||
import org.ecorous.esnesnon.gradle.run.adapter.IdeaAdapter
|
||||
import org.gradle.api.Project
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.absolute
|
||||
import kotlin.io.path.createParentDirectories
|
||||
import kotlin.io.path.notExists
|
||||
|
@ -40,12 +39,12 @@ object RunConfigGenerator {
|
|||
if (!adapter.shouldGenerate())
|
||||
continue
|
||||
|
||||
for (env in Env.values()) {
|
||||
for (env in Env.entries) {
|
||||
adapter.generate(
|
||||
project,
|
||||
"Minecraft ${env.pascalName}",
|
||||
"org.ecorous.esnesnon.nonsense.loader.impl.launch.client.Nonsense${env.pascalName}",
|
||||
arrayOf("-Dnonsense.development=true", "-Dlog4j.configurationFile=" + assetPath),
|
||||
arrayOf("-Dnonsense.development=true", "-Dlog4j.configurationFile=$assetPath"),
|
||||
arrayOf(
|
||||
"--assetDir", assetPath.toString(),
|
||||
"--version", "Nonsense",
|
||||
|
|
Loading…
Reference in a new issue