Skip to content

Commit

Permalink
Fixed versioned files creating
Browse files Browse the repository at this point in the history
  • Loading branch information
LopyMine committed Jun 16, 2024
1 parent 2db3dc0 commit d054161
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ def createAW(String version) {
if (!awsFolder.exists() && !awsFolder.mkdirs()) {
return
}
def file = file("src/main/resources/aws/${version}.accesswidener")
if (file.exists()) {
def awFile = file("src/main/resources/aws/${version}.accesswidener")
if (awFile.exists() || !awFile.createNewFile()) {
return
}
file.createNewFile()
def writer = new FileWriter(file)

awFile.createNewFile()
def writer = new FileWriter(awFile)
writer.write("accessWidener v2 named\n")
writer.write("# ${version} AW\n")
writer.close()
Expand All @@ -83,11 +84,10 @@ def createMixin(String version) {
if (!mixinsFolder.exists() && !mixinsFolder.mkdirs()) {
return
}
def file = file("src/main/resources/mixins/${version}-${mod_id}.mixins.json5")
if (file.exists()) {
def mixinsFile = file("src/main/resources/mixins/${version}-${mod_id}.mixins.json5")
if (mixinsFile.exists() || !mixinsFile.createNewFile()) {
return
}
file.createNewFile()

def mixinContent = [
required: true,
Expand All @@ -101,19 +101,21 @@ def createMixin(String version) {
]
]

file.text = new JsonBuilder(mixinContent).toPrettyString()
mixinsFile.text = new JsonBuilder(mixinContent).toPrettyString()
println "Successfully created Mixin for ${version}"
}

def createGradleProperties(String version, ArrayList<String> additionalDepends) {
def file = file("/versions/${version}/gradle.properties")
if (file.exists()) {
def folderFile = file("/versions/${version}")
if (!folderFile.exists() && !folderFile.mkdirs()) {
return
}
def gradleProperties = file("/versions/${version}/gradle.properties")
if (gradleProperties.exists() || !gradleProperties.createNewFile()) {
return
}

file.createNewFile()

def writer = new FileWriter(file)
def writer = new FileWriter(gradleProperties)
writer.write("# Versioned Properties\n")
writer.write("\n")
writer.write("# Java Properties\n")
Expand Down

0 comments on commit d054161

Please sign in to comment.