Skip to content

Commit

Permalink
Update plugin-meta and validate plugin IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-gh committed Dec 4, 2016
1 parent 09d0be9 commit 5292113
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/
package org.spongepowered.gradle.meta

import static org.spongepowered.plugin.meta.PluginMetadata.ID_PATTERN

abstract class PluginElement {

private String id
Expand All @@ -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
}

Expand All @@ -51,6 +54,7 @@ abstract class PluginElement {
}

void register() {
assert id ==~ ID_PATTERN, "Plugin ID must match pattern " + ID_PATTERN
this.registered = true
}

Expand Down

0 comments on commit 5292113

Please sign in to comment.