Skip to content
Merged
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
17 changes: 13 additions & 4 deletions buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import de.skuzzle.restrictimports.gradle.RestrictImports

plugins {
`java-library`
id("com.diffplug.spotless")
Expand Down Expand Up @@ -81,13 +83,20 @@ spotless {
}
}

restrictImports {
group {
tasks {
// Bypass inability to have two groups with same base packages inside the import restriction plugin
val restrictJavaxAnnotations = register<RestrictImports>("restrictJavaxAnnotations") {
group = "verification"
reason = "Use org.jspecify.annotations to add annotations, or org.jetbrains.annotations if needed"
bannedImports = listOf("javax.annotation.**")
}
group {
val restrictAsserts = register<RestrictImports>("restrictAsserts") {
group = "verification"
reason = "Use tc.oc.pgm.util.Assert to add assertions"
bannedImports = listOf("com.google.common.base.Preconditions.**", "java.util.Objects.requireNonNull")
}
}
// Enforce the import restrictions
check {
dependsOn(restrictJavaxAnnotations, restrictAsserts)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import dev.pgm.community.moderation.punishments.PunishmentType;
import dev.pgm.community.utils.CommandAudience;
import java.util.UUID;
import javax.annotation.Nullable;
import org.jspecify.annotations.Nullable;

/** PlayerPardonEvent - Called when a punishment is pardoned */
public class PlayerPardonEvent extends CommunityEvent {
Expand Down
Loading