Skip to content

Commit

Permalink
Fix update checking, ensure version file is created for v2 and plugin…
Browse files Browse the repository at this point in the history
… modules
  • Loading branch information
devoxin committed Aug 6, 2024
1 parent 9d015e5 commit 3a6e700
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
13 changes: 12 additions & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
`java-library`
Expand Down Expand Up @@ -38,4 +39,14 @@ java {
mavenPublishing {
coordinates("dev.lavalink.youtube", "youtube-plugin", version.toString())
configure(JavaLibrary(JavadocJar.None(), sourcesJar = false))
}
}

tasks {
processResources {
filter<ReplaceTokens>(
"tokens" to mapOf(
"version" to project.version
)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
public class PluginInfo {
private static final Logger log = LoggerFactory.getLogger(PluginInfo.class);

static {
try {
checkForNewRelease();
} catch (Throwable ignored) {

}
}

public static void checkForNewRelease() throws IOException, JsonParserException {
String versionS = YoutubeSource.VERSION;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public YoutubePluginLoader(final YoutubeConfig youtubeConfig,
}

this.clientProvider = provider;

try {
PluginInfo.checkForNewRelease();
} catch (Throwable ignored) {

}
}

private ClientProvider getClientProvider(String name) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
Expand Down
1 change: 1 addition & 0 deletions plugin/src/main/resources/yts-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@version@
11 changes: 11 additions & 0 deletions v2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
`java-library`
Expand All @@ -24,3 +25,13 @@ dependencies {
mavenPublishing {
configure(JavaLibrary(JavadocJar.Javadoc()))
}

tasks {
processResources {
filter<ReplaceTokens>(
"tokens" to mapOf(
"version" to project.version
)
)
}
}
1 change: 1 addition & 0 deletions v2/src/main/resources/yts-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@version@

0 comments on commit 3a6e700

Please sign in to comment.