Skip to content

Commit

Permalink
updated maven compiler plugin, added aspect changes back
Browse files Browse the repository at this point in the history
  • Loading branch information
myzticbean committed Oct 10, 2024
1 parent 11399ec commit e40e297
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 75 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Minecraft Developer Tools `v1.0.6-alpha`
# Minecraft Developer Tools `v1.0.7-alpha`

**Note:** This is a fork of the amazing [SimpAPI](https://github.com/Cortex-MC/SimpAPI?tab=readme-ov-file), with some essential feature enhancements and code optimizations.

Expand Down Expand Up @@ -42,7 +42,7 @@ Video Showcase: https://youtu.be/kKaIf7EkCWg
<dependency>
<groupId>com.github.myzticbean</groupId>
<artifactId>MCDevTools</artifactId>
<version>1.0.6-alpha</version>
<version>1.0.7-alpha</version>
</dependency>
```

Expand All @@ -68,7 +68,7 @@ repositories {
Groovy/Kotlin:
```groovy
dependencies {
implementation 'com.github.myzticbean:MCDevTools:1.0.6-alpha'
implementation 'com.github.myzticbean:MCDevTools:1.0.7-alpha'
}
```
([Back to top](#table-of-contents))
Expand Down
84 changes: 42 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.myzticbean</groupId>
<artifactId>MCDevTools</artifactId>
<version>1.0.6-alpha</version>
<version>1.0.7-alpha</version>
<packaging>jar</packaging>
<name>MCDevTools</name>
<properties>
Expand All @@ -21,7 +21,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<!-- <version>3.8.1</version>-->
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand Down Expand Up @@ -77,41 +77,41 @@
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.codehaus.mojo</groupId>-->
<!-- <artifactId>aspectj-maven-plugin</artifactId>-->
<!-- <version>1.14.0</version>-->
<!-- <configuration>-->
<!-- <complianceLevel>${java.version}</complianceLevel>-->
<!-- <source>${java.version}</source>-->
<!-- <target>${java.version}</target>-->
<!-- <showWeaveInfo>true</showWeaveInfo>-->
<!-- <verbose>true</verbose>-->
<!-- <Xlint>ignore</Xlint>-->
<!-- <encoding>UTF-8</encoding>-->
<!-- <forceAjcCompile>true</forceAjcCompile>-->
<!-- <sources/>-->
<!-- <weaveDirectories>-->
<!-- <weaveDirectory>${project.build.directory}/classes</weaveDirectory>-->
<!-- <weaveDirectory>${project.build.directory}/generated-sources</weaveDirectory>-->
<!-- </weaveDirectories>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>compile</goal>-->
<!-- <goal>test-compile</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- <dependencies>-->
<!-- <dependency>-->
<!-- <groupId>org.aspectj</groupId>-->
<!-- <artifactId>aspectjtools</artifactId>-->
<!-- <version>${aspectj.version}</version>-->
<!-- </dependency>-->
<!-- </dependencies>-->
<!-- </plugin>-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.14.0</version>
<configuration>
<complianceLevel>${java.version}</complianceLevel>
<source>${java.version}</source>
<target>${java.version}</target>
<showWeaveInfo>true</showWeaveInfo>
<verbose>true</verbose>
<Xlint>ignore</Xlint>
<encoding>UTF-8</encoding>
<forceAjcCompile>true</forceAjcCompile>
<sources/>
<weaveDirectories>
<weaveDirectory>${project.build.directory}/classes</weaveDirectory>
<weaveDirectory>${project.build.directory}/generated-sources</weaveDirectory>
</weaveDirectories>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-javadoc-plugin</artifactId>-->
Expand Down Expand Up @@ -190,11 +190,11 @@
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.aspectj</groupId>-->
<!-- <artifactId>aspectjrt</artifactId>-->
<!-- <version>${aspectj.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>

</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/myzticbean/mcdevtools/MCDevTools.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.myzticbean.mcdevtools;

//import io.myzticbean.mcdevtools.annotations.async.aspect.RunAsyncAspect;
import io.myzticbean.mcdevtools.annotations.async.aspect.RunAsyncAspect;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

Expand All @@ -21,6 +21,6 @@ public void onDisable() {

public static void setup(JavaPlugin pluginInstance) {
plugin = pluginInstance;
// new RunAsyncAspect(plugin);
new RunAsyncAspect(plugin);
}
}
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
package io.myzticbean.mcdevtools.annotations.async.aspect;

//import io.myzticbean.mcdevtools.annotations.async.RunAsync;
//import lombok.NoArgsConstructor;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.bukkit.Bukkit;
//import org.bukkit.plugin.java.JavaPlugin;
import io.myzticbean.mcdevtools.annotations.async.RunAsync;
import lombok.NoArgsConstructor;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

////@Aspect
////@NoArgsConstructor // Default constructor required for AspectJ
@Aspect
@NoArgsConstructor // Default constructor required for AspectJ
public class RunAsyncAspect {
//
// private static JavaPlugin plugin;
//
// public RunAsyncAspect(JavaPlugin pluginInstance) {
// plugin = pluginInstance;
// }
//
// @Around("@annotation(async)")
// public Object executeAsynchronously(ProceedingJoinPoint joinPoint, RunAsync async) throws Throwable {
// if (plugin == null) throw new IllegalStateException("RunAsyncAspect not initialized with plugin instance");
// Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
// try {
// joinPoint.proceed();
// } catch (Throwable throwable) {
// throwable.printStackTrace();
// }
// });
// return null;
// }

private static JavaPlugin plugin;

public RunAsyncAspect(JavaPlugin pluginInstance) {
plugin = pluginInstance;
}

@Around("@annotation(async)")
public Object executeAsynchronously(ProceedingJoinPoint joinPoint, RunAsync async) throws Throwable {
if (plugin == null) throw new IllegalStateException("RunAsyncAspect not initialized with plugin instance");
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
try {
joinPoint.proceed();
} catch (Throwable throwable) {
throwable.printStackTrace();
}
});
return null;
}

}

0 comments on commit e40e297

Please sign in to comment.