Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: /makeplugin * #19

Merged
merged 7 commits into from Nov 6, 2017
Merged

New command: /makeplugin * #19

merged 7 commits into from Nov 6, 2017

Conversation

@Awzaw
Copy link
Contributor

@Awzaw Awzaw commented Oct 4, 2017

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

dktapps and others added 2 commits Sep 28, 2017
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]

This comment has been minimized.

@dktapps

dktapps Oct 5, 2017
Member

I don't think this has an ALPHA9 requirement? It can be pushed to ALPHA8 without any problems

This comment has been minimized.

@Awzaw

Awzaw Oct 5, 2017
Author Contributor

Not sure how your bump commit snuck in there...

}elseif(isset($args[0]) and $args[0] === "*"){
$plugins = $this->getServer()->getPluginManager()->getPlugins();
$succeeded = $failed = [];
foreach($plugins as $plugin){

This comment has been minimized.

@dktapps

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 comment has been minimized.

@Awzaw

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."

Awzaw added 2 commits Oct 5, 2017
This reverts commit 857e8af
@@ -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()])){

This comment has been minimized.

@dktapps

dktapps Oct 5, 2017
Member

this will still yield the "Failed to build", I meant it should just skip non-folder-plugins entirely.

Awzaw added 3 commits Oct 5, 2017
@dktapps
dktapps approved these changes Nov 6, 2017
@dktapps dktapps merged commit b8bb8ee into pmmp:master Nov 6, 2017
1 check passed
1 check passed
poggit-ci/pocketmine-devtools Created PR build #7 (&29402): 1 lint,
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants