4
0
Fork 0
mirror of https://github.com/Anvilcraft/modpacktools synced 2024-05-19 20:04:07 +02:00

Revert "move settings from build file into gradle.properties"

This reverts commit 5844a7c488.
This commit is contained in:
Timo Ley 2020-08-14 15:19:10 +02:00
parent 5844a7c488
commit 65a2e6748b
3 changed files with 18 additions and 14 deletions

View file

@ -7,6 +7,14 @@ import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.HTML
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.JSON
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.PLAIN
//settings for manifest and stuff
val specTitle = "ModPackTools"
val artifact = specTitle.toLowerCase()
val jarName = specTitle
val implTitle = "ley.anvil.modpacktools"
val jarVersion = "1.2-SNAPSHOT"
group = "ley.anvil"
application.mainClassName = "ley.anvil.modpacktools.Main"
plugins {
@ -37,8 +45,9 @@ dependencies {
"ley.anvil:addonscript:1.0-SNAPSHOT",
//Kotlin
"org.jetbrains.kotlin:kotlin-stdlib-jdk8",
"org.jetbrains.kotlin:kotlin-reflect:1.3.72",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8",
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.8",
//IO
"com.squareup.okhttp3:okhttp:4.8.1", //HTTP client
@ -82,11 +91,11 @@ task("fatJar", Jar::class) {
group = "build" //sets group in intelliJ's side bar
manifest.attributes.apply {
set("Main-Class", application.mainClassName)
set("Implementation-Version", findProperty("jarVersion"))
set("Specification-Title", findProperty("specTitle"))
set("Implementation-Title", findProperty("implTitle"))
set("Implementation-Version", jarVersion)
set("Specification-Title", specTitle)
set("Implementation-Title", implTitle)
}
archiveBaseName.set("${findProperty("jarName")}-${findProperty("jarVersion")}")
archiveBaseName.set(jarName)
from(
configurations.runtimeClasspath.get()
.map {if(it.isDirectory) it else zipTree(it)}
@ -97,7 +106,7 @@ task("fatJar", Jar::class) {
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = findProperty("artifact") as String
artifactId = artifact
artifact(tasks["fatJar"])
}
}

View file

@ -1,6 +0,0 @@
specTitle = ModPackTools
jarName = ModPackTools
artifact = modpacktools
implTitle = ley.anvil.modpacktools
jarVersion = 1.2-SNAPSHOT
group = ley.anvil

View file

@ -1,5 +1,6 @@
package ley.anvil.modpacktools.commands
import com.google.gson.stream.JsonReader
import ley.anvil.addonscript.curse.ManifestJSON
import ley.anvil.modpacktools.GSON
import ley.anvil.modpacktools.MPJH
@ -8,12 +9,12 @@ import ley.anvil.modpacktools.command.CommandReturn.Companion.fail
import ley.anvil.modpacktools.command.CommandReturn.Companion.success
import ley.anvil.modpacktools.command.ICommand
import ley.anvil.modpacktools.command.LoadCommand
import ley.anvil.modpacktools.util.readAsJson
import net.sourceforge.argparse4j.ArgumentParsers
import net.sourceforge.argparse4j.impl.type.FileArgumentType
import net.sourceforge.argparse4j.inf.ArgumentParser
import net.sourceforge.argparse4j.inf.Namespace
import java.io.File
import java.io.FileReader
import java.io.FileWriter
@LoadCommand
@ -41,7 +42,7 @@ object Import : ICommand {
println("Converting...")
MPJH.modpackJsonFile.parentFile.mkdirs()
val mpjWriter = FileWriter(MPJH.modpackJsonFile)
GSON.fromJson<ManifestJSON>(manifest.readAsJson(), ManifestJSON::class.java).toAS().write(mpjWriter)
GSON.fromJson<ManifestJSON>(JsonReader(FileReader(manifest)), ManifestJSON::class.java).toAS().write(mpjWriter)
mpjWriter.close()
return success("Converted sucessfully")
}