Rename common module to util again

As I'm splitting it up into smaller modules (e.g. compress and crypto) I
think util is a more appropriate name for the remainder.

Signed-off-by: Graham <gpe@openrs2.dev>
Graham 5 years ago
parent 177326221f
commit 465078256f
  1. 2
      asm/build.gradle.kts
  2. 4
      asm/src/main/java/dev/openrs2/asm/classpath/ClassPath.kt
  3. 4
      asm/src/main/java/dev/openrs2/asm/classpath/Library.kt
  4. 2
      compress/build.gradle.kts
  5. 2
      compress/src/main/java/dev/openrs2/compress/bzip2/Bzip2.kt
  6. 2
      compress/src/main/java/dev/openrs2/compress/gzip/Gzip.kt
  7. 2
      decompiler/build.gradle.kts
  8. 2
      deob-ast/build.gradle.kts
  9. 2
      deob/src/main/java/dev/openrs2/deob/ArgRef.kt
  10. 2
      deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.kt
  11. 4
      deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt
  12. 2
      deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt
  13. 2
      deob/src/main/java/dev/openrs2/deob/transform/StaticScramblingTransformer.kt
  14. 2
      deob/src/main/java/dev/openrs2/deob/transform/UnusedArgTransformer.kt
  15. 4
      deob/src/main/java/dev/openrs2/deob/transform/UnusedMethodTransformer.kt
  16. 2
      deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt
  17. 4
      settings.gradle.kts
  18. 4
      util/build.gradle.kts
  19. 2
      util/src/main/java/dev/openrs2/util/StringUtils.kt
  20. 2
      util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt
  21. 2
      util/src/main/java/dev/openrs2/util/collect/ForestDisjointSet.kt
  22. 2
      util/src/main/java/dev/openrs2/util/collect/IterableUtils.kt
  23. 2
      util/src/main/java/dev/openrs2/util/io/DeterministicJarOutputStream.kt
  24. 2
      util/src/main/java/dev/openrs2/util/io/SkipOutputStream.kt
  25. 2
      util/src/test/java/dev/openrs2/util/StringUtilsTest.kt

@ -4,7 +4,7 @@ plugins {
} }
dependencies { dependencies {
api(project(":common")) api(project(":util"))
api("org.ow2.asm:asm:${Versions.asm}") api("org.ow2.asm:asm:${Versions.asm}")
api("org.ow2.asm:asm-commons:${Versions.asm}") api("org.ow2.asm:asm-commons:${Versions.asm}")
api("org.ow2.asm:asm-tree:${Versions.asm}") api("org.ow2.asm:asm-tree:${Versions.asm}")

@ -3,8 +3,8 @@ package dev.openrs2.asm.classpath
import dev.openrs2.asm.MemberDesc import dev.openrs2.asm.MemberDesc
import dev.openrs2.asm.MemberRef import dev.openrs2.asm.MemberRef
import dev.openrs2.asm.toBinaryClassName import dev.openrs2.asm.toBinaryClassName
import dev.openrs2.common.collect.DisjointSet import dev.openrs2.util.collect.DisjointSet
import dev.openrs2.common.collect.ForestDisjointSet import dev.openrs2.util.collect.ForestDisjointSet
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
import org.objectweb.asm.commons.Remapper import org.objectweb.asm.commons.Remapper
import org.objectweb.asm.tree.AbstractInsnNode import org.objectweb.asm.tree.AbstractInsnNode

@ -3,9 +3,9 @@ package dev.openrs2.asm.classpath
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import dev.openrs2.asm.NopClassVisitor import dev.openrs2.asm.NopClassVisitor
import dev.openrs2.asm.remap import dev.openrs2.asm.remap
import dev.openrs2.crypto.Pkcs12KeyStore
import dev.openrs2.common.io.DeterministicJarOutputStream
import dev.openrs2.compress.gzip.Gzip import dev.openrs2.compress.gzip.Gzip
import dev.openrs2.crypto.Pkcs12KeyStore
import dev.openrs2.util.io.DeterministicJarOutputStream
import org.objectweb.asm.ClassReader import org.objectweb.asm.ClassReader
import org.objectweb.asm.commons.Remapper import org.objectweb.asm.commons.Remapper
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode

@ -4,7 +4,7 @@ plugins {
} }
dependencies { dependencies {
implementation(project(":common")) implementation(project(":util"))
implementation("org.apache.commons:commons-compress:${Versions.commonsCompress}") implementation("org.apache.commons:commons-compress:${Versions.commonsCompress}")
} }

@ -1,6 +1,6 @@
package dev.openrs2.compress.bzip2 package dev.openrs2.compress.bzip2
import dev.openrs2.common.io.SkipOutputStream import dev.openrs2.util.io.SkipOutputStream
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream
import java.io.ByteArrayInputStream import java.io.ByteArrayInputStream

@ -1,6 +1,6 @@
package dev.openrs2.compress.gzip package dev.openrs2.compress.gzip
import dev.openrs2.common.io.SkipOutputStream import dev.openrs2.util.io.SkipOutputStream
import java.io.ByteArrayInputStream import java.io.ByteArrayInputStream
import java.io.InputStream import java.io.InputStream
import java.io.OutputStream import java.io.OutputStream

@ -12,7 +12,7 @@ application {
dependencies { dependencies {
api("com.github.ajalt:clikt:${Versions.clikt}") api("com.github.ajalt:clikt:${Versions.clikt}")
implementation(project(":common")) implementation(project(":util"))
implementation("dev.openrs2:fernflower:${Versions.fernflower}") implementation("dev.openrs2:fernflower:${Versions.fernflower}")
} }

@ -11,7 +11,7 @@ application {
dependencies { dependencies {
api("com.github.ajalt:clikt:${Versions.clikt}") api("com.github.ajalt:clikt:${Versions.clikt}")
implementation(project(":common")) implementation(project(":util"))
implementation("com.github.javaparser:javaparser-symbol-solver-core:${Versions.javaParser}") implementation("com.github.javaparser:javaparser-symbol-solver-core:${Versions.javaParser}")
implementation("org.jdom:jdom2:${Versions.jdom}") implementation("org.jdom:jdom2:${Versions.jdom}")
} }

@ -1,6 +1,6 @@
package dev.openrs2.deob package dev.openrs2.deob
import dev.openrs2.asm.MemberRef import dev.openrs2.asm.MemberRef
import dev.openrs2.common.collect.DisjointSet import dev.openrs2.util.collect.DisjointSet
data class ArgRef(val method: DisjointSet.Partition<MemberRef>, val arg: Int) data class ArgRef(val method: DisjointSet.Partition<MemberRef>, val arg: Int)

@ -1,6 +1,6 @@
package dev.openrs2.deob.analysis package dev.openrs2.deob.analysis
import dev.openrs2.asm.MemberRef import dev.openrs2.asm.MemberRef
import dev.openrs2.common.collect.DisjointSet import dev.openrs2.util.collect.DisjointSet
data class SourcedIntValue(val source: DisjointSet.Partition<MemberRef>, val intValue: IntValue) data class SourcedIntValue(val source: DisjointSet.Partition<MemberRef>, val intValue: IntValue)

@ -5,8 +5,8 @@ import dev.openrs2.asm.MemberDesc
import dev.openrs2.asm.MemberRef import dev.openrs2.asm.MemberRef
import dev.openrs2.asm.classpath.ClassMetadata import dev.openrs2.asm.classpath.ClassMetadata
import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.classpath.ClassPath
import dev.openrs2.common.collect.DisjointSet import dev.openrs2.util.collect.DisjointSet
import dev.openrs2.common.indefiniteArticle import dev.openrs2.util.indefiniteArticle
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type import org.objectweb.asm.Type
import org.objectweb.asm.commons.Remapper import org.objectweb.asm.commons.Remapper

@ -15,11 +15,11 @@ import dev.openrs2.asm.pure
import dev.openrs2.asm.replaceExpression import dev.openrs2.asm.replaceExpression
import dev.openrs2.asm.stackMetadata import dev.openrs2.asm.stackMetadata
import dev.openrs2.asm.transform.Transformer import dev.openrs2.asm.transform.Transformer
import dev.openrs2.common.collect.DisjointSet
import dev.openrs2.deob.ArgRef import dev.openrs2.deob.ArgRef
import dev.openrs2.deob.analysis.IntInterpreter import dev.openrs2.deob.analysis.IntInterpreter
import dev.openrs2.deob.analysis.IntValue import dev.openrs2.deob.analysis.IntValue
import dev.openrs2.deob.analysis.SourcedIntValue import dev.openrs2.deob.analysis.SourcedIntValue
import dev.openrs2.util.collect.DisjointSet
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type import org.objectweb.asm.Type
import org.objectweb.asm.tree.AbstractInsnNode import org.objectweb.asm.tree.AbstractInsnNode

@ -6,8 +6,8 @@ import dev.openrs2.asm.MemberRef
import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.classpath.ClassPath
import dev.openrs2.asm.classpath.Library import dev.openrs2.asm.classpath.Library
import dev.openrs2.asm.transform.Transformer import dev.openrs2.asm.transform.Transformer
import dev.openrs2.common.collect.DisjointSet
import dev.openrs2.deob.remap.TypedRemapper import dev.openrs2.deob.remap.TypedRemapper
import dev.openrs2.util.collect.DisjointSet
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode
import org.objectweb.asm.tree.FieldInsnNode import org.objectweb.asm.tree.FieldInsnNode

@ -7,11 +7,11 @@ import dev.openrs2.asm.classpath.Library
import dev.openrs2.asm.hasCode import dev.openrs2.asm.hasCode
import dev.openrs2.asm.removeArgument import dev.openrs2.asm.removeArgument
import dev.openrs2.asm.transform.Transformer import dev.openrs2.asm.transform.Transformer
import dev.openrs2.common.collect.DisjointSet
import dev.openrs2.deob.ArgRef import dev.openrs2.deob.ArgRef
import dev.openrs2.deob.analysis.ConstSourceInterpreter import dev.openrs2.deob.analysis.ConstSourceInterpreter
import dev.openrs2.deob.analysis.ConstSourceValue import dev.openrs2.deob.analysis.ConstSourceValue
import dev.openrs2.deob.remap.TypedRemapper import dev.openrs2.deob.remap.TypedRemapper
import dev.openrs2.util.collect.DisjointSet
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type import org.objectweb.asm.Type
import org.objectweb.asm.tree.AbstractInsnNode import org.objectweb.asm.tree.AbstractInsnNode

@ -7,9 +7,9 @@ import dev.openrs2.asm.MemberRef
import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.classpath.ClassPath
import dev.openrs2.asm.classpath.Library import dev.openrs2.asm.classpath.Library
import dev.openrs2.asm.transform.Transformer import dev.openrs2.asm.transform.Transformer
import dev.openrs2.common.collect.DisjointSet
import dev.openrs2.common.collect.removeFirst
import dev.openrs2.deob.remap.TypedRemapper import dev.openrs2.deob.remap.TypedRemapper
import dev.openrs2.util.collect.DisjointSet
import dev.openrs2.util.collect.removeFirst
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode
import org.objectweb.asm.tree.MethodInsnNode import org.objectweb.asm.tree.MethodInsnNode

@ -9,7 +9,7 @@ import dev.openrs2.asm.MemberRef
import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.classpath.ClassPath
import dev.openrs2.asm.classpath.Library import dev.openrs2.asm.classpath.Library
import dev.openrs2.asm.transform.Transformer import dev.openrs2.asm.transform.Transformer
import dev.openrs2.common.collect.DisjointSet import dev.openrs2.util.collect.DisjointSet
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type import org.objectweb.asm.Type
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode

@ -7,7 +7,6 @@ include(
"asm", "asm",
"bundler", "bundler",
"cli", "cli",
"common",
"compress", "compress",
"compress-cli", "compress-cli",
"crc32", "crc32",
@ -16,7 +15,8 @@ include(
"deob", "deob",
"deob-annotations", "deob-annotations",
"deob-ast", "deob-ast",
"game" "game",
"util"
) )
if (Files.exists(rootProject.projectDir.toPath().resolve("nonfree/build.gradle.kts"))) { if (Files.exists(rootProject.projectDir.toPath().resolve("nonfree/build.gradle.kts"))) {

@ -9,10 +9,10 @@ publishing {
pom { pom {
packaging = "jar" packaging = "jar"
name.set("OpenRS2 Common") name.set("OpenRS2 Utilities")
description.set( description.set(
""" """
Common code used by all modules. Common utility code used by all modules.
""".trimIndent() """.trimIndent()
) )
} }

@ -1,4 +1,4 @@
package dev.openrs2.common package dev.openrs2.util
fun CharSequence.indefiniteArticle(): String { fun CharSequence.indefiniteArticle(): String {
require(isNotEmpty()) require(isNotEmpty())

@ -1,4 +1,4 @@
package dev.openrs2.common.collect package dev.openrs2.util.collect
interface DisjointSet<T> : Iterable<DisjointSet.Partition<T>> { interface DisjointSet<T> : Iterable<DisjointSet.Partition<T>> {
interface Partition<T> : Iterable<T> interface Partition<T> : Iterable<T>

@ -1,4 +1,4 @@
package dev.openrs2.common.collect package dev.openrs2.util.collect
import java.util.ArrayDeque import java.util.ArrayDeque

@ -1,4 +1,4 @@
package dev.openrs2.common.collect package dev.openrs2.util.collect
inline fun <T> MutableIterable<T>.removeFirst(predicate: (T) -> Boolean): Boolean { inline fun <T> MutableIterable<T>.removeFirst(predicate: (T) -> Boolean): Boolean {
val iterator = iterator() val iterator = iterator()

@ -1,4 +1,4 @@
package dev.openrs2.common.io package dev.openrs2.util.io
import java.io.OutputStream import java.io.OutputStream
import java.nio.file.Files import java.nio.file.Files

@ -1,4 +1,4 @@
package dev.openrs2.common.io package dev.openrs2.util.io
import java.io.OutputStream import java.io.OutputStream

@ -1,4 +1,4 @@
package dev.openrs2.common package dev.openrs2.util
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertEquals import kotlin.test.assertEquals
Loading…
Cancel
Save