Skip to content

Commit

Permalink
Merge branch 'alpha' into 'beta'
Browse files Browse the repository at this point in the history
MS8

See merge request Griefed/ServerPackCreator!612
  • Loading branch information
Griefed committed Sep 23, 2024
2 parents 252c237 + 896f54b commit 65b4609
Show file tree
Hide file tree
Showing 31 changed files with 2,550 additions and 1,693 deletions.
12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ updates:
labels:
- "dependencies"
- "github-actions"
target-branch: "dependabot"
target-branch: "develop"
pull-request-branch-name:
separator: "-"

Expand All @@ -30,7 +30,7 @@ updates:
labels:
- "dependencies"
- "gradle"
target-branch: "dependabot"
target-branch: "develop"
pull-request-branch-name:
separator: "-"

Expand All @@ -43,7 +43,7 @@ updates:
labels:
- "dependencies"
- "gradle"
target-branch: "dependabot"
target-branch: "develop"
pull-request-branch-name:
separator: "-"

Expand All @@ -56,7 +56,7 @@ updates:
labels:
- "dependencies"
- "gradle"
target-branch: "dependabot"
target-branch: "develop"
pull-request-branch-name:
separator: "-"

Expand All @@ -72,7 +72,7 @@ updates:
labels:
- "dependencies"
- "npm"
target-branch: "dependabot"
target-branch: "develop"
pull-request-branch-name:
separator: "-"

Expand All @@ -88,6 +88,6 @@ updates:
labels:
- "dependencies"
- "docker"
target-branch: "dependabot"
target-branch: "develop"
pull-request-branch-name:
separator: "-"
2 changes: 1 addition & 1 deletion .runConfigurations/Run App.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="Run App" type="JetRunConfigurationType">
<option name="MAIN_CLASS_NAME" value="de.griefed.serverpackcreator.app.ServerPackCreatorKt" />
<module name="serverpackcreator.serverpackcreator-app.main" />
<option name="PROGRAM_PARAMETERS" value="--home &quot;$ProjectFileDir$/serverpackcreator-app/tests&quot;" />
<option name="PROGRAM_PARAMETERS" value="--home &quot;$ProjectFileDir$/serverpackcreator-app/tests&quot; -cli" />
<shortenClasspath name="NONE" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/serverpackcreator-app/tests" />
<method v="2">
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
## [7.0.0-alpha.3](https://git.griefed.de/Griefed/ServerPackCreator/compare/7.0.0-alpha.2...7.0.0-alpha.3) (2024-09-23)


### :scissors: Refactor

* Improve modpack logging incase it wasn't found ([776b233](https://git.griefed.de/Griefed/ServerPackCreator/commit/776b2331196a8246ab49b7484f2f995f97fa2749))


### 🛠 Fixes

* Make feelingLucky command usable in interactive cli ([2a05f20](https://git.griefed.de/Griefed/ServerPackCreator/commit/2a05f2091a901b1f940d8b8e83d438cfbab29229))
* Make scripts writable during creation to prevent incorrect content ([15e41ba](https://git.griefed.de/Griefed/ServerPackCreator/commit/15e41ba2dfd845d27989a15e8878997cbd81e98e))

## [7.0.0-alpha.2](https://git.griefed.de/Griefed/ServerPackCreator/compare/7.0.0-alpha.1...7.0.0-alpha.2) (2024-09-22)


### 📔 Docs

* Fun Stuff chapter. Added chapter for self-contained, self-extracting scripts as wrappers for server packs for EZ distribution ([11b9b47](https://git.griefed.de/Griefed/ServerPackCreator/commit/11b9b47055a7f93aed758e14463a422a356a8150))


### 🦊 CI/CD

* Switch dependabot branch to develop ([daf4768](https://git.griefed.de/Griefed/ServerPackCreator/commit/daf4768187212debf8c7298519e82cfacb39dc8e))


### 🧨 Breaking changes!

* Remove ConfigurationEditor in favor of basic config generation from modpack directory. You may edit the generated config in your favourite text-editor afterwards. ([4295be9](https://git.griefed.de/Griefed/ServerPackCreator/commit/4295be971fff3c3c0ea57953f7a42869d032323d))


### 🚀 Features

* `-feelinglucky` argument and command to generate a server pack from a modpack without needing a config first. Supports `--destination`, too. ([8a98957](https://git.griefed.de/Griefed/ServerPackCreator/commit/8a98957fc703ea22c8f48f9b65798f1665478c14))

## [7.0.0-alpha.1](https://git.griefed.de/Griefed/ServerPackCreator/compare/6.3.11...7.0.0-alpha.1) (2024-09-21)


### ✨ Milestone

* **CLI rework:** Interactive command-based CLI along with some improvements and additions. ([4bd5dce](https://git.griefed.de/Griefed/ServerPackCreator/commit/4bd5dce2971b1f56f2fcb3e6b99d7405a830948a))

## [6.3.11](https://git.griefed.de/Griefed/ServerPackCreator/compare/6.3.10...6.3.11) (2024-09-20)


Expand Down
258 changes: 194 additions & 64 deletions HELP.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1521,4 +1521,45 @@ class ConfigurationHandler(
}
return files
}

/**
* Generate a [PackConfig] from a modpack-directory, resulting in a basic server pack configuration with default
* values, for an easy-to-use starting point of a server pack config.
*
* @param modpackDirectory The directory which contains the modpack for which a server pack config should be generated.
* @return A [PackConfig] for the specified modpack. If no manifests were available, then this PackConfig will only
* contain basic values, like a list of clientside-only mods, but no detected Minecraft version, modloader, or modloader
* version etc.
*
* @author Griefed
*/
fun generateConfigFromModpack(modpackDirectory: File): PackConfig {
val packConfig = PackConfig()
if (modpackDirectory.isDirectory) {
packConfig.modpackDir = modpackDirectory.absolutePath
try {
val inclusions = emptyList<InclusionSpecification>().toMutableList()
val files = modpackDirectory.listFiles()

packConfig.name = checkManifests(modpackDirectory.absolutePath, packConfig)

if (files != null && files.isNotEmpty()) {
for (file in files) {
if (apiProperties.directoriesToInclude.contains(file.name) &&
!inclusions.any { inclusion -> inclusion.source == file.name }
) {
inclusions.add(InclusionSpecification(file.name))
}
}
}
inclusions.removeIf { !File(modpackDirectory,it.source).exists() && !File(it.source).exists() }

packConfig.setInclusions(ArrayList<InclusionSpecification>(inclusions))

} catch (ex: IOException) {
log.error("Couldn't create server pack config from modpack manifests.", ex)
}
}
return packConfig
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.apache.logging.log4j.kotlin.cachedLoggerOf
import java.io.File
import java.io.FileNotFoundException
import java.nio.charset.StandardCharsets
import java.util.*

private const val modpackComment =
"\n Path to your modpack. Can be either relative or absolute." +
Expand Down Expand Up @@ -135,22 +136,6 @@ private const val javaKey = "SPC_JAVA_SPC"

private const val configVersionKey = "configVersion"

private const val spcVersionKey = "SPC_SERVERPACKCREATOR_VERSION_SPC"

private const val spcMinecraftVersionKey = "SPC_MINECRAFT_VERSION_SPC"

private const val spcModloaderKey = "SPC_MODLOADER_SPC"

private const val spcModloaderVersionKey = "SPC_MODLOADER_VERSION_SPC"

private const val spcJavaArgsKey = "SPC_JAVA_ARGS_SPC"

private const val spcFabricInstallerVersionKey = "SPC_FABRIC_INSTALLER_VERSION_SPC"

private const val spcQuiltInstallerVersionKey = "SPC_QUILT_INSTALLER_VERSION_SPC"

private const val spcLegacyFabricInstallerVersionKey = "SPC_LEGACYFABRIC_INSTALLER_VERSION_SPC"

private const val spcWaitForUserInputKey = "SPC_WAIT_FOR_USER_INPUT_SPC"

private const val spcRestartServerKey = "SPC_RESTART_SPC"
Expand Down Expand Up @@ -230,6 +215,8 @@ open class PackConfig() {
var modpackJson: JsonNode? = null
var configVersion: String? = null

var customDestination: Optional<File> = Optional.empty()

open var projectID: String? = null
open var versionID: String? = null
open var source: ModpackSource = ModpackSource.DIRECTORY
Expand Down
Loading

0 comments on commit 65b4609

Please sign in to comment.