cordova-rake 0.0.8 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11dff11147550990d8b4d43e47a3e62063a75f5a
4
- data.tar.gz: 56359274bfdc8a85ad01288dbfd9b6e19ff59406
3
+ metadata.gz: 73a3f2c5d28dd41277b6b42e8b6af4fb8d2139cc
4
+ data.tar.gz: fc42fcb746e2d5c5335455e0665525c640884746
5
5
  SHA512:
6
- metadata.gz: 0d943c8b9e2eef04c8892961a5dc5aee5546ca8b233137c7d29aaa24f1250619bd5c02b2e3e1aa685164f7864f4ca4495a61a27b6c7a7405ff0f62b45f2229bd
7
- data.tar.gz: 06512a1e681f815e368417ef5e5821da2d414418eac8272f67df3ca7f5cc3963d6a77698645886ba4ac9f262246f545573c5a93b3632e8d57ccd3825ab8b23d9
6
+ metadata.gz: 4673152a1e9b9b220983dfbca1dbaa28e2521054c8a0ba43d32cde906822aa463a3e484ace70300194caa4a9ea9b99cf4ac4e6f2f046000ba66ab1458da4ea2c
7
+ data.tar.gz: ec3027f3c906afeca9c26ef68956d498712a246ed2a925bee5d30b139c4197462d546410d08c5c124d30d7c046faf183d51131b35ef79a805f1be284bb27f3b8
data/Gemfile CHANGED
@@ -5,7 +5,6 @@ gemspec
5
5
 
6
6
  group :test do
7
7
  gem 'rake'
8
- gem 'psych'
9
8
  gem 'rubocop'
10
9
  gem 'guard'
11
10
  gem 'guard-rubocop'
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Rake Cordova
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/cordova-rake.png)](http://badge.fury.io/rb/cordova-rake)
3
+ [![Gem Version](https://badge.fury.io/rb/cordova-rake.svg)](http://badge.fury.io/rb/cordova-rake)
4
+ [![Build Status](https://travis-ci.org/nofxx/cordova-rake.svg?branch=master)](https://travis-ci.org/nofxx/cordova-rake)
5
+ [![Dependency Status](https://gemnasium.com/nofxx/cordova-rake.svg)](https://gemnasium.com/nofxx/cordova-rake)
4
6
 
5
7
  The missing cordova tasks. And the better: On Ruby!
6
8
 
@@ -126,6 +128,9 @@ Or an ENV var 'GOOGLE_KEY'
126
128
 
127
129
  ## Apple | App Store
128
130
 
131
+ Use **fastlane**. Going to add it to rake in next release.
132
+
133
+ https://github.com/KrauseFx/fastlane
129
134
 
130
135
  ### Binaries
131
136
 
data/cordova-rake.gemspec CHANGED
@@ -1,9 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
+ require 'cordova/rake/version'
3
4
 
4
5
  Gem::Specification.new do |s|
5
6
  s.name = 'cordova-rake'
6
- s.version = '0.0.8'
7
+ s.version = Cordova::Rake::VERSION
7
8
  s.platform = Gem::Platform::RUBY
8
9
  s.authors = ['Marcos Piccinini']
9
10
  s.email = ['nofxx@github.com']
@@ -12,8 +13,8 @@ Gem::Specification.new do |s|
12
13
  s.description = 'Rake tasks to help cordova development'
13
14
  s.license = 'MIT'
14
15
 
15
- s.add_dependency('paint', ['>= 1.0.0'])
16
16
  s.add_dependency('tilt', ['>= 2.0.0'])
17
+ s.add_dependency('paint', ['>= 1.0.0'])
17
18
  s.add_dependency('nokogiri', ['>= 1.6.0'])
18
19
 
19
20
  s.files = `git ls-files`.split("\n")
@@ -0,0 +1,6 @@
1
+ module Cordova
2
+ # cordova-rake version
3
+ module Rake
4
+ VERSION = '0.3.0'
5
+ end
6
+ end
@@ -1,12 +1,13 @@
1
1
  desc 'Compiles all resources'
2
- task :compile => [:greet, 'compile:all', :report]
2
+ task compile: [:greet, 'compile:all', :report]
3
3
  desc 'Compiles all resources with ENV=production'
4
- task :release => [:set_release, :compile]
4
+ task release: [:set_release, :compile]
5
5
 
6
6
  task :set_release do
7
7
  @env = 'production'
8
8
  end
9
9
 
10
+ # ERB render wrapper
10
11
  class Erbs < OpenStruct
11
12
  def render(template)
12
13
  ERB.new(template).result(binding)
@@ -16,16 +17,16 @@ end
16
17
  CONFIG_YML = 'config/app.yml'
17
18
 
18
19
  namespace :compile do
19
- task :all => [:js, :css, :html, :vars]
20
+ task all: [:js, :css, :html, :vars]
20
21
 
21
22
  desc 'Compiles Coffee -> JS'
22
- task :js => get_sources(:coffee).ext('.js')
23
+ task js: get_sources(:coffee).ext('.js')
23
24
 
24
25
  desc 'Compiles SASS -> CSS'
25
- task :css => get_sources(:sass).ext('.css')
26
+ task css: get_sources(:sass).ext('.css')
26
27
 
27
28
  desc 'Compiles HAML -> HTML'
28
- task :html => get_sources(:haml).ext('.html')
29
+ task html: get_sources(:haml).ext('.html')
29
30
 
30
31
  desc 'Postcompile ENV variables'
31
32
  task :vars do
@@ -34,19 +35,20 @@ namespace :compile do
34
35
  # STDOUT.puts 'ERB.new(CONFIG_YML).render on www/'
35
36
  [:js, :css, :html].map { |f| get_sources(f, 'www') }.flatten.each do |file|
36
37
  out = Erbs.new(data).render(File.read(file))
37
- File.open(file, 'w') { |f| f << out }
38
+ File.open(file, 'w') { |f| f << out }
38
39
  end
39
40
  end
40
41
 
41
42
  rule '.js' => '.coffee' do |t|
42
- output = File.dirname(t.source).gsub(/app\//, 'www/')
43
+ output = File.dirname(t.source).gsub(%r{app/}, 'www/')
43
44
  # print "CoffeeScript | " # #{t.source} -> #{output}"
44
45
  sh "coffee --no-header -b -o #{output} #{t.source}"
45
46
  end
46
47
 
47
48
  rule '.css' => '.sass' do |t|
48
49
  # print "SASS | #{t.source} -> #{t.name} | "
49
- sh "sass #{t.source} #{t.name.gsub(/app\//, 'www/')}"
50
+ out = t.name.gsub(%r{app/}, 'www/')
51
+ sh "sass #{t.source} #{out}"
50
52
  end
51
53
 
52
54
  rule '.html' => '.haml' do |t|
@@ -54,7 +56,7 @@ namespace :compile do
54
56
  template = Tilt.new(t.source)
55
57
  # => #<Tilt::HAMLTemplate @file="path/to/file.haml" ...>
56
58
 
57
- File.open(t.name.gsub(/app\//, 'www/'), 'w') do |f|
59
+ File.open(t.name.gsub(%r{app/}, 'www/'), 'w') do |f|
58
60
  f.puts layout.render { template.render }
59
61
  end
60
62
  STDOUT.puts "haml #{t.source} -> #{t.name}"
@@ -1,12 +1,11 @@
1
1
  #
2
2
  # Rake / Cordova
3
3
  #
4
-
5
4
  task default: [:compile]
6
5
 
7
6
  task :greet do
8
7
  puts Paint["Cordova Rake [#{env}] #{ENV['CORDOVA_PLATFORMS']}", :red]
9
- puts Paint[" ----", :red]
8
+ puts Paint[' ----', :red]
10
9
  end
11
10
 
12
11
  desc 'Setup env for development'
@@ -17,8 +16,8 @@ task :setup do
17
16
  end
18
17
 
19
18
  task :report do
20
- puts Paint["----", :red]
21
- puts Paint["Rake done! #{format("%.2f", Time.now - START)}s", :black]
19
+ puts Paint['----', :red]
20
+ puts Paint["Rake done! #{format('%.2f', Time.now - START)}s", :black]
22
21
  end
23
22
 
24
23
  desc 'Phonegap Dev App, optional: port.'
@@ -36,10 +35,10 @@ end
36
35
 
37
36
  desc 'Prepare & Ripple emulate'
38
37
  task :guard do
39
- if File.exists?('Guardfile')
40
- puts "Guardfile exists"
38
+ if File.exist?('Guardfile')
39
+ puts 'Guardfile already exists.'
41
40
  else
42
- puts "Creating Guardfile"
41
+ puts 'Creating Guardfile...'
43
42
  FileUtils.cp(File.join(__FILE__, '..', 'templates', 'Guardfile'), '.')
44
43
  end
45
44
  end
@@ -50,12 +49,14 @@ namespace :emulate do
50
49
  sh 'cordova build android'
51
50
  sh "cordova emulate android --target #{ARGV[1]}"
52
51
  end
52
+ task android: :compile
53
53
 
54
54
  desc 'Run on iOS emulator'
55
55
  task :ios do
56
56
  sh 'cordova build ios'
57
57
  sh 'cordova emulate ios'
58
58
  end
59
+ task ios: :compile
59
60
  end
60
61
 
61
62
  namespace :run do
@@ -64,10 +65,12 @@ namespace :run do
64
65
  sh 'cordova build android'
65
66
  sh 'cordova run android'
66
67
  end
68
+ task android: :compile
67
69
 
68
70
  desc 'Run on iOS plugged device or emulator'
69
71
  task :ios do
70
72
  sh 'cordova build ios'
71
73
  sh 'cordova run ios --device'
72
74
  end
75
+ task ios: :compile
73
76
  end
@@ -4,9 +4,9 @@
4
4
  #
5
5
  #
6
6
  def check_file(file)
7
- if File.exists? file
8
- file_size = File.size(file).to_f/(1024 * 1024)
9
- puts Paint["---\nRelease build ok: #{file} #{file_size} Mb", :green]
7
+ if File.exist? file
8
+ file_size = File.size(file).to_f / (1024 * 1024)
9
+ puts Paint["---\nRelease build ok: #{file} #{file_size} MB", :green]
10
10
  else
11
11
  puts Paint["Something BAD! No #{file}!", :red]
12
12
  exit 1
@@ -14,7 +14,7 @@ def check_file(file)
14
14
  end
15
15
 
16
16
  namespace :release do
17
-
17
+ # Make sure we have some dirs
18
18
  task :check_dirs do
19
19
  %w( .keys build ).each do |dir|
20
20
  FileUtils.mkdir dir unless File.exist?(dir)
@@ -25,7 +25,7 @@ namespace :release do
25
25
  task google: [:release, :check_dirs, 'google:all', :report]
26
26
 
27
27
  namespace :google do
28
- task :all => [:clean, :keygen, :archive, :sign, :align, :check, :submit]
28
+ task all: [:clean, :keygen, :archive, :sign, :align, :check, :submit]
29
29
 
30
30
  # desc 'Clean up build folder from apks'
31
31
  task :clean do
@@ -36,12 +36,12 @@ namespace :release do
36
36
  task :keygen do
37
37
  next if File.exist?('.keys/google.keystore')
38
38
  puts Paint["\nGenerate key first!\n\n", :red]
39
- sh "keytool -genkey -v -keystore ./.keys/google.keystore "\
39
+ sh 'keytool -genkey -v -keystore ./.keys/google.keystore '\
40
40
  "-alias '#{app}' -keyalg RSA -keysize 2048 -validity 10000"
41
41
  end
42
42
 
43
43
  task :archive do
44
- sh " cordova build --release android"
44
+ sh ' cordova build --release android'
45
45
  FileUtils.cp 'platforms/android/build/outputs'\
46
46
  '/apk/android-release-unsigned.apk',
47
47
  "build/#{app}-unsigned.apk"
@@ -50,9 +50,9 @@ namespace :release do
50
50
  task :sign do
51
51
  key = ENV['GOOGLE_KEY']
52
52
  key = GOOGLE_KEY if Object.const_defined?(:GOOGLE_KEY)
53
- comm = " jarsigner -verbose -sigalg SHA1withRSA "\
54
- "-digestalg SHA1 -keystore "\
55
- "./.keys/google.keystore 'build/#{app}-unsigned.apk' '#{app}'"
53
+ comm = ' jarsigner -verbose -sigalg SHA1withRSA '\
54
+ '-digestalg SHA1 -keystore '\
55
+ "./.keys/*.keystore 'build/#{app}-unsigned.apk' '#{app}'"
56
56
  comm = "echo '#{key}' | #{comm}" if key
57
57
  sh comm
58
58
  FileUtils.cp "build/#{app}-unsigned.apk", "build/#{app}-signed.apk"
@@ -67,7 +67,8 @@ namespace :release do
67
67
  end
68
68
 
69
69
  task :submit do
70
- #hope we can soon
70
+ # Need to build a gem for this! Soon.
71
+ # Fastlane for Android!
71
72
  end
72
73
  end
73
74
 
@@ -78,7 +79,7 @@ namespace :release do
78
79
  task apple: [:release, :check_dirs, 'apple:all', :report]
79
80
 
80
81
  namespace :apple do
81
- task :all => [:clean, :archive, :ipa, :check] #, :upload]
82
+ task all: [:clean, :archive, :ipa, :check]
82
83
 
83
84
  # desc 'Clean up build folder from apks'
84
85
  task :clean do
@@ -86,7 +87,7 @@ namespace :release do
86
87
  end
87
88
 
88
89
  task :archive do
89
- sh "cordova build --release ios"
90
+ sh 'cordova build --release ios'
90
91
  # xcodebuild -target "#{app}" -sdk "${TARGET_SDK}" -configuration Release
91
92
  end
92
93
 
@@ -94,7 +95,7 @@ namespace :release do
94
95
  provision = Dir['platforms/ios/build/**/*.mobileprovision'].first
95
96
  developer = ENV['APPLE_DEVELOPER']
96
97
  developer = APPLE_DEVELOPER if Object.const_defined?(:APPLE_DEVELOPER)
97
- comm = "xcrun -sdk iphoneos PackageApplication -v "\
98
+ comm = 'xcrun -sdk iphoneos PackageApplication -v '\
98
99
  "'platforms/ios/build/emulator/#{app}.app' -o "\
99
100
  "'#{Rake.original_dir}/build/#{app}.ipa' "
100
101
  comm << "--embed '#{provision}'" if provision
@@ -105,6 +106,5 @@ namespace :release do
105
106
  task :check do
106
107
  check_file("build/#{app}.ipa")
107
108
  end
108
-
109
109
  end
110
110
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cordova-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Piccinini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-17 00:00:00.000000000 Z
11
+ date: 2015-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: paint
14
+ name: tilt
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 2.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: tilt
28
+ name: paint
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0
33
+ version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.0
40
+ version: 1.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -70,6 +70,7 @@ files:
70
70
  - Rakefile
71
71
  - cordova-rake.gemspec
72
72
  - lib/cordova/rake.rb
73
+ - lib/cordova/rake/version.rb
73
74
  - lib/tasks/application.rake
74
75
  - lib/tasks/cordova.rake
75
76
  - lib/tasks/deploy.rake
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  version: '0'
95
96
  requirements: []
96
97
  rubyforge_project:
97
- rubygems_version: 2.4.7
98
+ rubygems_version: 2.4.8
98
99
  signing_key:
99
100
  specification_version: 4
100
101
  summary: Rake tasks to help cordova development