phonegap-build 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Alex MacCaw (info@eribium.org)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,38 @@
1
+ # PhoneGap command line utilities
2
+
3
+ Easily build PhoneGap applications from the command line.
4
+
5
+ ##Installation
6
+
7
+ gem install phonegap-build
8
+
9
+ You'll need to install the PhoneGap libraries separately from [www.phonegap.com](http://www.phonegap.com/). For iOS, [download the libraries](http://www.phonegap.com/download-thankyou), navigate to the `iOS` folder and install `PhoneGapInstaller.pkg`.
10
+ Android is currently not supported.
11
+
12
+ ##Usage
13
+
14
+ $ phonegap -h
15
+
16
+ Usage: phonegap [OPTIONS] PATH
17
+
18
+ Configuration:
19
+ --ios Compile iOS applications
20
+ --android Compile Android applications
21
+
22
+ Optional:
23
+ --target [TARGET] Either 'device' or 'emulator'
24
+ --config [TYPE] Either 'debug' or 'release'
25
+ --name [NAME] Application name
26
+ --[no-]build Build application (default is true)
27
+
28
+ Miscellaneous:
29
+ -?, --help Display this usage information
30
+ -v, --version Display version
31
+
32
+ $ phonegap --ios ./public
33
+ $ cd ./build/ios
34
+
35
+ If a dir called `public` or `www` exists under the specified directory, then phonegap-build will use that instead. The application will be created in a directory called `build`.
36
+
37
+
38
+
@@ -6,16 +6,15 @@ require 'optparse'
6
6
  require 'phonegap'
7
7
 
8
8
  options = {
9
- platforms: [],
9
+ platforms: [:ios],
10
10
  config: "debug",
11
11
  target: "emulator",
12
- name: "app",
13
- build: true
12
+ name: "PhoneGap"
14
13
  }
15
14
 
16
15
  opts = OptionParser.new do |opts|
17
16
  opts.summary_width = 25
18
- opts.banner = "Usage: phonegap [OPTIONS] PATH"
17
+ opts.banner = "Usage: phonegap [OPTIONS] [build/new] PATH"
19
18
 
20
19
  opts.separator ""
21
20
  opts.separator "Configuration:"
@@ -43,10 +42,6 @@ opts = OptionParser.new do |opts|
43
42
  options[:name] = v
44
43
  end
45
44
 
46
- opts.on("--[no-]build", "Build application (default is true)") do |v|
47
- options[:build] = v
48
- end
49
-
50
45
  opts.separator ""; opts.separator "Miscellaneous:"
51
46
 
52
47
  opts.on_tail("-?", "--help", "Display this usage information") do
@@ -62,11 +57,18 @@ opts = OptionParser.new do |opts|
62
57
  opts.parse!
63
58
  end
64
59
 
65
- path = ARGV[0]
60
+ type = ARGV[0]
61
+ path = ARGV[1] || Dir.pwd
66
62
 
67
- if path.nil? or options[:platforms].empty?
63
+ case type
64
+ when "build"
65
+ options[:build] = true
66
+ when "generate", "new"
67
+ options[:generate] = true
68
+ else
69
+ p type
68
70
  puts "#{opts}\n"
69
71
  exit
70
72
  end
71
73
 
72
- PhoneGap.build(path, options)
74
+ PhoneGap.process(path, options)
@@ -4,10 +4,10 @@ module PhoneGap
4
4
  autoload :Builder, "phonegap/builder"
5
5
  autoload :Builders, "phonegap/builders"
6
6
 
7
- def build(path, options = {})
7
+ def process(path, options = {})
8
8
  platforms = options[:platforms] || []
9
9
  platforms.each do |platform|
10
- Builders.for_platform(platform).build(path, options)
10
+ Builders.for_platform(platform).process(path, options)
11
11
  end
12
12
  end
13
13
 
@@ -13,8 +13,8 @@ module PhoneGap
13
13
  @platform
14
14
  end
15
15
 
16
- def build(path, options)
17
- self.new(path, options).build
16
+ def process(path, options)
17
+ self.new(path, options).process
18
18
  end
19
19
  end
20
20
 
@@ -22,18 +22,27 @@ module PhoneGap
22
22
 
23
23
  def initialize(path, options)
24
24
  @options = options
25
- @path = Pathname.new(path)
26
- raise "Path doesn't exist" unless @path.exist?
27
-
25
+ @path = Pathname.new(path)
26
+
28
27
  @web_path = @path.join("public") if @path.join("public").exist?
29
28
  @web_path = @path.join("www") if @path.join("www").exist?
30
-
31
- unless @web_path
29
+
30
+ if !@web_path && @path.exist?
32
31
  @web_path = @path.dup
33
32
  @path = @path.parent
34
33
  end
35
34
 
36
- @build_path = @path.join("build", platform)
35
+ @build_path = @path.join("build", platform)
36
+ @build_path.mkpath
37
+ end
38
+
39
+ def process
40
+ generate if options[:generate]
41
+ build if options[:build]
42
+ end
43
+
44
+ def generate
45
+ raise "Implement"
37
46
  end
38
47
 
39
48
  def build
@@ -56,6 +65,7 @@ module PhoneGap
56
65
  end
57
66
 
58
67
  def setup_application
68
+ return unless web_path.exist?
59
69
  www_path = build_path.join("www")
60
70
  www_path.rmtree
61
71
  FileUtils.cp_r(web_path, www_path)
@@ -3,22 +3,22 @@ module PhoneGap
3
3
  class IOS < Builder
4
4
  register :ios
5
5
 
6
- def build
6
+ def generate
7
7
  setup_build
8
-
8
+
9
9
  create_script = platform_path.join("create_project.sh")
10
10
  system(
11
11
  create_script.to_s,
12
12
  options[:name],
13
13
  build_path.to_s
14
14
  )
15
-
15
+
16
16
  setup_template
17
- setup_application
17
+ setup_application
18
18
  setup_platform
19
-
20
- return if options[:build] == false
21
-
19
+ end
20
+
21
+ def build
22
22
  build_script = platform_path.join("build.sh")
23
23
  system(
24
24
  build_script.to_s,
@@ -1,3 +1,3 @@
1
1
  module PhoneGap
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -12,7 +12,7 @@
12
12
  #
13
13
  # run 'xcodebuild -showsdks' to show the valid sdks on the system
14
14
 
15
- current_sdk_version=3.0
15
+ current_sdk_version=4.3
16
16
  xcodebuild="/usr/bin/xcodebuild"
17
17
 
18
18
  # check whether the xcodebuild command exists
metadata CHANGED
@@ -1,31 +1,28 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: phonegap-build
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
4
5
  prerelease:
5
- version: 0.0.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Alex MacCaw
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-04 00:00:00 -05:00
14
- default_executable:
12
+ date: 2011-08-11 00:00:00.000000000Z
15
13
  dependencies: []
16
-
17
14
  description:
18
- email:
15
+ email:
19
16
  - maccman@gmail.com
20
- executables:
17
+ executables:
21
18
  - phonegap
22
19
  extensions: []
23
-
24
20
  extra_rdoc_files: []
25
-
26
- files:
21
+ files:
27
22
  - .gitignore
28
23
  - Gemfile
24
+ - LICENSE
25
+ - README.md
29
26
  - Rakefile
30
27
  - bin/phonegap
31
28
  - lib/phonegap.rb
@@ -37,33 +34,28 @@ files:
37
34
  - phonegap.gemspec
38
35
  - platform/ios/build.sh
39
36
  - platform/ios/create_project.sh
40
- has_rdoc: true
41
37
  homepage: http://github.com/maccman/phonegap
42
38
  licenses: []
43
-
44
39
  post_install_message:
45
40
  rdoc_options: []
46
-
47
- require_paths:
41
+ require_paths:
48
42
  - lib
49
- required_ruby_version: !ruby/object:Gem::Requirement
43
+ required_ruby_version: !ruby/object:Gem::Requirement
50
44
  none: false
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: "0"
55
- required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
50
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
61
55
  requirements: []
62
-
63
56
  rubyforge_project:
64
- rubygems_version: 1.6.0
57
+ rubygems_version: 1.8.6
65
58
  signing_key:
66
59
  specification_version: 3
67
60
  summary: Generate PhoneGap applications from the command-line
68
61
  test_files: []
69
-