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

a modular awakening begins? #2445

Open
wants to merge 1 commit into
base: api-10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ repositories {
}
}

java {
modularity.inferModulePath.set(false)
}

val ap by sourceSets.registering {
compileClasspath += sourceSets.main.get().compileClasspath + sourceSets.main.get().output
}

// Project dependencies
val adventureVersion: String by project
val configurateVersion: String by project
val geantyrefVersion: String by project
val gsonVersion: String by project
val guavaVersion: String by project
val log4jVersion: String by project
Expand Down Expand Up @@ -113,6 +118,9 @@ dependencies {
exclude(group = "com.google.inject", module = "guice")
}

// Generic type reflection + capture library (used by Configurate, we bump the version for a module name)
api("io.leangen.geantyref:geantyref:$geantyrefVersion")

// Compile-time static analysis
compileOnly("com.google.errorprone:error_prone_annotations:$errorproneVersion")
errorprone("com.google.errorprone:error_prone_core:$errorproneVersion")
Expand Down Expand Up @@ -170,6 +178,10 @@ tasks {
compilerArgs.addAll(listOf("-Xlint:-path"))
isDeprecation = false
}

doFirst {
options.compilerArgs.addAll(listOf("--module-path", classpath.asPath))
}
}

javadoc {
Expand All @@ -189,6 +201,10 @@ tasks {
addBooleanOption("quiet", true)
}
}

doFirst {
options.modulePath(classpath.toList())
}
}

withType(JavaCompile::class).configureEach {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ caffeineVersion=3.1.1
checkstyleVersion=10.3.4
configurateVersion=4.1.2
errorproneVersion=2.16
geantyrefVersion=1.3.13
gsonVersion=2.8.9
guavaVersion=31.0.1-jre
junitVersion=5.9.1
log4jVersion=2.17.0

mathVersion=2.0.1
mockitoVersion=4.8.0
pluginSpiVersion=0.3.0
pluginSpiVersion=0.3.1-SNAPSHOT
39 changes: 39 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
open module org.spongepowered.api {
requires transitive java.desktop;
requires transitive java.sql;

requires transitive org.apache.logging.log4j;
requires transitive com.google.common; // guava
requires transitive com.google.gson;

requires transitive net.kyori.adventure;
requires transitive net.kyori.adventure.text.serializer.gson;
requires transitive net.kyori.adventure.text.serializer.legacy;
requires transitive net.kyori.adventure.text.serializer.plain;
requires transitive net.kyori.adventure.text.minimessage;

requires transitive com.google.guice;
requires transitive com.github.benmanes.caffeine;
requires transitive com.github.benmanes.caffeine.guava;

requires transitive org.spongepowered.plugin.spi;
requires transitive org.spongepowered.plugin.metadata;

requires transitive org.spongepowered.configurate;
requires transitive org.spongepowered.configurate.hocon;
requires transitive org.spongepowered.configurate.gson;
requires transitive org.spongepowered.configurate.yaml;
requires transitive org.spongepowered.configurate.extra.guice;

requires static transitive com.google.errorprone.annotations;
requires static transitive org.checkerframework.checker.qual;
requires static transitive org.jetbrains.annotations; // via adventure (unneeded once Adventure gets real module descriptors)

requires transitive org.spongepowered.math;
requires transitive io.leangen.geantyref;

// AP
requires transitive java.compiler;

// provides javax.annotation.processing.Processor with org.spongepowered.plugin.processor.ListenerProcessor; // TODO
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public final class DataPackTypes {

public static final DataPackType<TagTemplate<ItemType>> ITEM_TAG = Sponge.game().factoryProvider().provide(DataPackType.Factory.class).tag(RegistryTypes.ITEM_TYPE);

public static final DataPackType<TagTemplate<EntityType<?>>> ENTITY_TAG = Sponge.game().factoryProvider().provide(DataPackType.Factory.class).tag((RegistryType<EntityType<?>>) RegistryTypes.ENTITY_TYPE);
public static final DataPackType<TagTemplate<EntityType<?>>> ENTITY_TAG = Sponge.game().factoryProvider().provide(DataPackType.Factory.class).tag((RegistryType<EntityType<?>>) (RegistryType) RegistryTypes.ENTITY_TYPE);

public static final DataPackType<TagTemplate<Biome>> BIOME_TAG = Sponge.game().factoryProvider().provide(DataPackType.Factory.class).tag(RegistryTypes.BIOME);

Expand Down
26 changes: 0 additions & 26 deletions src/test/java/org/spongepowered/api/data/package-info.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/test/java/org/spongepowered/api/event/package-info.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/test/java/org/spongepowered/api/util/package-info.java

This file was deleted.

This file was deleted.