New command: /makeplugin * #19
Merged
Conversation
plugin.yml
Outdated
@@ -1,7 +1,7 @@ | |||
name: DevTools | |||
main: DevTools\DevTools | |||
version: 1.12.4 | |||
api: [3.0.0-ALPHA7, 3.0.0-ALPHA8] | |||
api: [3.0.0-ALPHA7, 3.0.0-ALPHA8, 3.0.0-ALPHA9] |
dktapps
Oct 5, 2017
Member
I don't think this has an ALPHA9 requirement? It can be pushed to ALPHA8 without any problems
I don't think this has an ALPHA9 requirement? It can be pushed to ALPHA8 without any problems
Awzaw
Oct 5, 2017
Author
Contributor
Not sure how your bump commit snuck in there...
Not sure how your bump commit snuck in there...
src/DevTools/DevTools.php
Outdated
}elseif(isset($args[0]) and $args[0] === "*"){ | ||
$plugins = $this->getServer()->getPluginManager()->getPlugins(); | ||
$succeeded = $failed = []; | ||
foreach($plugins as $plugin){ |
dktapps
Oct 5, 2017
Member
this should check if the loader is a FolderPluginLoader
instance before trying to build it.
makeplugin *
[10:09:58] [Server thread/INFO]: Plugin DevTools is not in folder structure.
[10:09:58] [Server thread/INFO]: [DevTools] Adding files...
[10:09:58] [Server thread/INFO]: [DevTools] Added 4 files
[10:09:58] [Server thread/INFO]: [DevTools] Checking for compressible files...
[10:09:58] [Server thread/INFO]: [DevTools] Done in 0.427s
[10:09:58] [Server thread/INFO]: Phar plugin DumpBadLogins v0.0.1 has been created on plugins\DevTools/\DumpBadLogins_v0.0.1.phar
[10:09:58] [Server thread/INFO]: [DevTools] Adding files...
[10:09:58] [Server thread/INFO]: [DevTools] Added 2 files
[10:09:58] [Server thread/INFO]: [DevTools] Checking for compressible files...
[10:09:58] [Server thread/INFO]: [DevTools] Done in 0.041s
[10:09:58] [Server thread/INFO]: Phar plugin FloatingText v0.0.1 has been created on plugins\DevTools/\FloatingText_v0.0.1.phar
[10:09:58] [Server thread/INFO]: [DevTools] Adding files...
[10:09:58] [Server thread/INFO]: [DevTools] Added 2 files
[10:09:58] [Server thread/INFO]: [DevTools] Checking for compressible files...
[10:09:58] [Server thread/INFO]: [DevTools] Done in 0.054s
[10:09:58] [Server thread/INFO]: Phar plugin test v0.0.1 has been created on plugins\DevTools/\test_v0.0.1.phar
[10:09:58] [Server thread/INFO]: 1 plugin failed to build: DevTools
[10:09:58] [Server thread/INFO]: 3/4 plugins successfully built: DumpBadLogins, FloatingText, test
this should check if the loader is a FolderPluginLoader
instance before trying to build it.
makeplugin *
[10:09:58] [Server thread/INFO]: Plugin DevTools is not in folder structure.
[10:09:58] [Server thread/INFO]: [DevTools] Adding files...
[10:09:58] [Server thread/INFO]: [DevTools] Added 4 files
[10:09:58] [Server thread/INFO]: [DevTools] Checking for compressible files...
[10:09:58] [Server thread/INFO]: [DevTools] Done in 0.427s
[10:09:58] [Server thread/INFO]: Phar plugin DumpBadLogins v0.0.1 has been created on plugins\DevTools/\DumpBadLogins_v0.0.1.phar
[10:09:58] [Server thread/INFO]: [DevTools] Adding files...
[10:09:58] [Server thread/INFO]: [DevTools] Added 2 files
[10:09:58] [Server thread/INFO]: [DevTools] Checking for compressible files...
[10:09:58] [Server thread/INFO]: [DevTools] Done in 0.041s
[10:09:58] [Server thread/INFO]: Phar plugin FloatingText v0.0.1 has been created on plugins\DevTools/\FloatingText_v0.0.1.phar
[10:09:58] [Server thread/INFO]: [DevTools] Adding files...
[10:09:58] [Server thread/INFO]: [DevTools] Added 2 files
[10:09:58] [Server thread/INFO]: [DevTools] Checking for compressible files...
[10:09:58] [Server thread/INFO]: [DevTools] Done in 0.054s
[10:09:58] [Server thread/INFO]: Phar plugin test v0.0.1 has been created on plugins\DevTools/\test_v0.0.1.phar
[10:09:58] [Server thread/INFO]: 1 plugin failed to build: DevTools
[10:09:58] [Server thread/INFO]: 3/4 plugins successfully built: DumpBadLogins, FloatingText, test
Awzaw
Oct 5, 2017
Author
Contributor
since makeplugin doesn't check either I left it as it was - I was more concerned about whether to exclude DevTools itself, or leave it for informational purposes.
Edit - I mean that this is checked within makePluginCommand(), so I didn't also add a check for within onCommand(). I've added the check in the latest commit, but this simply silences the error "Plugin DevTools is not in folder structure."
since makeplugin doesn't check either I left it as it was - I was more concerned about whether to exclude DevTools itself, or leave it for informational purposes.
Edit - I mean that this is checked within makePluginCommand(), so I didn't also add a check for within onCommand(). I've added the check in the latest commit, but this simply silences the error "Plugin DevTools is not in folder structure."
This reverts commit 857e8af
src/DevTools/DevTools.php
Outdated
@@ -59,7 +59,7 @@ public function onCommand(CommandSender $sender, Command $command, string $label | |||
$plugins = $this->getServer()->getPluginManager()->getPlugins(); | |||
$succeeded = $failed = []; | |||
foreach($plugins as $plugin){ | |||
if($this->makePluginCommand($sender, $command, $label, [$plugin->getName()])){ | |||
if(($plugin->getPluginLoader() instanceof FolderPluginLoader) && $this->makePluginCommand($sender, $command, $label, [$plugin->getName()])){ |
dktapps
Oct 5, 2017
Member
this will still yield the "Failed to build", I meant it should just skip non-folder-plugins entirely.
this will still yield the "Failed to build", I meant it should just skip non-folder-plugins entirely.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This PR adds the command
/makeplugin *
to make a distributable phar archive for every plugin loaded from source. Displays a report when finished detailing the results