]> git.lizzy.rs Git - LightOverlay.git/commitdiff
Move some code in the common module to the plugin
authorshedaniel <daniel@shedaniel.me>
Fri, 2 Oct 2020 10:41:21 +0000 (18:41 +0800)
committershedaniel <daniel@shedaniel.me>
Fri, 2 Oct 2020 10:41:21 +0000 (18:41 +0800)
Signed-off-by: shedaniel <daniel@shedaniel.me>
architectPlugin/src/main/kotlin/me/shedaniel/plugin/architect/ArchitectPluginExtension.kt
common/build.gradle

index 260bdfa1aa3e832782c9d31017b3f51370490b50..afd5a3e5b1772deddc0927a832c61ca39ad01a7c 100644 (file)
@@ -4,4 +4,25 @@ import org.gradle.api.Project
 
 open class ArchitectPluginExtension(val project: Project) {
     var minecraft = ""
+
+    fun common() {
+        project.configurations.create("mcp")
+
+        project.tasks.getByName("remapMcp") {
+            it as RemapMCPTask
+
+            it.input.set(project.file("${project.buildDir}/libs/${project.properties["archivesBaseName"]}-${project.version}-dev.jar"))
+            it.archiveClassifier.set("mcp")
+            it.dependsOn(project.tasks.getByName("jar"))
+            project.tasks.getByName("build").dependsOn(it)
+        }
+
+        project.artifacts {
+            it.add("mcp", mapOf(
+                    "file" to project.file("${project.buildDir}/libs/${project.properties["archivesBaseName"]}-${project.version}-mcp.jar"),
+                    "type" to "jar",
+                    "builtBy" to project.tasks.getByName("remapMcp")
+            ))
+        }
+    }
 }
\ No newline at end of file
index 79e9531b53d17470b3ac8424227a0df0ebc78562..6c6aadb968ef080f869e4e233adbd852471ba9b2 100644 (file)
@@ -8,19 +8,6 @@ dependencies {
     modCompile "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
 }
 
-configurations {
-    mcp
-}
-
-remapMcp {
-    input.set(file("${project.buildDir}/libs/$archivesBaseName-${project.version}-dev.jar"))
-    classifier("mcp")
-}
-
-remapJar.dependsOn(jar)
-
-artifacts {
-    mcp file: file("${project.buildDir}/libs/$archivesBaseName-${version}-mcp.jar"), type: "jar", builtBy: remapMcp
-}
-
-build.dependsOn(remapMcp)
\ No newline at end of file
+architect {
+    common()
+}
\ No newline at end of file