Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Bump version to 0.3 (#8)
Browse files Browse the repository at this point in the history
* Setup changes, update stuffs

Signed-off-by: liach <liach@users.noreply.github.com>

* Organize dependencies (now main stuff doesn't depend on mixin/asm any more)

Support slim tinytree without param/doc, change tinymetadata index behaviors

Signed-off-by: liach <liach@users.noreply.github.com>

* Use modern code in build.gradle

remove bad docs

Signed-off-by: liach <liach@users.noreply.github.com>

* Add a utility method

Signed-off-by: liach <liach@users.noreply.github.com>

* Go back to old license

Signed-off-by: liach <liach@users.noreply.github.com>

Co-authored-by: liach <liach@users.noreply.github.com>
  • Loading branch information
liach and liach committed Jun 1, 2020
1 parent 9856a44 commit 5f33a25
Show file tree
Hide file tree
Showing 35 changed files with 447 additions and 135 deletions.
155 changes: 111 additions & 44 deletions build.gradle
@@ -1,28 +1,32 @@
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven-publish'

buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter()
}
plugins {
id 'java'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecrell.licenser' version '0.4.1'
}

sourceCompatibility = 1.8
version = '0.2.2'
targetCompatibility = 1.8
version = '0.3.0'

def ENV = System.getenv()
if (ENV.BUILD_NUMBER) {
version = version + "." + "${System.getenv().BUILD_NUMBER}"
}
def buildNumber = System.getenv("BUILD_NUMBER")
version = version + "+" + (buildNumber ? "build.$buildNumber" : "local")

group = 'net.fabricmc'
archivesBaseName = 'tiny-mappings-parser'

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

sourceSets {
asm
mixin
legacy // old deprecated stuff, to be removed in 0.4
}

repositories {
mavenCentral()
maven {
Expand All @@ -32,47 +36,110 @@ repositories {
}

dependencies {
testImplementation(
'org.junit.jupiter:junit-jupiter-api:5.1.0'
)
testRuntimeOnly(
'org.junit.jupiter:junit-jupiter-engine:5.1.0'
)

compileOnly 'org.checkerframework:checker-qual:2.11.0'
implementation 'org.ow2.asm:asm:8.0'
implementation 'org.ow2.asm:asm-analysis:8.0'
implementation 'org.ow2.asm:asm-commons:8.0'
implementation 'org.ow2.asm:asm-tree:8.0'
implementation 'org.ow2.asm:asm-util:8.0'
implementation 'net.fabricmc:sponge-mixin:0.7.11.17'
compileOnly 'org.checkerframework:checker-qual:3.3.0'
// source-set specific stuff aren't exposed later
asmImplementation 'org.ow2.asm:asm:8.0'
asmImplementation 'org.ow2.asm:asm-analysis:8.0'
asmImplementation 'org.ow2.asm:asm-commons:8.0'
asmImplementation 'org.ow2.asm:asm-tree:8.0'
asmImplementation 'org.ow2.asm:asm-util:8.0'
mixinImplementation('net.fabricmc:sponge-mixin:0.7.11.17') {
transitive = false
}

testImplementation 'com.google.guava:guava:29.0-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
}

sourceSets {
asm.compileClasspath += main.compileClasspath
asm.compileClasspath += main.output
mixin.compileClasspath += main.compileClasspath
mixin.compileClasspath += main.output
legacy.compileClasspath += main.compileClasspath
legacy.compileClasspath += asm.compileClasspath
legacy.compileClasspath += mixin.compileClasspath
test.compileClasspath += asm.output
test.compileClasspath += mixin.output
test.compileClasspath += legacy.output
test.runtimeClasspath += asm.output
test.runtimeClasspath += mixin.output
test.runtimeClasspath += legacy.output
}

javadoc {
options {
if (file("README.html").exists()) {
overview = "README.html"
}
source = "8"
encoding = 'UTF-8'
charSet = 'UTF-8'
memberLevel = JavadocMemberLevel.PROTECTED
links(
'https://checkerframework.org/api/',
'https://docs.oracle.com/javase/8/docs/api/',
'https://asm.ow2.io/javadoc/'
)
// Disable the crazy super-strict doclint tool in Java 8
addStringOption('Xdoclint:none', '-quiet')
}
source sourceSets.main.allJava.srcDirs, sourceSets.asm.allJava.srcDirs, sourceSets.mixin.allJava.srcDirs
classpath += sourceSets.main.compileClasspath
classpath += sourceSets.asm.compileClasspath
classpath += sourceSets.mixin.compileClasspath
}

jar {
from sourceSets.main.output
from sourceSets.asm.output
from sourceSets.mixin.output
from sourceSets.legacy.output
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier.set 'sources'
from sourceSets.main.allSource
from sourceSets.asm.allSource
from sourceSets.mixin.allSource
from sourceSets.legacy.allSource
}

task javadocsJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set 'javadocs'
from javadoc.destinationDir
}

artifacts {
archives jar
archives sourcesJar
archives javadocsJar
}

test {
useJUnitPlatform()
useJUnitPlatform()
}

publishing {
publications {
maven(MavenPublication) {
groupId 'net.fabricmc'
artifactId "tiny-mappings-parser"
version version
from components.java

artifact (jar)
artifact (sourcesJar)
artifact sourcesJar
artifact javadocsJar
}
}
}

apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/maven.gradle'
apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/license.gradle'

uploadArchives.repositories.mavenDeployer.pom.withXml {
asNode().dependencies.'*'.each() { it.parent().remove(it) }
repositories {
if (project.hasProperty('mavenPass')) {
maven {
url = "http://mavenupload.modmuss50.me/"
credentials {
username = "buildslave"
password = project.getProperty('mavenPass')
}
}
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
#Sun Aug 21 10:32:36 EDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
68 changes: 41 additions & 27 deletions gradlew
@@ -1,4 +1,20 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
Expand Down Expand Up @@ -28,16 +44,16 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down Expand Up @@ -138,32 +154,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=`save "$@"`

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
cd "$(dirname "$0")"
fi
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
21 changes: 20 additions & 1 deletion gradlew.bat
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -13,8 +29,11 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
Expand Up @@ -20,7 +20,6 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.objectweb.asm.commons.Remapper;

import net.fabricmc.mappings.*;
import java.lang.ref.SoftReference;
import java.util.Collection;
import java.util.HashMap;
Expand Down
Expand Up @@ -16,6 +16,7 @@

package net.fabricmc.mappings;

@Deprecated
public interface ClassEntry {
String get(String namespace);
}
Expand Up @@ -19,6 +19,7 @@
import java.util.Collection;
import java.util.Collections;

@Deprecated
final class DummyMappings implements Mappings {
static final DummyMappings INSTANCE = new DummyMappings();

Expand Down
Expand Up @@ -16,6 +16,7 @@

package net.fabricmc.mappings;

@Deprecated
public class EntryTriple {
private final String owner;
private final String name;
Expand Down
Expand Up @@ -16,6 +16,7 @@

package net.fabricmc.mappings;

@Deprecated
public interface FieldEntry {
EntryTriple get(String namespace);
}
Expand Up @@ -17,9 +17,8 @@
package net.fabricmc.mappings;

import java.util.*;
import java.util.function.Function;
import java.util.function.Supplier;

@Deprecated
interface MappedStringDeduplicator {
enum Category {
NAME,
Expand Down
Expand Up @@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Collection;

@Deprecated
public interface Mappings {
Collection<String> getNamespaces();

Expand Down

0 comments on commit 5f33a25

Please sign in to comment.