diff --git a/build.gradle b/build.gradle index df93272..fc207c1 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ repositories { } dependencies { - compile 'org.spongepowered:plugin-meta:0.4' + compile 'org.spongepowered:plugin-meta:0.4.1' compileOnly 'org.codehaus.groovy:groovy-all:2.4.7:indy' } diff --git a/src/main/groovy/org/spongepowered/gradle/meta/PluginElement.groovy b/src/main/groovy/org/spongepowered/gradle/meta/PluginElement.groovy index 825a4ae..ce331b8 100644 --- a/src/main/groovy/org/spongepowered/gradle/meta/PluginElement.groovy +++ b/src/main/groovy/org/spongepowered/gradle/meta/PluginElement.groovy @@ -24,6 +24,8 @@ */ package org.spongepowered.gradle.meta +import static org.spongepowered.plugin.meta.PluginMetadata.ID_PATTERN + abstract class PluginElement { private String id @@ -43,6 +45,7 @@ abstract class PluginElement { } assert !this.registered, "Cannot change plugin ID after element was registered" + assert id ==~ ID_PATTERN, "Plugin ID must match pattern " + ID_PATTERN this.id = id } @@ -51,6 +54,7 @@ abstract class PluginElement { } void register() { + assert id ==~ ID_PATTERN, "Plugin ID must match pattern " + ID_PATTERN this.registered = true }