diff --git a/.gitignore b/.gitignore index e0cc2c9f..7264bfa3 100644 --- a/.gitignore +++ b/.gitignore @@ -39,7 +39,6 @@ libs #config I assume you want to keep your minecraft config and world out #world this is taken care of with the run folder up at runtime you are actually removing the packages -*.txt *.json /server.properties *.dat diff --git a/build.gradle b/build.gradle index 0ee5217c..91bf49ed 100644 --- a/build.gradle +++ b/build.gradle @@ -14,12 +14,14 @@ buildscript { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' classpath 'org.ajoberstar:gradle-git:0.10.1' } +} +plugins { + id 'com.matthewprenger.cursegradle' version '1.0.2' } apply plugin: 'forge' apply plugin: 'maven-publish' -apply plugin: 'curseforge' import org.ajoberstar.grgit.Grgit @@ -159,7 +161,7 @@ publishing { println('Changelog:\n' + getChangelogText()) String getChangelogText() { - def changelogFile = new File('changelog') + def changelogFile = file('changelog.txt') String str = '' int lineCount = 0 boolean done = false @@ -168,8 +170,15 @@ String getChangelogText() { return } if (it.size() > 1) { - def temp = "$it" + (lineCount == 0 ? '

' : '
') - str += (it.startsWith('-') ? '' : '
') + "$temp" + def temp = it + if (lineCount == 0) { + temp = "

$temp

" + } else if (it.startsWith('-')) { + temp = "   $temp" + } else { + temp = "

$temp

" + } + str += "$temp
" lineCount++ return } else { @@ -179,19 +188,33 @@ String getChangelogText() { return str } -curse { - dependsOn 'reobf' - - onlyIf { - return !dev && project.hasProperty('curseforge_key') +tasks.curseforge.dependsOn 'reobf' +tasks.curseforge.onlyIf { + return !dev && project.hasProperty('curseforge_key') +} + +curseforge { + if (project.hasProperty('curseforge_key')) { + apiKey = project.curseforge_key } - if (project.hasProperty('curseforge_key')) apiKey = project.curseforge_key - projectId = project.projectId - changelog = System.getenv("CHANGELOG").equals("none") ? getChangelogText() : System.getenv("CHANGELOG") - releaseType = 'release' - displayName = "Chisel - ${mod_version}" - additionalArtifact deobfJar, sourcesJar, apiJar + project { + id = project.projectId + changelog = System.getenv('CHANGELOG') == null || System.getenv('CHANGELOG').equals('none') ? getChangelogText() : System.getenv('CHANGELOG') + changelogType = 'html' + releaseType = 'release' + relations { + embeddedLibrary 'ctmlib' + } + mainArtifact(jar) { + displayName = "Chisel - ${version}" + } + addArtifact deobfJar + addArtifact sourcesJar + addArtifact(apiJar) { + relations {} + } + } } -idea { module { inheritOutputDirs = true } } \ No newline at end of file +idea { module { inheritOutputDirs = true } } diff --git a/changelog b/changelog.txt similarity index 100% rename from changelog rename to changelog.txt