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

Update dependencies #48

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 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
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# FabricMC editorconfig v1.0

root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{gradle,java}]
ij_continuation_indent_size = 8
ij_java_imports_layout = $*,|,java.**,|,javax.**,|,*,|,net.fabricmc.**
ij_java_class_count_to_use_import_on_demand = 999

[*.{yml,yaml,json,toml,mcmeta}]
indent_size = 2

[*.{yml,yaml,properties}]
indent_style = space

[*.bat]
end_of_line = crlf
31 changes: 28 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
local/
# FabricMC gitignore v1.0

# Gradle
.gradle/
out/
build/
out/
classes/

# IntelliJ Idea
.idea/
*.iml
*.ipr
*.iws

# eclipse
# Eclipse
.eclipse/
*.launch

# VS Code
.vscode/
.settings/
bin/
.classpath
.project

# Fleet
.fleet/

# MacOS
*.DS_Store

# Java
hs_err_*.log
replay_*.log
*.hprof
*.jfr
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# Stitch
Stitch is a set of tools for working with and updating mappings in the `.tiny` format.

Over the last few years, large parts of its functionality have been made redundant by other tools though, and nowadays, it's mostly only used for [intermediary generation and updating](https://fabricmc.net/wiki/tutorial:updating_yarn).

Preferable alternatives:
- [Mapping IO](https://github.com/FabricMC/mapping-io) for reading/writing/converting mappings
- [Name Proposal](https://github.com/FabricMC/name-proposal) for proposing names in Enigma
60 changes: 31 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
plugins {
id "java"
id "java-library"
id "maven-publish"
id "net.minecrell.licenser" version "0.4.1"
id 'java-library'
id 'maven-publish'
id 'org.cadixdev.licenser'
NebelNidas marked this conversation as resolved.
Show resolved Hide resolved
id 'checkstyle'
}

sourceCompatibility = 1.8
checkstyle {
configFile = file('checkstyle.xml')
}

def ENV = System.getenv()
version = "0.6.2" + (ENV.GITHUB_ACTIONS ? "" : "+local")
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
NebelNidas marked this conversation as resolved.
Show resolved Hide resolved

group = 'net.fabricmc'
archivesBaseName = project.name.toLowerCase()
def ENV = System.getenv()
version += (ENV.GITHUB_ACTIONS ? '' : '+local')

repositories {
mavenCentral()
Expand All @@ -30,30 +32,30 @@ configurations {
}

dependencies {
ship 'org.ow2.asm:asm:9.1'
ship 'org.ow2.asm:asm-commons:9.1'
ship 'org.ow2.asm:asm-tree:9.1'
ship 'org.ow2.asm:asm-util:9.1'
ship 'net.fabricmc:tiny-mappings-parser:0.3.0+build.17'
implementation 'com.google.guava:guava:28.0-jre'
compileOnly 'org.jetbrains:annotations:20.1.0'

enigma 'cuchaz:enigma:0.23.2'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.1'
ship "org.ow2.asm:asm:${asm_version}"
ship "org.ow2.asm:asm-commons:${asm_version}"
ship "org.ow2.asm:asm-tree:${asm_version}"
ship "org.ow2.asm:asm-util:${asm_version}"
ship "net.fabricmc:tiny-mappings-parser:${tiny_mappings_parser_version}"
implementation "com.google.guava:guava:${guava_version}-jre"
compileOnly "org.jetbrains:annotations:${jetbrains_annotations_version}"

enigma "cuchaz:enigma:${enigma_version}"

testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}"
}

license {
header project.file("HEADER")
include "**/*.java"
header project.file('HEADER')
include '**/*.java'
}

jar {
manifest {
attributes 'Implementation-Title': 'Stitch',
'Implementation-Version': archiveVersion,
'Main-Class': "net.fabricmc.stitch.Main"
'Main-Class': 'net.fabricmc.stitch.Main'
}
}

Expand All @@ -66,7 +68,7 @@ task allJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Stitch',
'Implementation-Version': archiveVersion,
'Main-Class': "net.fabricmc.stitch.Main"
'Main-Class': 'net.fabricmc.stitch.Main'
}
archiveClassifier = 'all'
with jar
Expand All @@ -77,7 +79,7 @@ java {
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.encoding = 'UTF-8'

if (JavaVersion.current().isJava9Compatible()) {
it.options.release = 8
Expand All @@ -96,7 +98,7 @@ publishing {
repositories {
if (ENV.MAVEN_URL) {
repositories.maven {
name "fabric"
name 'fabric'
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
Expand All @@ -114,7 +116,7 @@ test {
// A task to ensure that the version being released has not already been released.
task checkVersion {
doFirst {
def xml = new URL("https://maven.fabricmc.net/net/fabricmc/stitch/maven-metadata.xml").text
def xml = new URL('https://maven.fabricmc.net/net/fabricmc/stitch/maven-metadata.xml').text
def metadata = new XmlSlurper().parseText(xml)
def versions = metadata.versioning.versions.version*.text();
if (versions.contains(version)) {
Expand All @@ -123,4 +125,4 @@ task checkVersion {
}
}

publish.mustRunAfter checkVersion
publish.mustRunAfter checkVersion
178 changes: 178 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">

<!-- FabricMC checkstyle v1.0 -->

<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java"/>
<property name="localeLanguage" value="en"/>
<property name="localeCountry" value="US"/>

<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>

<module name="NewlineAtEndOfFile"/>

<!-- disallow trailing whitespace -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="trailing whitespace"/>
</module>

<!-- note: RegexpMultiline shows nicer messages than Regexp, but has to be outside TreeWalker -->
<!-- disallow multiple consecutive blank lines -->
<module name="RegexpMultiline">
<property name="format" value="\n[\t ]*\r?\n[\t ]*\r?\n"/>
<property name="message" value="adjacent blank lines"/>
</module>

<!-- disallow blank after { -->
<module name="RegexpMultiline">
<property name="format" value="\{[\t ]*\r?\n[\t ]*\r?\n"/>
<property name="message" value="blank line after '{'"/>
</module>

<!-- disallow blank before } -->
<module name="RegexpMultiline">
<property name="format" value="\n[\t ]*\r?\n[\t ]*\}"/>
<property name="message" value="blank line before '}'"/>
</module>

<!-- require blank before { in the same indentation level -->
<module name="RegexpMultiline">
<!-- the regex works as follows:
It matches (=fails) for \n<indentation><something>\n<same indentation><control statement>[...]{\n
while <something> is a single line comment, it'll look for a blank line one line earlier
if <something> is a space, indicating a formatting error or ' */', it'll ignore the instance
if <something> is a tab, indicating a continued line, it'll ignore the instance
<control statement> is 'if', 'do', 'while', 'for', 'try' or nothing (instance initializer block)
- first \n: with positive lookbehind (?<=\n) to move the error marker to a more reasonable place
- capture tabs for <indentation>, later referenced via \1
- remaining preceding line as a non-comment (doesn't start with '/', '//', ' ' or '\t') or multiple lines where all but the first are a single line comment with the same indentation
- new line
- <indentation> as captured earlier
- <control statement> as specified above
- { before the next new line -->
<property name="format" value="(?&lt;=\n)([\t]+)(?:[^/\r\n \t][^\r\n]*|/[^/\r\n][^\r\n]*|[^/\r\n][^\r\n]*(\r?\n\1//[^\r\n]*)+)\r?\n\1(|(if|do|while|for|try)[^\r\n]+)\{[\t ]*\r?\n"/>
<property name="message" value="missing blank line before block at same indentation level"/>
</module>

<!-- require blank after } in the same indentation level -->
<module name="RegexpMultiline">
<!-- \n<indentation>}\n<same indentation><whatever unless newline, '}' or starting with cas(e) or def(ault)> -->
<property name="format" value="(?&lt;=\n)([\t]+)\}\r?\n\1(?:[^\r\n\}cd]|c[^\r\na]|ca[^\r\ns]|d[^\r\ne]|de[^\r\nf])"/>
<property name="message" value="missing blank line after block at same indentation level"/>
</module>

<module name="TreeWalker">
<!-- Ensure all imports are ship shape -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>

<module name="ImportOrder">
<property name="groups" value="java,javax,*,net.fabricmc"/>
<property name="ordered" value="false"/><!-- the plugin orders alphabetically without considering separators.. -->
<property name="separated" value="true"/>
<property name="option" value="top"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>

<!-- Ensures braces are at the end of a line -->
<module name="LeftCurly"/>
<module name="RightCurly"/>

<!-- single line statements on one line, -->
<module name="NeedBraces">
<property name="tokens" value="LITERAL_IF,LITERAL_FOR,LITERAL_WHILE"/>
<property name="allowSingleLineStatement" value="true"/>
</module>
<module name="NeedBraces">
<property name="tokens" value="LITERAL_ELSE,LITERAL_DO"/>
<property name="allowSingleLineStatement" value="false"/>
</module>

<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowMultipleEmptyLines" value="false"/>
<!-- exclude METHOD_DEF and VARIABLE_DEF -->
<property name="tokens" value="PACKAGE_DEF,IMPORT,STATIC_IMPORT,CLASS_DEF,INTERFACE_DEF,ENUM_DEF,STATIC_INIT,INSTANCE_INIT,CTOR_DEF"/>
</module>

<module name="OperatorWrap"/>
<module name="SeparatorWrap">
<property name="tokens" value="DOT,ELLIPSIS,AT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="COMMA,SEMI"/>
<property name="option" value="eol"/>
</module>

<module name="Indentation">
<property name="basicOffset" value="8"/>
<property name="caseIndent" value="0"/>
<property name="throwsIndent" value="8"/>
<property name="arrayInitIndent" value="8"/>
<property name="lineWrappingIndentation" value="16"/>
</module>

<module name="ParenPad"/>
<module name="NoWhitespaceBefore"/>
<module name="NoWhitespaceAfter">
<!-- allow ARRAY_INIT -->
<property name="tokens" value="AT,INC,DEC,UNARY_MINUS,UNARY_PLUS,BNOT,LNOT,DOT,ARRAY_DECLARATOR,INDEX_OP"/>
</module>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<!-- Allow PLUS, MINUS, MUL, DIV as they may be more readable without spaces in some cases -->
<property name="tokens"
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/>
</module>
<module name="SingleSpaceSeparator"/>
<module name="GenericWhitespace"/>
<module name="CommentsIndentation"/>

<module name="ArrayTypeStyle"/>
<module name="DefaultComesLast">
<property name="skipIfLastAndSharedWithCase" value="true"/>
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>

<module name="ModifierOrder"/>
<module name="RedundantModifier"/>

<module name="AnnotationLocation"/>
<module name="MissingOverride"/>

<!-- By default this allows catch blocks with only comments -->
<module name="EmptyCatchBlock"/>

<!-- Enforce tabs -->
<module name="RegexpSinglelineJava">
<property name="format" value="^\t* ([^*]|\*[^ /])"/>
<property name="message" value="non-tab indentation"/>
</module>

<module name="OuterTypeFilename"/>

<!--<module name="InvalidJavadocPosition"/>-->
<module name="JavadocParagraph"/>
<module name="JavadocStyle"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param,@return,@throws,@deprecated"/>
</module>

<!-- Prevent var for all cases other than new instance creation -->
<module name="MatchXpath">
<property name="query" value="//VARIABLE_DEF[./TYPE/IDENT[@text='var'] and not(./ASSIGN/EXPR/LITERAL_NEW)]"/>
</module>
</module>
</module>
23 changes: 21 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
name = stitch
# Gradle Properties
org.gradle.jvmargs = -Xmx2G
org.gradle.parallel = true
org.gradle.workers.max = 3

# Gradle Plugins
cadixdev_licenser_version = 0.6.1

# Project Properties
version = 0.6.2
group = net.fabricmc
archivesBaseName = stitch
description = Fabric auxillary Tiny tools
url = https://github.com/FabricMC/stitch
url = https://github.com/FabricMC/stitch

# Project Dependencies
asm_version = 9.5
tiny_mappings_parser_version = 0.3.0+build.17
guava_version = 31.1
jetbrains_annotations_version = 24.0.1
enigma_version = 1.0.0
junit_jupiter_version = 5.9.3
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading