Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dependencies for autopublishing #20

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions gradle/publishing/curseforge.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ curseforge {
addGameVersion(minecraft_version)

relations {
requiredDependency("fabric-api")
requiredDependency("fabric-language-kotlin")
requiredDependency("forge-config-api-port-fabric")
optionalDependency("roughly-enough-items")
for (dependency in (depends as List<String>)) {
var optionalDep = dependency.endsWith("?")
if (optionalDep) {
optionalDependency(dependency.replace("?", ""))
} else {
requiredDependency(dependency)
}
}
}

// https://github.com/mraliscoder/plasmo-voice/blob/41243bc77589d975acde5385dd86414b1c92a2a8/fabric/build.gradle.kts#L173
Expand Down
12 changes: 8 additions & 4 deletions gradle/publishing/modrinth.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ modrinth {
gameVersions = [ minecraft_version ]
loaders = ["fabric"]
dependencies {
required.project "fabric-api"
required.project "fabric-language-kotlin"
required.project "forge-config-api-port"
optional.project "rei"
for (dependency in (depends as List<String>)) {
var optionalDep = dependency.endsWith("?")
if (optionalDep) {
optional.project(dependency.replace("?", ""))
} else {
required.project(dependency)
}
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions gradle/publishing/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ext /*-ra properties*/ {
Properties properties = new Properties()
properties.load(new FileInputStream(file("gradle/publishing/publishing.properties")))

depends = ((String) properties.get("dependencies"))?.split("; *")

properties.forEach ((k, v) -> set(k, v))

version_valid = versionValidForPublishing(version)
Expand All @@ -30,6 +32,17 @@ tasks.register("printVersion") {
println(version)
}

tasks.register("printDependencies") {
for (dependency in (depends as List<String>)) {
var optionalDep = dependency.endsWith("?")
if (optionalDep) {
println("optional: " + dependency);
} else {
println("required: " + dependency);
}
}
}

static String makeName(String version, String minecraftVersion, String displayName) {
String projectVersion = "v" + version.split("-build")[0].replace("-", ".")
String rawPatch = System.getenv("PATCH_NUMBER")
Expand Down
1 change: 1 addition & 0 deletions gradle/publishing/publishing.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ modrinth_id = 4Q5DgkRU
curseforge_id = 833210
release_type = release
changelog_file = CHANGELOG.md
dependencies = ad-astra;fabric-api;forge-config-api-port
3 changes: 2 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"fabricloader": ">=${loader_version}",
"fabric": "*",
"minecraft": "1.18.2",
"ad_astra": ">=1.0.9"
"ad_astra": ">=1.0.9",
"forgeconfigapiport": ">=3.2.4"
},
"accessWidener": "per_aspera.accesswidener"
}