Skip to content

Commit

Permalink
refactor: rename packages
Browse files Browse the repository at this point in the history
  • Loading branch information
darksaid98 committed Feb 22, 2024
1 parent b27e079 commit 885b75a
Show file tree
Hide file tree
Showing 21 changed files with 68 additions and 63 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,22 @@ configuration and repository maintenance.
class [ExamplePlugin.java](./src/main/java/com/github/ExampleUser/ExamplePlugin/ExamplePlugin.java) to the same
value.
```kotlin
rootProject.name = "MyName"
rootProject.name = "MyNamePlugin"
```
5. #### Change [build.gradle.kts](./build.gradle.kts)
1. ##### Change Plugin Info
> The final package path for your plugin will end up being something like `io.github.darksaid98.exampleplugin`. It's made up of these components `io.github.<USERNAME>.<PLUGINNAME>` where `<USERNAME>` is your github name in lowercase, and `<PLUGINNAME>` is added by `rootProject.name` lowercased.
Don't forget to change package locations in `src/main/java/` when changing the group.
```kotlin
group = "io.github.darksaid98"
version = "0.9.8"
description = "Some plugin description here..."
```
2. ##### Change Plugin.yml
> [!NOTE]
> The plugin.yml is automatically generated by gradle.

Update the authors list and any other required settings.
```kotlin
authors = listOf("GITHUB_USERNAME") // Replace with your username
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ plugins {
idea
}

group = "io.github.ExampleUser"
group = "io.github.exampleuser"
version = "1.0.5"
description = ""
val mainPackage = "${project.group}.${rootProject.name}"
val mainPackage = "${project.group}.${rootProject.name.lowercase()}"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(JavaVersion.VERSION_17.majorVersion)) // Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.ExampleUser.ExamplePlugin;
package io.github.exampleuser.exampleplugin;

import com.github.milkdrinkers.colorparser.ColorParser;
import io.github.ExampleUser.ExamplePlugin.command.CommandHandler;
import io.github.ExampleUser.ExamplePlugin.config.ConfigHandler;
import io.github.ExampleUser.ExamplePlugin.db.DatabaseHandler;
import io.github.ExampleUser.ExamplePlugin.hooks.VaultHook;
import io.github.ExampleUser.ExamplePlugin.listener.ListenerHandler;
import io.github.ExampleUser.ExamplePlugin.utility.Logger;
import io.github.exampleuser.exampleplugin.command.CommandHandler;
import io.github.exampleuser.exampleplugin.config.ConfigHandler;
import io.github.exampleuser.exampleplugin.db.DatabaseHandler;
import io.github.exampleuser.exampleplugin.hooks.VaultHook;
import io.github.exampleuser.exampleplugin.listener.ListenerHandler;
import io.github.exampleuser.exampleplugin.utility.Logger;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin;
package io.github.exampleuser.exampleplugin;

/**
* Implemented in classes that should support being reloaded IE executing the methods during runtime after startup.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.command;
package io.github.exampleuser.exampleplugin.command;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.exampleuser.exampleplugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.Reloadable;
import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.CommandAPIBukkitConfig;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin.command;
package io.github.exampleuser.exampleplugin.command;

import com.github.milkdrinkers.colorparser.ColorParser;
import dev.jorel.commandapi.CommandAPICommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.config;
package io.github.exampleuser.exampleplugin.config;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.exampleuser.exampleplugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.Reloadable;
import com.github.milkdrinkers.Crate.Config;

import javax.inject.Singleton;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.ExampleUser.ExamplePlugin.db;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.ExampleUser.ExamplePlugin.db.flyway.DatabaseMigrationException;
import io.github.ExampleUser.ExamplePlugin.db.flyway.DatabaseMigrationHandler;
import io.github.ExampleUser.ExamplePlugin.db.jooq.JooqContext;
import io.github.ExampleUser.ExamplePlugin.utility.Cfg;
import io.github.ExampleUser.ExamplePlugin.utility.Logger;
package io.github.exampleuser.exampleplugin.db;

import io.github.exampleuser.exampleplugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.Reloadable;
import io.github.exampleuser.exampleplugin.db.flyway.DatabaseMigrationException;
import io.github.exampleuser.exampleplugin.db.flyway.DatabaseMigrationHandler;
import io.github.exampleuser.exampleplugin.db.jooq.JooqContext;
import io.github.exampleuser.exampleplugin.utility.Cfg;
import io.github.exampleuser.exampleplugin.utility.Logger;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.db;
package io.github.exampleuser.exampleplugin.db;

import io.github.ExampleUser.ExamplePlugin.utility.DB;
import io.github.ExampleUser.ExamplePlugin.utility.Logger;
import io.github.exampleuser.exampleplugin.utility.DB;
import io.github.exampleuser.exampleplugin.utility.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jooq.DSLContext;
Expand All @@ -13,7 +13,7 @@
import java.sql.SQLException;
import java.util.UUID;

import static io.github.ExampleUser.ExamplePlugin.db.schema.Tables.SOME_LIST;
import static io.github.exampleuser.exampleplugin.db.schema.Tables.SOME_LIST;

/**
* A holder class for all SQL queries
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin.db;
package io.github.exampleuser.exampleplugin.db;

import com.mysql.cj.jdbc.MysqlDataSource;
import org.h2.jdbcx.JdbcDataSource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin.db.flyway;
package io.github.exampleuser.exampleplugin.db.flyway;

/**
* Database migration exception is thrown whenever a Flyway migration fails.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.db.flyway;
package io.github.exampleuser.exampleplugin.db.flyway;

import io.github.ExampleUser.ExamplePlugin.db.DatabaseType;
import io.github.ExampleUser.ExamplePlugin.db.flyway.migration.V3__Example;
import io.github.exampleuser.exampleplugin.db.DatabaseType;
import io.github.exampleuser.exampleplugin.db.flyway.migration.V3__Example;
import com.github.milkdrinkers.Crate.Config;
import org.flywaydb.core.Flyway;
import org.flywaydb.core.api.ClassProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ExampleUser.ExamplePlugin.db.flyway;
package io.github.exampleuser.exampleplugin.db.flyway;

import org.flywaydb.core.api.ClassProvider;
import org.flywaydb.core.api.migration.JavaMigration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.ExampleUser.ExamplePlugin.db.flyway.migration;
package io.github.exampleuser.exampleplugin.db.flyway.migration;

import io.github.ExampleUser.ExamplePlugin.utility.DB;
import io.github.ExampleUser.ExamplePlugin.utility.Logger;
import io.github.exampleuser.exampleplugin.utility.DB;
import io.github.exampleuser.exampleplugin.utility.Logger;
import org.flywaydb.core.api.migration.BaseJavaMigration;
import org.flywaydb.core.api.migration.Context;
import org.jooq.DSLContext;

import static io.github.ExampleUser.ExamplePlugin.db.schema.Tables.TEST;
import static io.github.exampleuser.exampleplugin.db.schema.Tables.TEST;
import static org.jooq.impl.DSL.field;
import static org.jooq.impl.DSL.name;
import static org.jooq.impl.SQLDataType.VARCHAR;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.ExampleUser.ExamplePlugin.db.jooq;
package io.github.exampleuser.exampleplugin.db.jooq;

import io.github.ExampleUser.ExamplePlugin.utility.Cfg;
import io.github.exampleuser.exampleplugin.utility.Cfg;
import org.jooq.*;
import org.jooq.conf.*;
import org.jooq.exception.DataAccessException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.hooks;
package io.github.exampleuser.exampleplugin.hooks;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.exampleuser.exampleplugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.Reloadable;
import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.listener;
package io.github.exampleuser.exampleplugin.listener;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.Reloadable;
import io.github.exampleuser.exampleplugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.Reloadable;

/**
* A class to handle registration of event listeners.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.ExampleUser.ExamplePlugin.listener;
package io.github.exampleuser.exampleplugin.listener;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.ExamplePlugin;
import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
Expand All @@ -10,11 +10,11 @@
import org.bukkit.plugin.RegisteredServiceProvider;

/**
* Event Listener for the Vault Hook {@link io.github.ExampleUser.ExamplePlugin.hooks.VaultHook}.
* Event Listener for the Vault Hook {@link io.github.exampleuser.exampleplugin.hooks.VaultHook}.
*/
public class VaultListener implements Listener {
/**
* Update the Vault hooks RegisteredServiceProviders in {@link io.github.ExampleUser.ExamplePlugin.hooks.VaultHook}. <br>This ensures the Vault hook is lazily loaded and working properly, even on reloads.
* Update the Vault hooks RegisteredServiceProviders in {@link io.github.exampleuser.exampleplugin.hooks.VaultHook}. <br>This ensures the Vault hook is lazily loaded and working properly, even on reloads.
*
* @param e event
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.utility;
package io.github.exampleuser.exampleplugin.utility;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.config.ConfigHandler;
import io.github.exampleuser.exampleplugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.config.ConfigHandler;
import com.github.milkdrinkers.Crate.Config;
import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.github.ExampleUser.ExamplePlugin.utility;
package io.github.exampleuser.exampleplugin.utility;

import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.ExampleUser.ExamplePlugin.db.DatabaseHandler;
import io.github.ExampleUser.ExamplePlugin.db.DatabaseType;
import io.github.ExampleUser.ExamplePlugin.db.jooq.JooqContext;
import io.github.exampleuser.exampleplugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.db.DatabaseHandler;
import io.github.exampleuser.exampleplugin.db.DatabaseType;
import io.github.exampleuser.exampleplugin.db.jooq.JooqContext;
import org.jetbrains.annotations.NotNull;
import org.jooq.DSLContext;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.ExampleUser.ExamplePlugin.utility;
package io.github.exampleuser.exampleplugin.utility;


import io.github.ExampleUser.ExamplePlugin.ExamplePlugin;
import io.github.exampleuser.exampleplugin.ExamplePlugin;
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
import org.jetbrains.annotations.NotNull;

Expand Down

0 comments on commit 885b75a

Please sign in to comment.