Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 42 lines (29 sloc) 1.405 kb
f20db62 @migueldeicaza Initial import of XobotOS into the public repo
migueldeicaza authored
1 #!/usr/bin/perl -w
2
3 use strict;
4 use File::Basename;
5 use Cwd 'abs_path';
6
7 die "Usage: $0 project-dir target [output-name]" unless $#ARGV == 1 || $#ARGV == 2;
8
9 my ($project_dir,$target,$name) = @ARGV;
10
11 my $solution_dir = dirname(abs_path($0));
12 die "Not a directory: $solution_dir" unless -d $solution_dir;
13 die "Not a directory: $project_dir" unless -d $project_dir;
14 die "Invalid target" unless $target =~ /^\w+$/;
15 die "Invalid name" unless $#ARGV == 1 || $name =~ /^\w+$/;
16
17 $project_dir = abs_path($project_dir);
18
19 if ($#ARGV == 1) {
20 my $part = basename($project_dir);
21 die "Must specify name" unless $part =~ /^\w+$/;
22 $name = $part . "-res.zip";
23 }
24
25 my $framework_apk = $solution_dir . "/android/system-root/framework/framework-res.apk";
26 die "Invalid solution dir" unless -f $framework_apk;
27
28 my $target_dir = "$solution_dir/build/$target";
29 die "Invalid target" unless -d $target_dir && -f "$target_dir/xorpt";
30
31 my $manifest = "$project_dir/AndroidManifest.xml";
32 die "No 'AndroidManifest.xml' in $project_dir" unless -f $manifest;
33 die "No 'res' directory in $project_dir" unless -d "$project_dir/res";
34
35 my $reszip = "$project_dir/$name";
36 my $xorpt = "$target_dir/xorpt";
37
38 my @args = ($xorpt, "p", "-f", "-S", "$project_dir/res", "-F", $reszip, "-J", $project_dir, "-M", $manifest, "-I", $framework_apk);
39 system(@args) == 0 or die "Running xorpt failed!";
40
41 printf "Successfully created $reszip.\n";
Something went wrong with that request. Please try again.