2011-10-19 01:36:31 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use FindBin qw($Bin);
|
|
|
|
use Getopt::Long;
|
|
|
|
|
|
|
|
sub usage {
|
2011-12-04 22:00:38 +00:00
|
|
|
die "Usage: dev-appengine [--wipe] [-a] [-p port] -- [other_dev_appserver_opts]";
|
2011-10-19 01:36:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
my $opt_wipe;
|
2011-12-04 22:00:38 +00:00
|
|
|
my $opt_port;
|
2011-10-19 01:36:31 +00:00
|
|
|
my $opt_all; # listen on all interfaces
|
|
|
|
GetOptions("wipe" => \$opt_wipe,
|
|
|
|
"all" => \$opt_all,
|
2011-12-04 22:00:38 +00:00
|
|
|
"p=i" => \$opt_port,
|
2011-10-19 01:36:31 +00:00
|
|
|
) or usage();
|
|
|
|
|
|
|
|
my $sdk = readlink("$Bin/appengine-sdk")
|
|
|
|
or die "No App Engine SDK symlink; please:\n \$ ln -s /path/to/appengine-go-sdk $Bin/appengine-sdk\n\n";
|
|
|
|
|
|
|
|
my @args = (
|
|
|
|
"$sdk/dev_appserver.py",
|
|
|
|
"--skip_sdk_update_check",
|
|
|
|
"--high_replication",
|
|
|
|
);
|
|
|
|
|
|
|
|
if ($opt_all) {
|
|
|
|
push @args, "-a", "0.0.0.0";
|
|
|
|
}
|
|
|
|
if ($opt_wipe) {
|
|
|
|
push @args, "--clear_datastore";
|
|
|
|
}
|
2011-12-04 22:00:38 +00:00
|
|
|
if ($opt_port) {
|
2011-12-04 22:16:19 +00:00
|
|
|
push @args, "-p", "$opt_port";
|
2011-12-04 22:00:38 +00:00
|
|
|
} else {
|
2011-12-04 22:16:19 +00:00
|
|
|
push @args, "-p", "3179";
|
2011-12-04 22:00:38 +00:00
|
|
|
}
|
2011-10-19 01:36:31 +00:00
|
|
|
push @args, @ARGV;
|
|
|
|
|
2013-02-02 16:56:57 +00:00
|
|
|
chdir "$Bin/server/appengine" or die "$!";
|
|
|
|
push @args, ".";
|
2011-10-19 01:36:31 +00:00
|
|
|
|
|
|
|
print "\$ @args\n";
|
|
|
|
|
|
|
|
exec(@args);
|