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

PostprocessBuildPlayer not compatible with other plugins. #4

Closed
Dgizusse opened this issue Dec 20, 2013 · 5 comments
Closed

PostprocessBuildPlayer not compatible with other plugins. #4

Dgizusse opened this issue Dec 20, 2013 · 5 comments
Labels

Comments

@Dgizusse
Copy link

The most common way to handle this is to include a PostprocessBuildPlayer_PlayGames file that handles the specific need of this plugin and include a generic PostprocessBuildPlayer that does this:

#!/usr/bin/perl


# Post Process Build Player -- Master 
# Searches for other PostprocessBuildPlayer scripts and executes them. Make sure the other script
# have a name suffix with an underscore "_" like "PostprocessBuildPlayer_AnotherBuild" or whatever.
#
# Based on script by Rob Terrell, rob@stinkbot.com

use File::Glob ':glob';

# Grab all the PostprocessBuildPlayer files
@files = bsd_glob( "Assets/Editor/postprocessbuildplayer_*", GLOB_NOCASE );

foreach $file( @files )
{
    if( !( $file =~ m/\./ ) )
    {
        system( "chmod", "755", $file );
        print "PostProcessBuildPlayer: calling " . $file . "\n";
        system( $file, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3], $ARGV[4], $ARGV[5], $ARGV[6] );

        if ( $? == -1 )
        {
          print "command failed: $!\n";
        }
        else
        {
          printf "command exited with value %d", $? >> 8;
        }
    }
}
@btco
Copy link

btco commented Dec 20, 2013

Makes sense! I won't implement it exactly this way, but I'll make the plugin aware of other PostProcessBuildPlayer scripts that are in place. Thanks for reporting!

@kromenak
Copy link

I also ran into this issue - as @Dgizusse mentions, that script is generally considered the "right" or extendable way to make multiple PostprocessBuildPlayer scripts work together.

The documentation link for Unity is broken, but it's also possible to use the PostprocessBuild attribute in C# code to run code after a build, which I thought was pretty cool and also avoids any conflicts like this.

@tenpn
Copy link

tenpn commented Jan 20, 2014

My 2c is that even if your script does "something similar", because it's not exactly the same you're going to cause conflicts when new plugins are installed after you. This script line-for-line is pretty much standard now.

Kromenak's PostprocessBuild attribute is the way to go. The propeller sdk at http://developers.grantoo.com/ uses it if you want a reference.

@btco
Copy link

btco commented Jan 31, 2014

Ok, I'll do it this way then! I plan to fix this soon. Thanks for the feedback.

[internal tracking# 12836532]

@btco
Copy link

btco commented Feb 19, 2014

Fixed on 0.8.01.

@btco btco closed this as completed Feb 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants