mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-10-16 16:04:32 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
758385c225 | ||
|
304fb802ed | ||
|
cc063773d8 | ||
|
1deed7dd0d |
27
.github/workflows/pr.yml
vendored
Normal file
27
.github/workflows/pr.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Java Gradle Build
|
||||
|
||||
on:
|
||||
pull_request
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
- name: Cleanup Gradle Cache
|
||||
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
|
||||
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
|
||||
run: |
|
||||
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
||||
rm -f ~/.gradle/caches/modules-2/gc.properties
|
5
.github/workflows/snapshot.yml
vendored
5
.github/workflows/snapshot.yml
vendored
@@ -1,6 +1,9 @@
|
||||
name: Java Gradle Snapshot
|
||||
|
||||
on: ["push", "pull_request"]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@@ -109,9 +109,9 @@ internal class DownloadTask private constructor(val metadata: IndexFile.File, va
|
||||
cachedFile.optionValue = linkedFile.option.defaultValue
|
||||
}
|
||||
}
|
||||
cachedFile.isOptional = isOptional
|
||||
cachedFile.onlyOtherSide = !correctSide()
|
||||
}
|
||||
cachedFile.isOptional = isOptional
|
||||
cachedFile.onlyOtherSide = !correctSide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ import link.infra.packwiz.installer.ui.IUserInterface.ExceptionListResult
|
||||
import link.infra.packwiz.installer.ui.data.InstallProgress
|
||||
import link.infra.packwiz.installer.util.Log
|
||||
import okio.buffer
|
||||
import java.io.FileWriter
|
||||
import java.io.IOException
|
||||
import java.io.InputStreamReader
|
||||
import java.nio.charset.StandardCharsets
|
||||
@@ -197,7 +196,7 @@ class UpdateManager internal constructor(private val opts: Options, val ui: IUse
|
||||
|
||||
manifest.cachedSide = opts.side
|
||||
try {
|
||||
FileWriter(opts.manifestFile.nioPath.toFile()).use { writer -> gson.toJson(manifest, writer) }
|
||||
Files.newBufferedWriter(opts.manifestFile.nioPath, StandardCharsets.UTF_8).use { writer -> gson.toJson(manifest, writer) }
|
||||
} catch (e: IOException) {
|
||||
ui.showErrorAndExit("Failed to save local manifest file", e)
|
||||
}
|
||||
|
@@ -4,42 +4,29 @@ import cc.ekblad.toml.model.TomlValue
|
||||
import cc.ekblad.toml.tomlMapper
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
enum class Side {
|
||||
enum class Side(sideName: String) {
|
||||
@SerializedName("client")
|
||||
CLIENT("client"),
|
||||
@SerializedName("server")
|
||||
SERVER("server"),
|
||||
@SerializedName("both")
|
||||
@Suppress("unused")
|
||||
BOTH("both", arrayOf(CLIENT, SERVER));
|
||||
BOTH("both") {
|
||||
override fun hasSide(tSide: Side): Boolean {
|
||||
return true
|
||||
}
|
||||
};
|
||||
|
||||
private val sideName: String
|
||||
private val depSides: Array<Side>?
|
||||
|
||||
constructor(sideName: String) {
|
||||
init {
|
||||
this.sideName = sideName.lowercase()
|
||||
depSides = null
|
||||
}
|
||||
|
||||
constructor(sideName: String, depSides: Array<Side>) {
|
||||
this.sideName = sideName.lowercase()
|
||||
this.depSides = depSides
|
||||
}
|
||||
|
||||
override fun toString() = sideName
|
||||
|
||||
fun hasSide(tSide: Side): Boolean {
|
||||
if (this == tSide) {
|
||||
return true
|
||||
}
|
||||
if (depSides != null) {
|
||||
for (depSide in depSides) {
|
||||
if (depSide == tSide) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
open fun hasSide(tSide: Side): Boolean {
|
||||
return this == tSide || tSide == BOTH
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
Reference in New Issue
Block a user