-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bda5804
commit fd9e2ba
Showing
70 changed files
with
1,508 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
* text eol=lf | ||
*.bat text eol=crlf | ||
*.patch text eol=lf | ||
*.java text eol=lf | ||
*.gradle text eol=crlf | ||
*.png binary | ||
*.gif binary | ||
*.exe binary | ||
*.dll binary | ||
*.jar binary | ||
*.lzma binary | ||
*.zip binary | ||
*.pyd binary | ||
*.cfg text eol=lf | ||
*.jks binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
Prior to version 3.1.0, this project used [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/). | ||
|
||
This is a copy of the changelog for the most recent version. For the full version history, go [here](https://github.com/TheIllusiveC4/Caelus/blob/1.20.2/docs/CHANGELOG.md). | ||
This is a copy of the changelog for the most recent version. For the full version history, go [here](https://github.com/TheIllusiveC4/Caelus/blob/1.20.4/docs/CHANGELOG.md). | ||
|
||
## [4.0.0+1.20.2] - 2023.10.19 | ||
## [5.0.0+1.20.4] - 2023.12.19 | ||
### Changed | ||
- Updated to Minecraft 1.20.2 | ||
- Updated to Minecraft 1.20.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
import javax.net.ssl.HttpsURLConnection | ||
import java.nio.charset.StandardCharsets | ||
|
||
plugins { | ||
// Required for NeoGradle | ||
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" | ||
} | ||
|
||
subprojects { | ||
apply plugin: 'java' | ||
|
||
java.toolchain.languageVersion = JavaLanguageVersion.of(17) | ||
java.withSourcesJar() | ||
java.withJavadocJar() | ||
|
||
jar { | ||
from(rootProject.file("LICENSE")) | ||
from(rootProject.file("COPYING")) | ||
from(rootProject.file("COPYING.LESSER")) | ||
from(rootProject.file("README.md")) | ||
from(rootProject.file("CHANGELOG.md")) | ||
manifest { | ||
attributes([ | ||
'Specification-Title' : mod_name, | ||
'Specification-Vendor' : mod_author, | ||
'Specification-Version' : project.jar.archiveVersion, | ||
'Implementation-Title' : project.name, | ||
'Implementation-Version' : project.jar.archiveVersion, | ||
'Implementation-Vendor' : mod_author, | ||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), | ||
'Timestamp' : System.currentTimeMillis(), | ||
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", | ||
'Built-On-Minecraft' : minecraft_version | ||
]) | ||
} | ||
} | ||
|
||
sourcesJar { | ||
from(rootProject.file("LICENSE")) | ||
from(rootProject.file("COPYING")) | ||
from(rootProject.file("COPYING.LESSER")) | ||
from(rootProject.file("README.md")) | ||
from(rootProject.file("CHANGELOG.md")) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = 'Sponge / Mixin' | ||
url = 'https://repo.spongepowered.org/repository/maven-public/' | ||
} | ||
maven { | ||
name = 'BlameJared Maven (JEI / CraftTweaker / Bookshelf)' | ||
url = 'https://maven.blamejared.com' | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.encoding = 'UTF-8' | ||
it.options.getRelease().set(17) | ||
} | ||
|
||
processResources { | ||
def expandProps = [ | ||
"version" : version, | ||
"group" : project.group, //Else we target the task's group. | ||
"minecraft_version" : minecraft_version, | ||
"forge_version" : forge_version, | ||
"forge_loader_version_range" : forge_loader_version_range, | ||
"forge_version_range" : forge_version_range, | ||
"minecraft_version_range" : minecraft_version_range, | ||
"minecraft_version_range_alt" : minecraft_version_range_alt, | ||
"mod_name" : mod_name, | ||
"mod_author" : mod_author, | ||
"mod_id" : mod_id, | ||
"license" : license, | ||
"issues_url" : issues_url, | ||
"sources_url" : sources_url, | ||
"description" : project.description, | ||
"neoforge_version" : neoforge_version, | ||
"neoforge_loader_version_range": neoforge_loader_version_range | ||
] | ||
|
||
filesMatching(['pack.mcmeta', 'META-INF/mods.toml', '*.mixins.json']) { | ||
expand expandProps | ||
} | ||
inputs.properties(expandProps) | ||
} | ||
|
||
// Disables Gradle's custom module metadata from being published to maven. The | ||
// metadata includes mapped dependencies which are not reasonably consumable by | ||
// other mod developers. | ||
tasks.withType(GenerateModuleMetadata).configureEach { | ||
enabled = false | ||
} | ||
|
||
tasks.withType(Jar).all { | ||
duplicatesStrategy = DuplicatesStrategy.INCLUDE | ||
} | ||
} | ||
|
||
def publishDiscord() { | ||
try { | ||
def cfLinks = new StringJoiner('\\n') | ||
|
||
if (project(':forge').hasProperty('curse_link')) { | ||
cfLinks.add("[Forge](${project(':forge').findProperty('curse_link')})") | ||
} | ||
|
||
if (project(':neoforge').hasProperty('curse_link')) { | ||
cfLinks.add("[NeoForge](${project(':neoforge').findProperty('curse_link')})") | ||
} | ||
def modrinthLinks = new StringJoiner('\\n') | ||
|
||
if (project(':forge').hasProperty('modrinth_link')) { | ||
modrinthLinks.add("[Forge](${project(':forge').findProperty('modrinth_link')})") | ||
} | ||
|
||
if (project(':neoforge').hasProperty('curse_link')) { | ||
modrinthLinks.add("[NeoForge](${project(':neoforge').findProperty('modrinth_link')})") | ||
} | ||
println(cfLinks) | ||
println(modrinthLinks) | ||
def changelog = file("CHANGELOG_LATEST.md").getText() | ||
changelog = changelog.substring(changelog.indexOf("##")) | ||
changelog = changelog.replaceAll("\n", "\\\\n") | ||
|
||
if (changelog.length() >= 1024) { | ||
changelog = changelog.substring(0, changelog.length() - 100) | ||
changelog = changelog + "...[(See more)](${changelog_link})" | ||
} | ||
println(changelog) | ||
int color = 65392 | ||
|
||
if (release_type == "beta") { | ||
color = 16763904 | ||
} else if (release_type == "alpha") { | ||
color = 16724273 | ||
} | ||
final String message = """ | ||
{ | ||
"embeds": [ | ||
{ | ||
"title": "${mod_name} ${version}", | ||
"color": ${color}, | ||
"fields": [ | ||
{ | ||
"name": "Minecraft Versions", | ||
"value": "${release_versions.replaceAll(",", ", ")}" | ||
}, | ||
{ | ||
"name": "CurseForge", | ||
"value": "${cfLinks}", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "Modrinth", | ||
"value": "${modrinthLinks}", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "Changelog", | ||
"value": "${changelog}" | ||
} | ||
], | ||
"thumbnail": { | ||
"url": "${discord_thumbnail}" | ||
} | ||
} | ||
] | ||
} | ||
""" | ||
println(message) | ||
final URL url = new URL("${discordWebhook}") | ||
final HttpsURLConnection connection = (HttpsURLConnection) url.openConnection() | ||
connection.addRequestProperty("Content-Type", "application/json; charset=UTF-8") | ||
connection.addRequestProperty("User-Agent", "${mod_name} Gradle Upload") | ||
connection.setDoOutput(true) | ||
connection.setRequestMethod("POST") | ||
connection.connect() | ||
|
||
try (OutputStream out = connection.getOutputStream()) { | ||
out.write(message.getBytes(StandardCharsets.UTF_8)) | ||
} | ||
connection.getInputStream().close() | ||
connection.disconnect() | ||
} catch (IOException e) { | ||
e.printStackTrace() | ||
} | ||
} | ||
|
||
def ordered(String... dependencyPaths) { | ||
def dependencies = dependencyPaths.collect { tasks.getByPath(it) } | ||
for (int i = 0; i < dependencies.size() - 1; i++) { | ||
dependencies[i + 1].mustRunAfter(dependencies[i]) | ||
} | ||
return dependencies | ||
} | ||
|
||
tasks.register('publishForge') { | ||
dependsOn ordered(':forge:modrinth', 'forge:publishCurseForge') | ||
|
||
doLast { | ||
publishDiscord() | ||
} | ||
} | ||
|
||
tasks.register('publishNeoForge') { | ||
dependsOn ordered(':neoforge:modrinth', 'neoforge:publishCurseForge') | ||
|
||
doLast { | ||
publishDiscord() | ||
} | ||
} | ||
|
||
tasks.register('publishForgeNeoForge') { | ||
dependsOn ordered(':forge:modrinth', 'forge:publishCurseForge', ':neoforge:modrinth', 'neoforge:publishCurseForge') | ||
|
||
doLast { | ||
publishDiscord() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
plugins { | ||
id 'idea' | ||
id 'java' | ||
id 'maven-publish' | ||
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' | ||
} | ||
base { | ||
archivesName = "${mod_id}-common" | ||
} | ||
minecraft { | ||
version(minecraft_version) | ||
if(file("src/main/resources/${mod_id}.accesswidener").exists()){ | ||
accessWideners(file("src/main/resources/${mod_id}.accesswidener")) | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5' | ||
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' | ||
} | ||
|
||
task apiJar(type: Jar) { | ||
archiveClassifier.set('api') | ||
include 'top/theillusivec4/caelus/api/**/*' | ||
from sourceSets.main.allSource | ||
from sourceSets.main.output | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId base.archivesName.get() | ||
artifact jar | ||
artifact sourcesJar | ||
artifact apiJar | ||
} | ||
} | ||
repositories { | ||
|
||
if (project.hasProperty('urlMaven')) { | ||
|
||
if (project.hasProperty('userMaven') && project.hasProperty('passMaven')) { | ||
|
||
maven { | ||
url urlMaven | ||
credentials { | ||
username userMaven | ||
password passMaven | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.