Skip to content

Commit

Permalink
Move modules and drop faf-commons prefix (for better packaging)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Nov 22, 2024
1 parent 0ccd66e commit 51e2214
Show file tree
Hide file tree
Showing 204 changed files with 30 additions and 54 deletions.
4 changes: 1 addition & 3 deletions faf-commons-api/build.gradle.kts → api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
version = "1.0-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

dependencies {
implementation(project(":faf-commons-data"))
implementation(project(":data"))
annotationProcessor(libs.lombok)
compileOnly(libs.lombok)
compileOnly(libs.jetbrains.annotations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import com.github.jasminb.jsonapi.annotations.Id;
import com.github.jasminb.jsonapi.annotations.Relationship;
import com.github.jasminb.jsonapi.annotations.Type;
import java.time.OffsetDateTime;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.time.OffsetDateTime;
import java.util.List;

@Data
@ToString(onlyExplicitlyIncluded = true)
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import static com.faforever.commons.api.elide.ElideNavigator.qBuilder;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

Expand Down
2 changes: 0 additions & 2 deletions faf-commons-data/build.gradle.kts → data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version = "1.0-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;

import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
import static java.nio.file.StandardOpenOption.WRITE;
import static java.nio.file.StandardOpenOption.*;

@Slf4j
public final class Unzipper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import org.luaj.vm2.LuaValue;

import javax.imageio.ImageIO;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte;
import java.awt.image.Raster;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.faforever.commons.replay;

import com.faforever.commons.replay.body.Event;
import com.faforever.commons.replay.shared.LuaData;
import com.faforever.commons.replay.body.ReplayBodyParser;
import com.faforever.commons.replay.body.ReplayBodyToken;
import com.faforever.commons.replay.body.ReplayBodyTokenizer;
import com.faforever.commons.replay.shared.LuaData;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.io.BaseEncoding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
import com.faforever.commons.replay.body.ReplayBodyParser;
import com.faforever.commons.replay.body.ReplayBodyToken;
import com.faforever.commons.replay.body.ReplayBodyTokenizer;
import com.faforever.commons.replay.header.*;
import com.faforever.commons.replay.header.ReplayHeader;
import com.faforever.commons.replay.header.ReplayHeaderParser;
import com.faforever.commons.replay.header.Source;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.BaseEncoding;
import com.google.common.io.LittleEndianDataInputStream;
import org.apache.commons.compress.compressors.CompressorException;
Expand All @@ -15,8 +18,6 @@
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.faforever.commons.replay.body;

import com.faforever.commons.replay.shared.LuaData;
import com.faforever.commons.replay.shared.LoadUtils;
import com.faforever.commons.replay.shared.LuaData;
import com.google.common.io.LittleEndianDataInputStream;
import org.jetbrains.annotations.Contract;

import java.io.ByteArrayInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.HexFormat;
import java.util.List;

public class ReplayBodyParser {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.faforever.commons.replay.body;

import com.google.common.io.LittleEndianDataInputStream;

import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.List;

@Slf4j
public class ReplayBodyTokenizer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.faforever.commons.replay.header;

import java.util.Arrays;

/**
* Populated by the game options field of the table that is passed to `CLobby:LaunchGame`
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static com.faforever.commons.replay.shared.LoadUtils.parseLua;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@
*/

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Properties;
import java.util.Stack;
import java.util.*;

/**
* Generic implementation of version comparison.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

class ZipperAndUnzipperTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.*;

public class LuaAccessorTest {
private LuaAccessor instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

class ModReaderTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;

class LoadReplayLoaderTest {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions faf-commons-lobby/build.gradle.kts → lobby/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ plugins {
alias(libs.plugins.kotlin.plugin.spring)
}

version = "1.0.0-SNAPSHOT"

dependencies {
api(libs.reactor.core)
implementation(libs.reactor.netty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.faforever.commons.lobby
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.KotlinModule
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.parallel.Execution
import org.junit.jupiter.api.parallel.ExecutionMode
Expand All @@ -14,7 +13,7 @@ class ClientMessageTest {

companion object {
val objectMapper: ObjectMapper = ObjectMapper()
.registerModule(KotlinModule())
.registerModule(KotlinModule.Builder().build())
.registerModule(JavaTimeModule())
}

Expand Down
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include(":faf-commons-api")
include(":faf-commons-data")
include(":faf-commons-lobby")
include(":api")
include(":data")
include(":lobby")

0 comments on commit 51e2214

Please sign in to comment.