From 3554feeccb4207d43690a6dcd14faf9c5517ce30 Mon Sep 17 00:00:00 2001 From: Zontreck Date: Wed, 12 Oct 2022 22:09:21 -0700 Subject: [PATCH] Rename project and export a dev jar --- .gitattributes | 5 +++++ .gitignore | 41 +++++++++++++++++++++++------------------ build.gradle | 24 ++++++++++++++++++++++-- settings.gradle | 4 +++- 4 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f811f6a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Disable autocrlf on generated files, they always generate with LF +# Add any extra files or paths here to make git stop saying they +# are changed when only line endings change. +src/generated/**/.cache/cache text eol=lf +src/generated/**/*.json text eol=lf diff --git a/.gitignore b/.gitignore index a1c2a23..450e8a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,28 @@ -# Compiled class file -*.class +# eclipse +bin +*.launch +.settings +.metadata +.classpath +.project -# Log file -*.log +# idea +out +*.ipr +*.iws +*.iml +.idea -# BlueJ files -*.ctxt +# gradle +build +.gradle -# Mobile Tools for Java (J2ME) -.mtj.tmp/ +# other +eclipse +run -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar +# Files from Forge MDK +forge*changelog.txt -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* +.vscode +mcmodsrepo \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5371199..fdf7d58 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } version = "${myversion}" -group = 'dev.zontreck.libzontreck' // http://maven.apache.org/guides/mini/guide-naming-conventions.html +group = 'dev.zontreck' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'libzontreck' // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. @@ -148,7 +148,7 @@ dependencies { jar { manifest { attributes([ - "Specification-Title" : "libzontreck", + "Specification-Title" : project.name, "Specification-Vendor" : "zontreck", "Specification-Version" : "1", // We are version 1 of ourselves "Implementation-Title" : project.name, @@ -165,10 +165,30 @@ jar.finalizedBy('reobfJar') // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing // publish.dependsOn('reobfJar') +task devJar(type: Jar) { + from sourceSets.main.allJava + classifier = 'dev' + manifest { + attributes([ + "Specification-Title": project.name, + "Specification-Vendor": "zontreck", + "Specification-Version": "1", + "Implementation-Title": project.name, + "Implementation-Version": project.jar.archiveVersion, + "Implementation-Vendor": "zontreck", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) + } +} + +devJar.finalizedBy('reobfJar') + + publishing { publications { mavenJava(MavenPublication) { artifact jar + artifact devJar } } repositories { diff --git a/settings.gradle b/settings.gradle index fb61b26..a55e774 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,4 +3,6 @@ pluginManagement { gradlePluginPortal() maven { url = 'https://maven.minecraftforge.net/' } } -} \ No newline at end of file +} + +rootProject.name = "libzontreck" \ No newline at end of file