Skip to content

Commit

Permalink
Fixed GradleBasePlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Greazi-Times committed Jun 16, 2024
1 parent c5f4e89 commit b5b3636
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def artifactId = 'GradleBasePlugin'
// /---> Major Version - Increment this when you make a breaking change
// | /---> Minor Version - Increment this when you add a new feature
// | | /---> Patch Version - Increment this when you make a bug fix
def versionNum = '5.0.3'
def versionNum = '5.0.4'

group = groupId
version = versionNum
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techscode.GradeBasePlugin;
package me.TechsCode.GradleBasePlugin;

public enum Color {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.techscode.GradeBasePlugin;
package me.TechsCode.GradleBasePlugin;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

import com.techscode.GradeBasePlugin.resource.ResourceResponse;
import me.TechsCode.GradleBasePlugin.extensions.MetaExtension;
import me.TechsCode.GradleBasePlugin.resource.ResourceManager;
import me.TechsCode.GradleBasePlugin.resource.ResourceResponse;
import org.gradle.api.Plugin;
import org.gradle.api.Project;

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar;

import com.techscode.GradeBasePlugin.extensions.MetaExtension;
import com.techscode.GradeBasePlugin.resource.ResourceManager;
import com.techscode.GradeBasePlugin.tasks.GenerateMetaFilesTask;
import me.TechsCode.GradleBasePlugin.tasks.GenerateMetaFilesTask;

public class GradleBasePlugin implements Plugin<Project> {

Expand All @@ -30,9 +30,9 @@ public class GradleBasePlugin implements Plugin<Project> {
};

private static final String[] relocations = new String[] {
"com.techscode.base#com.techscode.PROJECT_NAME.base",
"com.techscode.tpl#com.techscode.PROJECT_NAME.tpl",
"com.techscode.dependencies#com.techscode.PROJECT_NAME.dependencies"
"com.techscode.base#me.TechsCode.PROJECT_NAME.base",
"com.techscode.tpl#me.TechsCode.PROJECT_NAME.tpl",
"com.techscode.dependencies#me.TechsCode.PROJECT_NAME.dependencies"
};

private MetaExtension meta;
Expand All @@ -41,8 +41,8 @@ public class GradleBasePlugin implements Plugin<Project> {

@Override
public void apply(Project project) {
Logger.info(
Color.BLUE_BOLD_BRIGHT + "Applying GradleBasePlugin to " + project.getName() + "...",
me.TechsCode.GradleBasePlugin.Logger.info(
me.TechsCode.GradleBasePlugin.Color.BLUE_BOLD_BRIGHT + "Applying GradleBasePlugin to " + project.getName() + "...",
"",
"Project Information:"
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techscode.GradeBasePlugin;
package me.TechsCode.GradleBasePlugin;

/**
* Logging util making it easier to log messages to the console
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techscode.GradeBasePlugin.extensions;
package me.TechsCode.GradleBasePlugin.extensions;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.techscode.GradeBasePlugin.extensions;
package me.TechsCode.GradleBasePlugin.extensions;

import java.util.ArrayList;

import com.techscode.GradeBasePlugin.Logger;
import me.TechsCode.GradleBasePlugin.Logger;

public class MetaExtension {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techscode.GradeBasePlugin.resource;
package me.TechsCode.GradleBasePlugin.resource;

import java.io.File;
import java.io.IOException;
Expand All @@ -8,10 +8,10 @@
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

import com.techscode.GradeBasePlugin.Color;
import com.techscode.GradeBasePlugin.Logger;
import com.techscode.GradeBasePlugin.extensions.Downloader;
import com.techscode.GradeBasePlugin.extensions.MetaExtension;
import me.TechsCode.GradleBasePlugin.Color;
import me.TechsCode.GradleBasePlugin.Logger;
import me.TechsCode.GradleBasePlugin.extensions.Downloader;
import me.TechsCode.GradleBasePlugin.extensions.MetaExtension;
import org.gradle.api.Project;

public class ResourceManager {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techscode.GradeBasePlugin.resource;
package me.TechsCode.GradleBasePlugin.resource;

public enum ResourceResponse {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.techscode.GradeBasePlugin.tasks;
package me.TechsCode.GradleBasePlugin.tasks;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import com.techscode.GradeBasePlugin.Color;
import com.techscode.GradeBasePlugin.Logger;
import com.techscode.GradeBasePlugin.extensions.MetaExtension;
import me.TechsCode.GradleBasePlugin.Color;
import me.TechsCode.GradleBasePlugin.Logger;
import me.TechsCode.GradleBasePlugin.extensions.MetaExtension;
import org.gradle.api.DefaultTask;
import org.gradle.api.tasks.TaskAction;

Expand Down Expand Up @@ -42,7 +42,7 @@ private void createPluginYml(File resourcesFolder, String projectName, String pr
writer.println("author: Tech");
writer.println("website: " + projectName + ".com");
writer.println("build: " + buildNumber);
writer.println("main: com.techscode." + getProject().getName() + ".base.loader.SpigotLoader");
writer.println("main: me.TechsCode." + getProject().getName() + ".base.loader.SpigotLoader");
writer.println("api-version: 1.13");

if (loadAfter != null) {
Expand All @@ -57,6 +57,8 @@ private void createPluginYml(File resourcesFolder, String projectName, String pr
if (libraries != null) {
writer.println("libraries:");
libraries.stream().map(library -> "- " + library).forEach(writer::println);
} else {
writer.println("libraries: []");
}
writer.close();
}
Expand All @@ -70,12 +72,14 @@ private void createBungeeYml(File resourcesFolder, String projectName, String pr
writer.println("name: " + projectName);
writer.println("version: " + projectVersion);
writer.println("build: " + buildNumber);
writer.println("main: com.techscode." + getProject().getName() + ".base.loader.BungeeLoader");
writer.println("main: me.TechsCode." + getProject().getName() + ".base.loader.BungeeLoader");
writer.println("author: Tech");

if (libraries != null) {
writer.println("libraries:");
libraries.stream().map(library -> "- " + library).forEach(writer::println);
} else {
writer.println("libraries: []");
}
writer.close();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
implementation-class=com.techscode.GradeBasePlugin.GradleBasePlugin
implementation-class=me.TechsCode.GradleBasePlugin.GradleBasePlugin

0 comments on commit b5b3636

Please sign in to comment.