From 7dc0f62b31856a01663b580440ce8ec249179581 Mon Sep 17 00:00:00 2001 From: Lulonaut Date: Wed, 19 Jul 2023 23:49:30 +0200 Subject: local backup repo (#772) Co-authored-by: nopo --- build.gradle.kts | 107 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 46 deletions(-) (limited to 'build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index 970801d5..b583027c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 NotEnoughUpdates contributors + * Copyright (C) 2022-2023 NotEnoughUpdates contributors * * This file is part of NotEnoughUpdates. * @@ -21,16 +21,17 @@ import neubs.NEUBuildFlags import neubs.applyPublishingInformation import neubs.setVersionFromEnvironment +import java.net.URL plugins { - idea - java - id("gg.essential.loom") version "0.10.0.+" - id("dev.architectury.architectury-pack200") version "0.1.3" - id("com.github.johnrengelman.shadow") version "7.1.2" - id("io.github.juuxel.loom-quiltflower") version "1.7.3" - `maven-publish` - kotlin("jvm") version "1.8.21" + idea + java + id("gg.essential.loom") version "0.10.0.+" + id("dev.architectury.architectury-pack200") version "0.1.3" + id("com.github.johnrengelman.shadow") version "7.1.2" + id("io.github.juuxel.loom-quiltflower") version "1.7.3" + `maven-publish` + kotlin("jvm") version "1.8.21" id("io.gitlab.arturbosch.detekt") version "1.23.0" id("com.google.devtools.ksp") version "1.8.21-1.0.11" } @@ -46,27 +47,27 @@ setVersionFromEnvironment("2.1.1") // Minecraft configuration: loom { - launchConfigs { - "client" { - property("mixin.debug", "true") - property("asmhelper.verbose", "true") - arg("--tweakClass", "io.github.moulberry.notenoughupdates.loader.NEUDelegatingTweaker") - arg("--mixin", "mixins.notenoughupdates.json") - } + launchConfigs { + "client" { + property("mixin.debug", "true") + property("asmhelper.verbose", "true") + arg("--tweakClass", "io.github.moulberry.notenoughupdates.loader.NEUDelegatingTweaker") + arg("--mixin", "mixins.notenoughupdates.json") } - runConfigs { - "server" { - isIdeConfigGenerated = false - } - } - forge { - pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) - mixinConfig("mixins.notenoughupdates.json") - } - @Suppress("UnstableApiUsage") - mixin { - defaultRefmapName.set("mixins.notenoughupdates.refmap.json") + } + runConfigs { + "server" { + isIdeConfigGenerated = false } + } + forge { + pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) + mixinConfig("mixins.notenoughupdates.json") + } + @Suppress("UnstableApiUsage") + mixin { + defaultRefmapName.set("mixins.notenoughupdates.refmap.json") + } } @@ -220,29 +221,43 @@ tasks.remapSourcesJar { /* Bypassing https://github.com/johnrengelman/shadow/issues/111 */ // Use Zip instead of Jar as to not include META-INF val kotlinDependencyCollectionJar by tasks.creating(Zip::class) { - archiveFileName.set("kotlin-libraries-wrapped.jar") - destinationDirectory.set(project.layout.buildDirectory.dir("kotlinwrapper")) - from(kotlinDependencies) - into("neu-kotlin-libraries-wrapped") + archiveFileName.set("kotlin-libraries-wrapped.jar") + destinationDirectory.set(project.layout.buildDirectory.dir("kotlinwrapper")) + from(kotlinDependencies) + into("neu-kotlin-libraries-wrapped") +} + +tasks.register("includeBackupRepo") { + doLast { + val url = URL("https://github.com/NotEnoughUpdates/NotEnoughUpdates-REPO/archive/refs/heads/prerelease.zip") + val destinationFolder = project.buildDir.resolve("classes/java/main/assets/notenoughupdates/") + destinationFolder.mkdirs() + val destination = destinationFolder.resolve("repo.zip") + destination.createNewFile() + + destination.outputStream().use { + url.openStream().copyTo(it) + } + } } tasks.shadowJar { - archiveClassifier.set("dep-dev") - configurations = listOf(shadowImplementation, shadowApi, shadowOnly) - archiveBaseName.set("NotEnoughUpdates") - exclude("**/module-info.class", "LICENSE.txt") - dependencies { - exclude { - it.moduleGroup.startsWith("org.apache.") || it.moduleName in - listOf("logback-classic", "commons-logging", "commons-codec", "logback-core") - } + archiveClassifier.set("dep-dev") + configurations = listOf(shadowImplementation, shadowApi, shadowOnly) + archiveBaseName.set("NotEnoughUpdates") + exclude("**/module-info.class", "LICENSE.txt") + dependencies { + exclude { + it.moduleGroup.startsWith("org.apache.") || it.moduleName in + listOf("logback-classic", "commons-logging", "commons-codec", "logback-core") } - from(oneconfigQuarantineSourceSet.output) - from(kotlinDependencyCollectionJar) - dependsOn(kotlinDependencyCollectionJar) - fun relocate(name: String) = relocate(name, "io.github.moulberry.notenoughupdates.deps.$name") - relocate("com.mojang.brigadier") + } + from(oneconfigQuarantineSourceSet.output) + from(kotlinDependencyCollectionJar) + dependsOn(kotlinDependencyCollectionJar) + fun relocate(name: String) = relocate(name, "io.github.moulberry.notenoughupdates.deps.$name") + relocate("com.mojang.brigadier") } tasks.assemble.get().dependsOn(remapJar) -- cgit