Skip to content

Commit 3a6e700

Browse files
committed
Fix update checking, ensure version file is created for v2 and plugin modules
1 parent 9d015e5 commit 3a6e700

File tree

6 files changed

+31
-9
lines changed

6 files changed

+31
-9
lines changed

plugin/build.gradle.kts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import com.vanniktech.maven.publish.JavaLibrary
22
import com.vanniktech.maven.publish.JavadocJar
3+
import org.apache.tools.ant.filters.ReplaceTokens
34

45
plugins {
56
`java-library`
@@ -38,4 +39,14 @@ java {
3839
mavenPublishing {
3940
coordinates("dev.lavalink.youtube", "youtube-plugin", version.toString())
4041
configure(JavaLibrary(JavadocJar.None(), sourcesJar = false))
41-
}
42+
}
43+
44+
tasks {
45+
processResources {
46+
filter<ReplaceTokens>(
47+
"tokens" to mapOf(
48+
"version" to project.version
49+
)
50+
)
51+
}
52+
}

plugin/src/main/java/dev/lavalink/youtube/plugin/PluginInfo.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717
public class PluginInfo {
1818
private static final Logger log = LoggerFactory.getLogger(PluginInfo.class);
1919

20-
static {
21-
try {
22-
checkForNewRelease();
23-
} catch (Throwable ignored) {
24-
25-
}
26-
}
27-
2820
public static void checkForNewRelease() throws IOException, JsonParserException {
2921
String versionS = YoutubeSource.VERSION;
3022

plugin/src/main/java/dev/lavalink/youtube/plugin/YoutubePluginLoader.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public YoutubePluginLoader(final YoutubeConfig youtubeConfig,
5353
}
5454

5555
this.clientProvider = provider;
56+
57+
try {
58+
PluginInfo.checkForNewRelease();
59+
} catch (Throwable ignored) {
60+
61+
}
5662
}
5763

5864
private ClientProvider getClientProvider(String name) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@version@

v2/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import com.vanniktech.maven.publish.JavaLibrary
22
import com.vanniktech.maven.publish.JavadocJar
3+
import org.apache.tools.ant.filters.ReplaceTokens
34

45
plugins {
56
`java-library`
@@ -24,3 +25,13 @@ dependencies {
2425
mavenPublishing {
2526
configure(JavaLibrary(JavadocJar.Javadoc()))
2627
}
28+
29+
tasks {
30+
processResources {
31+
filter<ReplaceTokens>(
32+
"tokens" to mapOf(
33+
"version" to project.version
34+
)
35+
)
36+
}
37+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@version@

0 commit comments

Comments
 (0)