Skip to content

Commit

Permalink
Merge pull request #20 from Erdragh/chore/autopublishing
Browse files Browse the repository at this point in the history
Fix dependencies for autopublishing
  • Loading branch information
Erdragh authored Oct 11, 2023
2 parents 3b3e97d + 3313bb0 commit c0a87c6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
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"
}

0 comments on commit c0a87c6

Please sign in to comment.