rake-delphi 0.0.31 → 0.0.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 120f3145c1247f66a69729aaaf8c8f9c742618d9
4
- data.tar.gz: 7ecb1e92d74f7e1595fc31f3a3f2f9dc600551bc
3
+ metadata.gz: eca8384876329fb4725a0a2dfe448daeee168868
4
+ data.tar.gz: 05a2efd6373a367c07998bdb8e78e48fb1fc26cb
5
5
  SHA512:
6
- metadata.gz: ef47d87d9b6d9b2c613e0010b7fd5a4150dc3dffb4b8c204c30fa403ef7888ccd72b4b1199089e18bbfc2b09ba957819c4872aa83f0e71b558c8a44f79604b61
7
- data.tar.gz: 2c95206267488640f4036e7c6c032da148b534de29e494ac16a0834e925e9de09af3fd4b6174400cd953af77cc6988f04ee8bec4db5146dd10d7daf866571235
6
+ metadata.gz: 8a7f1a1943b60d27d5f653108f757c54fb257f1b100dea5800d823be5d0f73df7316700c244e25826b889bba4bc9d772f8855adc94ca4e212d5620876fe029c0
7
+ data.tar.gz: 045a1be7b49a0ba772d95866aaf4db51b2c04912968f28bf0147b97dc03166ab3e0cb6e87f06514d5abaf3bf3d0dd953ae422e1035619497ee82aec84882452f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake-delphi (0.0.31)
4
+ rake-delphi (0.0.32)
5
5
  bundler (~> 1.3)
6
6
  inifile
7
7
  rake (~> 10.0.4)
@@ -14,19 +14,16 @@ GEM
14
14
  rubyzip
15
15
  inifile (3.0.0)
16
16
  minitest (4.7.5)
17
- power_assert (0.2.2)
18
17
  rake (10.0.4)
19
18
  rubyzip (0.9.9)
20
- test-unit (3.0.9)
21
- power_assert
22
19
  xml-simple (1.1.5)
23
20
 
24
21
  PLATFORMS
25
22
  ruby
23
+ x86-mingw32
26
24
 
27
25
  DEPENDENCIES
28
26
  apktools
29
27
  minitest (~> 4.3)
30
28
  rake-delphi!
31
29
  rubyzip (~> 0.9.9)
32
- test-unit
@@ -8,7 +8,8 @@ require 'rake/common/chdirtask'
8
8
 
9
9
  module Rake
10
10
  module Delphi
11
- class AndroidManifestInfo
11
+ module Android
12
+ class ManifestInfo
12
13
  attr_accessor :version
13
14
 
14
15
  def initialize(owner)
@@ -26,9 +27,9 @@ module Rake
26
27
  def libname
27
28
  @owner.dccTask.dpr.pathmap('%n')
28
29
  end
29
- end
30
+ end # class ManifestInfo
30
31
 
31
- class AndroidManifestTask < Rake::Task
32
+ class ManifestTask < Rake::Task
32
33
  attr_reader :output, :dccTask
33
34
  public
34
35
  def initialize(name, application)
@@ -36,7 +37,7 @@ module Rake
36
37
  self.needed = false
37
38
  @template = 'AndroidManifest.erb'
38
39
  @output = 'AndroidManifest.xml'
39
- @template_obj = AndroidManifestInfo.new(self)
40
+ @template_obj = ManifestInfo.new(self)
40
41
  end
41
42
 
42
43
  def execute(args = nil)
@@ -56,6 +57,7 @@ module Rake
56
57
  end
57
58
  end
58
59
  end
59
- end # class AndroidManifestTask
60
- end
61
- end
60
+ end # class ManifestTask
61
+ end # module Android
62
+ end # module Delphi
63
+ end # module Rake
@@ -0,0 +1,209 @@
1
+ # encoding: utf-8
2
+ # vim: set shiftwidth=2 tabstop=2 expandtab:
3
+ #
4
+ require 'rake/delphi/dcc32tool'
5
+ require 'rake/helpers/rake'
6
+
7
+ module Rake
8
+ module Delphi
9
+ module Android
10
+ class SDK < Dcc32Tool
11
+ PROPERTIES = {
12
+ :linker => 'NDKArmLinuxAndroidFile',
13
+ :lib => 'DelphiNDKLibraryPath',
14
+ :linker_option => 'DelphiNDKLibraryPath',
15
+ :stripdebug => 'NDKArmLinuxAndroidStripFile',
16
+ :aapt => 'SDKAaptPath',
17
+ :platform => 'SDKApiLevelPath',
18
+ :keystore => nil,
19
+ :zipalign => 'SDKZipAlignPath',
20
+ :jdk_path => 'JDKJarsignerPath'
21
+ }
22
+ REG_KEYS = {::Win32::Registry::HKEY_CURRENT_USER => 'HKCU',
23
+ ::Win32::Registry::HKEY_LOCAL_MACHINE => 'HKLM'}
24
+
25
+ PROPERTIES.keys.each do |prop|
26
+ attr_accessor prop
27
+ end
28
+
29
+ def initialize
30
+ super(false)
31
+ read_properties
32
+ end
33
+
34
+ def read_default_config
35
+ begin
36
+ require 'win32/registry'
37
+ [::Win32::Registry::HKEY_CURRENT_USER, \
38
+ ::Win32::Registry::HKEY_LOCAL_MACHINE].each do |regRoot|
39
+ begin
40
+ key = 'Default_Android'
41
+ Logger.trace(Logger::DEBUG, "Finding #{REG_KEYS[regRoot]}\\#{@platform_SDKs}\\#{key}")
42
+ regRoot.open(@platform_SDKs) do |reg|
43
+ reg_typ, reg_val = reg.read(key)
44
+ Logger.trace(Logger::DEBUG, "Found '#{reg_val}'")
45
+ return reg_val
46
+ end
47
+ rescue ::Win32::Registry::Error
48
+ Logger.trace(Logger::DEBUG, "No reg key '#{regRoot}'?!")
49
+ end
50
+ end
51
+ return nil
52
+ rescue LoadError
53
+ Logger.trace(Logger::DEBUG, 'No `win32/registry` gem?!')
54
+ return nil
55
+ end
56
+ end
57
+
58
+ def read_properties
59
+ @platform_SDKs = @@regroot + '\\PlatformSDKs'
60
+ default_android = read_default_config
61
+ return unless default_android
62
+ reg_default = @platform_SDKs + '\\' + default_android
63
+ begin
64
+ require 'win32/registry'
65
+ PROPERTIES.each do |prop, reg_key|
66
+ next unless reg_key
67
+ # current user values have precedence over local machine
68
+ [::Win32::Registry::HKEY_CURRENT_USER, \
69
+ ::Win32::Registry::HKEY_LOCAL_MACHINE].each do |regRoot|
70
+ begin
71
+ Logger.trace(Logger::DEBUG, "Finding '#{reg_key}' for '#{prop}' in '#{REG_KEYS[regRoot]}\\#{reg_default}'")
72
+ regRoot.open(reg_default) do |reg|
73
+ reg_typ, reg_val = reg.read(reg_key)
74
+ Logger.trace(Logger::DEBUG, "Value=#{reg_val}")
75
+ send "#{prop}=", reg_val
76
+ end
77
+ # if value found (in CU) there is no reason to search in LM
78
+ break
79
+ rescue ::Win32::Registry::Error
80
+ Logger.trace(Logger::DEBUG, "No reg key '#{regRoot}'?!")
81
+ end
82
+ end
83
+ end
84
+ rescue LoadError
85
+ Logger.trace(Logger::DEBUG, 'No `win32/registry` gem?!')
86
+ end
87
+ end
88
+
89
+ def lib=(value)
90
+ @lib, null = value.split(';', 2)
91
+ end
92
+
93
+ def linker_option=(value)
94
+ null, @linker_option = value.split(';', 2)
95
+ @linker_option = ' -L \"' + @linker_option + '\"'
96
+ end
97
+
98
+ def linker
99
+ @linker = ENV['DELPHI_ANDROID_SDK_LINKER'] || @linker
100
+ warn "Please, define DELPHI_ANDROID_SDK_LINKER environment variable.\n Otherwise you may get 'File not found: ldandroid.exe' error" unless @linker
101
+ @linker
102
+ end
103
+
104
+ def lib
105
+ @lib = ENV['DELPHI_ANDROID_SDK_LIBPATH'] || @lib
106
+ warn 'Please, define DELPHI_ANDROID_SDK_LIBPATH environment variable' unless @lib
107
+ @lib
108
+ end
109
+
110
+ def linker_option
111
+ @linker_option = ENV['DELPHI_ANDROID_SDK_LINKER_OPTION'] || @linker_option
112
+ warn 'Please, define DELPHI_ANDROID_SDK_LINKER_OPTION environment variable' unless @linker_option
113
+ @linker_option
114
+ end
115
+
116
+ def stripdebug
117
+ @stripdebug = ENV['DELPHI_ANDROID_SDK_STRIPDEBUG'] || @stripdebug
118
+ warn 'Please, set DELPHI_ANDROID_SDK_STRIPDEBUG to path where arm-linux-androideabi-strip.exe is located' unless @stripdebug
119
+ @stripdebug
120
+ end
121
+
122
+ def aapt
123
+ @aapt = ENV['DELPHI_ANDROID_SDK_BUILD_TOOLS_PATH'] || @aapt
124
+ warn 'Please, set DELPHI_ANDROID_SDK_BUILD_TOOLS_PATH to path where aapt.exe is located' unless @aapt
125
+ @aapt
126
+ end
127
+
128
+ def platform
129
+ @platform = ENV['DELPHI_ANDROID_SDK_PLATFORM_PATH'] || @platform
130
+ warn 'Please, set DELPHI_ANDROID_SDK_PLATFORM_PATH to the path where android.jar is located' unless @platform
131
+ @platform
132
+ end
133
+
134
+ def keystore
135
+ @keystore = ENV['DELPHI_ANDROID_KEYSTORE'] || @keystore
136
+ warn 'Please, set DELPHI_ANDROID_KEYSTORE to the path where a keystore (to sign an application) is located' unless @keystore
137
+ @keystore
138
+ end
139
+
140
+ def zipalign
141
+ @zipalign = ENV['DELPHI_ANDROID_SDK_PLATFORM_TOOLS'] || @zipalign
142
+ warn 'Please, set DELPHI_ANDROID_SDK_PLATFORM_TOOLS to the path where zipalign.exe is located' unless @zipalign
143
+ @zipalign
144
+ end
145
+ end # class SDK
146
+
147
+ class DCC32SDKOptions < SDK
148
+ def dcc32options
149
+ opts = []
150
+ opts << '-TX.so'
151
+ opts << "--linker:\"#{linker}\""
152
+ opts << "--libpath:\"#{lib}\""
153
+ opts << "--linker-option:\"#{linker_option}\""
154
+ opts
155
+ end
156
+ end # class DCC32SDKOptions
157
+
158
+ class PAClientSDKOptions < SDK
159
+ def stripdebug
160
+ stripdebug = super
161
+ return Rake.quotepath('', stripdebug.to_s)
162
+ end
163
+
164
+ def aapt
165
+ aapt = super
166
+ aapt = aapt.to_s + '\\aapt.exe' unless aapt.to_s.match(/aapt\.exe$/i)
167
+ aapt = Rake.quotepath('', aapt)
168
+ end
169
+
170
+ def jar
171
+ jar = platform.to_s + '\\android.jar'
172
+ jar = Rake.quotepath('', jar)
173
+ end
174
+
175
+ def zipalign
176
+ zip_align = super
177
+ zip_align = zip_align.to_s + '\\zipalign.exe' unless zip_align.to_s.match(/zipalign\.exe$/i)
178
+ zip_align = Rake.quotepath('', zip_align)
179
+ end
180
+ end # class PAClientSDKOptions
181
+
182
+ class JavaSDK < SDK
183
+ def path
184
+ @jdk_path = ENV['JAVA_SDK_PATH'] || @jdk_path
185
+ warn 'Please, set JAVA_SDK_PATH to the path where jarsigner.exe is located' unless @jdk_path
186
+ @jdk_path
187
+ end
188
+
189
+ def jarsigner
190
+ jarsigner = path.to_s
191
+ jarsigner += '\\jarsigner.exe' unless jarsigner.match(/jarsigner\.exe$/i)
192
+ return Rake.quotepath('', jarsigner)
193
+ end
194
+
195
+ def keystore
196
+ key_store = super
197
+ key_store = Rake.quotepath('', key_store.to_s.double_delimiters)
198
+ end
199
+
200
+ def keystore_params
201
+ key_store_params = ENV['DELPHI_ANDROID_KEYSTORE_PARAMS']
202
+ warn 'Please, set DELPHI_ANDROID_KEYSTORE_PARAMS to alias,method,keystore_password,key_password' unless key_store_params
203
+ key_alias, key_params = key_store_params.to_s.split(',', 2)
204
+ return [key_alias, key_params]
205
+ end
206
+ end # class JavaSDK
207
+ end # module Android
208
+ end # module Delphi
209
+ end # module Rake
@@ -2,6 +2,7 @@
2
2
  # encoding: utf-8
3
3
 
4
4
  require 'rake/delphi/dcc32tool'
5
+ require 'rake/delphi/android/sdk'
5
6
 
6
7
  module Rake
7
8
  module Delphi
@@ -11,19 +12,8 @@ module Rake
11
12
  end
12
13
 
13
14
  def options
14
- opts = []
15
- linker_path = ENV['DELPHI_ANDROID_SDK_LINKER']
16
- warn "Please, define DELPHI_ANDROID_SDK_LINKER environment variable.\n Otherwise you may get 'File not found: ldandroid.exe' error" unless linker_path
17
- lib_path = ENV['DELPHI_ANDROID_SDK_LIBPATH']
18
- warn 'Please, define DELPHI_ANDROID_SDK_LIBPATH environment variable' unless lib_path
19
- linker_option = ENV['DELPHI_ANDROID_SDK_LINKER_OPTION']
20
- warn 'Please, define DELPHI_ANDROID_SDK_LINKER_OPTION environment variable' unless linker_option
21
- opts << '-TX.so'
22
- opts << "--linker:\"#{linker_path}\""
23
- opts << "--libpath:\"#{lib_path}\""
24
- opts << "--linker-option:\"#{linker_option}\""
25
- return opts
15
+ return Android::DCC32SDKOptions.new.dcc32options
26
16
  end
27
- end
28
- end
29
- end
17
+ end # class DccARMTool
18
+ end # module Delphi
19
+ end # moddule Rake
@@ -9,7 +9,8 @@ require 'rake/helpers/raketask'
9
9
  require 'rake/helpers/string'
10
10
  require 'rake/common/chdirtask'
11
11
  require 'rake/delphi/paclienttool'
12
- require 'rake/delphi/androidmanifest'
12
+ require 'rake/delphi/android/manifest'
13
+ require 'rake/delphi/android/sdk'
13
14
 
14
15
  module Rake
15
16
  module Delphi
@@ -24,7 +25,7 @@ module Rake
24
25
  super
25
26
  @last_put_arg_index = 0
26
27
  @suffix = 'AndroidPackage'
27
- @manifest = application.define_task(AndroidManifestTask, shortname + ':manifest')
28
+ @manifest = application.define_task(Android::ManifestTask, shortname + ':manifest')
28
29
  enhance([@manifest])
29
30
  self.needed = false
30
31
  dccTaskName = name.gsub(/:post$/, '')
@@ -118,9 +119,7 @@ module Rake
118
119
  end
119
120
 
120
121
  def get_stripdebug_arg(paclientTool)
121
- stripdebug_path = ENV['DELPHI_ANDROID_SDK_STRIPDEBUG']
122
- warn 'Please, set DELPHI_ANDROID_SDK_STRIPDEBUG to path where arm-linux-androideabi-strip.exe is located' unless stripdebug_path
123
- stripdebug_path = Rake.quotepath('', stripdebug_path.to_s)
122
+ stripdebug_path = Android::PAClientSDKOptions.new.stripdebug
124
123
  output_dest = find_project_so(@deploymentfiles).dup
125
124
  output = @dccTask.exeoutput + '\\' + output_dest.last
126
125
  # remove '1' string
@@ -148,10 +147,8 @@ module Rake
148
147
  def get_aaptpackage_arg(paclientTool)
149
148
  output = @dccTask.exeoutput
150
149
  output_platform = File.expand_path2(output, '-u')
151
- apt_path = ENV['DELPHI_ANDROID_SDK_BUILD_TOOLS_PATH']
152
- warn 'Please, set DELPHI_ANDROID_SDK_BUILD_TOOLS_PATH to path where aapt.exe is located' unless apt_path
153
- apt_path = apt_path.to_s + '\\aapt.exe'
154
- apt_path = Rake.quotepath('', apt_path)
150
+ paclient_options = Android::PAClientSDKOptions.new
151
+ apt_path = paclient_options.aapt
155
152
  args = [apt_path.double_delimiters]
156
153
  args += aapt_args.map do |a|
157
154
  to_mkdir = false
@@ -159,10 +156,7 @@ module Rake
159
156
  if a == :output
160
157
  a = unsigned_path
161
158
  elsif a == :jar
162
- platform = ENV['DELPHI_ANDROID_SDK_PLATFORM_PATH']
163
- warn 'Please, set DELPHI_ANDROID_SDK_PLATFORM_PATH to the path where android.jar is located' unless platform
164
- a = platform.to_s + '\\android.jar'
165
- a = Rake.quotepath('', a)
159
+ a = paclient_options.jar
166
160
  out = false
167
161
  else
168
162
  if a.kind_of?(Symbol)
@@ -188,24 +182,19 @@ module Rake
188
182
  end
189
183
 
190
184
  def get_jarsign_arg(paclientTool)
191
- jdk_path = ENV['JAVA_SDK_PATH']
192
- warn 'Please, set JAVA_SDK_PATH to the path where jarsigner.exe is located' unless jdk_path
193
- args = [Rake.quotepath('', jdk_path.to_s + '\\jarsigner.exe')]
185
+ args = []
186
+ java_sdk = Android::JavaSDK.new
187
+ args << java_sdk.jarsigner
194
188
  args << unsigned_path(true).double_delimiters
195
- key_store = ENV['DELPHI_ANDROID_KEYSTORE']
196
- warn 'Please, set DELPHI_ANDROID_KEYSTORE to the path where keystore (to sign application) located' unless key_store
197
- key_store = Rake.quotepath('', key_store.double_delimiters)
198
- key_store_params = ENV['DELPHI_ANDROID_KEYSTORE_PARAMS']
199
- warn 'Please, set DELPHI_ANDROID_KEYSTORE_PARAMS to alias,method,keystore_password,key_password' unless key_store_params
200
- key_alias, key_params = key_store_params.split(',', 2)
189
+ key_store = java_sdk.keystore
190
+ key_alias, key_params = java_sdk.keystore_params
201
191
  args << key_alias << key_store << key_params
202
192
  return args.join(',')
203
193
  end
204
194
 
205
195
  def get_zipalign_arg(paclientTool)
206
- zip_align = ENV['DELPHI_ANDROID_SDK_PLATFORM_TOOLS']
207
- warn 'Please, set DELPHI_ANDROID_SDK_PLATFORM_TOOLS to the path where zipalign.exe is located' unless zip_align
208
- args = [Rake.quotepath('', zip_align.to_s + '\\zipalign.exe')]
196
+ args = []
197
+ args << Android::PAClientSDKOptions.new.zipalign
209
198
  args << unsigned_path(true).double_delimiters
210
199
  zip_aligned_out = @dccTask.exeoutput + '\\' + @suffix + '\\' + @dccTask.dpr.pathmap('%n.apk')
211
200
  zip_aligned_out_platform = File.expand_path2(zip_aligned_out, '-u')
@@ -19,13 +19,13 @@ module Rake
19
19
  EmbarcaderoRegRoot = 'SOFTWARE\\Embarcadero\\BDS'
20
20
 
21
21
  def self.reinit
22
- @@version, @@delphidir, @@toolpath = nil, nil, nil
22
+ @@version, @@delphidir, @@toolpath, @@regroot = nil, nil, nil, nil
23
23
  end
24
24
 
25
25
  reinit
26
26
 
27
27
  def initialize(checkExistance = false)
28
- @@version, @@delphidir, @@toolpath = self.class.find(checkExistance) unless @@version
28
+ @@version, @@delphidir, @@toolpath, @@regroot = self.class.find(checkExistance) unless @@version
29
29
  end
30
30
 
31
31
  def self.toolName
@@ -44,6 +44,10 @@ module Rake
44
44
  @@delphidir
45
45
  end
46
46
 
47
+ def regroot
48
+ @@regroot
49
+ end
50
+
47
51
  def options
48
52
  ''
49
53
  end
@@ -114,18 +118,19 @@ module Rake
114
118
  ::Win32::Registry::HKEY_CURRENT_USER].each do |regRoot|
115
119
  begin
116
120
  Logger.trace(Logger::DEBUG, "Finding Delphi dir for #{ver}")
117
- regRoot.open(rootForVersion(ver)) do |reg|
121
+ reg_root = rootForVersion(ver)
122
+ regRoot.open(reg_root) do |reg|
118
123
  reg_typ, reg_val = reg.read('RootDir')
119
- return reg_val.unix2dos_separator
124
+ return reg_val.unix2dos_separator, reg_root
120
125
  end
121
126
  rescue ::Win32::Registry::Error
122
127
  Logger.trace(Logger::DEBUG, "No reg key '#{regRoot}'?!")
123
128
  end
124
129
  end
125
- return nil
130
+ return nil, nil
126
131
  rescue LoadError
127
132
  Logger.trace(Logger::DEBUG, 'No `win32/registry` gem?!')
128
- return nil
133
+ return nil, nil
129
134
  end
130
135
  end
131
136
 
@@ -137,7 +142,7 @@ module Rake
137
142
  ENV['DELPHI_DIR'] = ENV['DELPHI_DIR'].gsub(/[^\/]$/, '\&/')
138
143
  tool = ENV['DELPHI_DIR'] + toolName
139
144
  checkToolFailure(tool) if failIfNotFound
140
- return v, ENV['DELPHI_DIR'], tool
145
+ return v, ENV['DELPHI_DIR'], tool, ENV['DELPHI_REG_ROOT']
141
146
  end
142
147
  if v.to_s.empty?
143
148
  v = []
@@ -149,7 +154,7 @@ module Rake
149
154
  end
150
155
  tool_was_found = false
151
156
  v.each do |ver|
152
- path = readDelphiDir(ver)
157
+ path, regroot = readDelphiDir(ver)
153
158
  next unless path
154
159
  tool = path + toolName
155
160
  tool_was_found = true
@@ -157,8 +162,9 @@ module Rake
157
162
  if File.exists?(tool) # found it !
158
163
  ENV['DELPHI_VERSION'] = ver
159
164
  ENV['DELPHI_DIR'] = path
160
- Logger.trace(Logger::DEBUG, "Set: DELPHI_VERSION=#{ver}; DELPHI_DIR='#{path}'")
161
- return ver, path, tool
165
+ ENV['DELPHI_REG_ROOT'] = regroot
166
+ Logger.trace(Logger::DEBUG, "Set: DELPHI_VERSION=#{ver}; DELPHI_DIR='#{path}'; DELPHI_REG_ROOT='#{regroot}'")
167
+ return ver, path, tool, regroot
162
168
  else
163
169
  Logger.trace(Logger::DEBUG, 'But file does not exist!')
164
170
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rake
4
4
  module Delphi
5
- VERSION = '0.0.31'
5
+ VERSION = '0.0.32'
6
6
  end
7
7
  end
@@ -1,17 +1,15 @@
1
1
  # encoding: utf-8
2
+ # vim: set shiftwidth=2 tabstop=2 expandtab:
2
3
 
3
- require 'test/unit'
4
+ require 'minitest/unit'
4
5
 
5
- # Ruby 1.9 uses "minitest". There is no `name` property there
6
- if defined? MiniTest::Unit::TestCase && Test::Unit::TestCase < MiniTest::Unit::TestCase
7
- module Test
8
- module Unit
9
- class TestCase
10
- def name
11
- __name__
12
- end unless instance_methods.include?(:name)
13
- end
14
- end
6
+ # MiniTest::Unit::TestCase have no `name` property
7
+ module MiniTest
8
+ class Unit
9
+ class TestCase
10
+ def name
11
+ __name__
12
+ end unless instance_methods.include?(:name)
15
13
  end
14
+ end
16
15
  end
17
-
data/rake-delphi.gemspec CHANGED
@@ -32,10 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.add_runtime_dependency "rake", "~> 10.0.4"
33
33
  spec.add_runtime_dependency "xml-simple"
34
34
  spec.add_runtime_dependency "inifile"
35
- # Ruby 2.2 have no `test-unit` gem in stdlib
36
- if (Gem::Version.new(RUBY_VERSION) <=> Gem::Version.new('2.2')) >= 0
37
- spec.add_development_dependency "test-unit"
38
- end
39
35
  spec.add_development_dependency "minitest", "~> 4.3"
40
36
  spec.add_development_dependency "rubyzip", "~> 0.9.9"
41
37
  spec.add_development_dependency "apktools"
@@ -1,5 +1,5 @@
1
1
  require 'fileutils'
2
- require 'test/unit'
2
+ require 'minitest/autorun'
3
3
  require 'helpers/consts'
4
4
  require 'rake/delphi/envvariables'
5
5
 
@@ -16,7 +16,7 @@ end
16
16
 
17
17
  module DelphiTests
18
18
 
19
- class TestVerInfo < Test::Unit::TestCase
19
+ class TestVerInfo < MiniTest::Unit::TestCase
20
20
  DPROJ_VERSIONS = { '10' => '2006.bdsproj', '11' => '2007.dproj', \
21
21
  '13' => '2010.dproj', '18' => 'xe5.dproj',
22
22
  '21' => 'xe7.dproj' }
@@ -40,7 +40,7 @@ protected
40
40
 
41
41
  def _test_deploy_files(deploymentfiles, tested_deploymentFiles)
42
42
  assert deploymentfiles.kind_of?(Array), 'NOT an Array?!'
43
- assert_not_equal 0, deploymentfiles.size, 'No files?!'
43
+ refute_equal 0, deploymentfiles.size, 'No files?!'
44
44
 
45
45
  dfiles = []
46
46
  deploymentfiles.each do |dfile|
@@ -31,6 +31,7 @@ namespace :test do
31
31
  task :prepare, :useresources, :options do |t, opts|
32
32
  _task = Rake::Task['test:compile']
33
33
  dpr = Rake.application.define_task(Rake::Delphi::Project, (_task.name + ':delphi').to_sym)
34
+ dpr[:quiet] = true
34
35
  dpr[:resources_additional] = []
35
36
  dpr[:resources_additional] << 'resources' if opts[:useresources]
36
37
  dpr[:resources_additional] << 'resources_ext:extended_resources.dres' if opts[:useresources] === 'ext'
@@ -37,13 +37,13 @@ BEGIN
37
37
  BLOCK "041904E3"
38
38
  BEGIN
39
39
  VALUE "CompanyName", "Rake\0"
40
- VALUE "FileDescription", "Test rake-delphi project 2006 description\0"
40
+ VALUE "FileDescription", "Test rake-delphi project XE7 description\0"
41
41
  VALUE "FileVersion", "0.0.0.0\0"
42
42
  VALUE "InternalName", "testproject.exe\0"
43
43
  VALUE "LegalCopyright", "Copyright. ��������\0"
44
44
  VALUE "LegalTrademarks", "Trademark. �������� �����\0"
45
45
  VALUE "OriginalFilename", "testproject.exe\0"
46
- VALUE "ProductName", "Test rake-delphi project 2006 product name\0"
46
+ VALUE "ProductName", "Test rake-delphi project XE7 product name\0"
47
47
  VALUE "ProductVersion", "1.2.3.4\0"
48
48
  VALUE "Comments", "Test project comment\0"
49
49
  #ifdef DEBUG
@@ -29,6 +29,7 @@ module TestAndroidModule
29
29
  fail 'Cannot compile this project with Delphi below XE5' if Rake::Delphi::EnvVariables.delphi_version < Rake::Delphi::DELPHI_VERSION_XE5
30
30
  _task = Rake::Task['test_android:compile']
31
31
  dpr = Rake.application.define_task(Rake::Delphi::Project, (_task.name + ':delphi').to_sym)
32
+ dpr[:quiet] = true
32
33
  dpr[:resources_additional] = 'resources' if opts[:useresources]
33
34
  dpr[:platform_configuration] = 'Debug'
34
35
  dpr[:platform] = 'Android32'
@@ -0,0 +1,8 @@
1
+ -U"."
2
+ -I"."
3
+ -R"."
4
+ -O"."
5
+ -U"./lib/AnyLib"
6
+ -I"./lib/AnyLib"
7
+ -R"./lib/AnyLib"
8
+ -O"./lib/AnyLib"
@@ -298,7 +298,7 @@
298
298
  </DeployFile>
299
299
  <DeployFile LocalName="c:\program files (x86)\embarcadero\rad studio\15.0\lib\android\debug\classes.dex" Configuration="Debug" Class="AndroidClassesDexFile">
300
300
  <Platform Name="Android">
301
- <RemoteName>classes.dex</RemoteName>
301
+ <RemoteName>classes.debug.dex</RemoteName>
302
302
  </Platform>
303
303
  </DeployFile>
304
304
  <DeployFile LocalName="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png" Configuration="Debug" Class="Android_LauncherIcon48">
@@ -3,7 +3,6 @@
3
3
 
4
4
  require 'rake'
5
5
  require 'fileutils'
6
- require 'test/unit'
7
6
  require 'rake/delphi/dccaarmtool'
8
7
  require 'rake/delphi/envvariables'
9
8
  require 'rake/helpers/unittest'
@@ -28,7 +27,7 @@ module DelphiAndroidTests
28
27
  META-INF/ANDROIDD.RSA
29
28
  lib/armeabi/libTestProject.so
30
29
  AndroidManifest.xml
31
- classes.dex
30
+ classes.debug.dex
32
31
  resources.arsc
33
32
  res/drawable-hdpi/ic_launcher.png
34
33
  res/drawable-ldpi/ic_launcher.png
@@ -15,7 +15,7 @@ module DelphiAndroidTests
15
15
  super
16
16
  @required_files << 'assets/internal/module.ext'
17
17
  @required_files << 'assets/internal/predefined.db'
18
- @required_files << 'lib/mips/libTestProject.so'
18
+ @required_files << 'lib/mips/libTestProject.debug.so'
19
19
  end
20
20
  end
21
21
 
data/test/test-delphi.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'rake'
4
4
  require 'fileutils'
5
- require 'test/unit'
6
5
  require 'rake/delphi'
7
6
  require 'rake/delphi/project'
8
7
  require 'rake/delphi/tool'
@@ -164,17 +163,15 @@ public
164
163
  end
165
164
  end
166
165
 
167
- class TestCustomDelphiTool < Test::Unit::TestCase
166
+ class TestCustomDelphiTool < MiniTest::Unit::TestCase
168
167
  private
169
168
  public
170
169
  def test_checkToolFailure
171
- assert_nothing_raised RuntimeError do
172
- Rake::Delphi::CustomDelphiTool.checkToolFailure(__FILE__)
173
- end
170
+ Rake::Delphi::CustomDelphiTool.checkToolFailure(__FILE__)
174
171
  end
175
172
 
176
173
  def test_checkToolFailure_failure
177
- assert_raise RuntimeError do
174
+ assert_raises RuntimeError do
178
175
  Rake::Delphi::CustomDelphiTool.checkToolFailure(__FILE__ + '.ext')
179
176
  end
180
177
  end
@@ -192,7 +189,7 @@ end
192
189
 
193
190
  end
194
191
 
195
- class TestRCResourceCompiler < Test::Unit::TestCase
192
+ class TestRCResourceCompiler < MiniTest::Unit::TestCase
196
193
  private
197
194
  public
198
195
  def setup
data/test/test-echo.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
4
+ require 'minitest/autorun'
5
5
  require 'rake/common/echotask'
6
6
  require 'rake/helpers/unittest'
7
7
 
8
- class TestEchoToFileTask < Test::Unit::TestCase
8
+ class TestEchoToFileTask < MiniTest::Unit::TestCase
9
9
  private
10
10
  def file_in
11
11
  return @file_in ||= File.expand_path('../resources/echo/file.in', __FILE__)
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
4
+ require 'minitest/autorun'
5
5
  require 'rake/delphi/envvariables'
6
6
  require 'rake/helpers/unittest'
7
7
 
8
- class TestEnvVariables < Test::Unit::TestCase
8
+ class TestEnvVariables < MiniTest::Unit::TestCase
9
9
 
10
10
  def setup
11
11
  ENV['BDS_PLATFORM'] = 'BDS platform'
@@ -23,7 +23,7 @@ class TestEnvVariables < Test::Unit::TestCase
23
23
 
24
24
  env_vars['BDS_PLATFORM_CASE_2'] = 'BDS Platform Case 2'
25
25
  # be sure there is no BDS_Platform_Case_2 defined
26
- assert_not_equal('BDS Platform Case 2', env_vars['BDS_Platform_Case_2'])
26
+ refute_equal('BDS Platform Case 2', env_vars['BDS_Platform_Case_2'])
27
27
  # also freeze string (ENV vars are frozen strings)
28
28
  assert_equal('Platform: BDS Platform Case 2', env_vars.expand('Platform: $(BDS_Platform_Case_2)'.freeze))
29
29
  end
@@ -1,9 +1,9 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'test/unit'
3
+ require 'minitest/autorun'
4
4
  require 'rake/helpers/gemversion'
5
5
 
6
- class TestVersionImproved < Test::Unit::TestCase
6
+ class TestVersionImproved < MiniTest::Unit::TestCase
7
7
  public
8
8
  def setup
9
9
  end
data/test/test-git.rb CHANGED
@@ -1,13 +1,13 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
4
+ require 'minitest/autorun'
5
5
  require 'fileutils'
6
6
  require 'rake/common/chdirtask'
7
7
  require 'rake/common/git'
8
8
  require 'rake/helpers/unittest'
9
9
 
10
- class CustomTestGit < Test::Unit::TestCase
10
+ class CustomTestGit < MiniTest::Unit::TestCase
11
11
  private
12
12
  def init_test_dit_dir
13
13
  @test_git_dir = File.expand_path('../tmp', __FILE__)
@@ -126,7 +126,7 @@ public
126
126
 
127
127
  def test_changelog_processed_not_a_hash_string
128
128
  @opts.merge!({ :process => 'added'})
129
- assert_raise RuntimeError do
129
+ assert_raises RuntimeError do
130
130
  Rake::Delphi::ChDir.new(@rake_task, @test_git_dir) do
131
131
  chlog = Rake::Delphi::GitChangelog.new(@rake_task, @opts)
132
132
  end
@@ -135,7 +135,7 @@ public
135
135
 
136
136
  def test_changelog_processed_not_a_hash_array
137
137
  @opts.merge!({ :process => [['added']] })
138
- assert_raise RuntimeError do
138
+ assert_raises RuntimeError do
139
139
  Rake::Delphi::ChDir.new(@rake_task, @test_git_dir) do
140
140
  chlog = Rake::Delphi::GitChangelog.new(@rake_task, @opts)
141
141
  end
data/test/test-hashes.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
4
+ require 'minitest/autorun'
5
5
  require 'rake/common/hashtask'
6
6
  require 'rake/helpers/unittest'
7
7
 
8
- class CustomTestHashTask < Test::Unit::TestCase
8
+ class CustomTestHashTask < MiniTest::Unit::TestCase
9
9
  private
10
10
  def _file
11
11
  return @file ||= File.expand_path('../resources/hashes/hash.file', __FILE__)
data/test/test-ini.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
4
+ require 'minitest/autorun'
5
5
  require 'rake/common/initask'
6
6
  require 'rake/helpers/unittest'
7
7
 
8
- class TestIniProperty < Test::Unit::TestCase
8
+ class TestIniProperty < MiniTest::Unit::TestCase
9
9
  private
10
10
  def _file
11
11
  return @file ||= File.expand_path('../resources/ini/file.ini', __FILE__)
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
4
+ require 'minitest/autorun'
5
5
  require 'rake/common/libstask'
6
6
  require 'rake/helpers/unittest'
7
7
 
8
- class TestLibsTask < Test::Unit::TestCase
8
+ class TestLibsTask < MiniTest::Unit::TestCase
9
9
  private
10
10
  def _dir
11
11
  return @dir ||= File.expand_path('../resources/libstask/', __FILE__)
@@ -27,9 +27,9 @@ public
27
27
  assert_equal('test-libs-task-test_define', task2.name)
28
28
  end
29
29
  # already invoked
30
- assert_not_equal(nil, task2.libs)
30
+ refute_equal(nil, task2.libs)
31
31
  # not empty
32
- assert_not_equal([], task2.libs)
32
+ refute_equal([], task2.libs)
33
33
  end
34
34
 
35
35
  def test_libs_relative_not_executed
@@ -2,7 +2,6 @@
2
2
  # vim: set shiftwidth=2 tabstop=2 expandtab:
3
3
 
4
4
  require 'rake'
5
- require 'test/unit'
6
5
  require 'rake/delphi'
7
6
  require 'rake/delphi/projectinfo'
8
7
  require 'rake/delphi/dcc32'
@@ -64,7 +63,7 @@ module DelphiAndroidTests
64
63
  tested_deploymentFiles << '$(BDS)\bin\Artwork\Android\FM_LauncherIcon_%dx%d.png,res\drawable-%sdpi\,1,ic_launcher.png' % [n, n, tested_deploymentFiles_prefixes[n]]
65
64
  end
66
65
  tested_deploymentFiles << 'project_so,library\lib\armeabi\,1,libTestProject.so'
67
- tested_deploymentFiles << '$(BDS)\lib\android\debug\classes.dex,classes\,1,classes.dex'
66
+ tested_deploymentFiles << '$(BDS)\lib\android\debug\classes.dex,classes\,1,classes.debug.dex'
68
67
  tested_deploymentFiles << 'external\module.ext,.\assets\internal\\\\,1,'
69
68
  tested_deploymentFiles << 'external\predefined.db,.\assets\internal\\\\,1,'
70
69
  tested_deploymentFiles << '$(BDS)\lib\android\debug\mips\libnative-activity.so,library\lib\mips\,1,libTestProject.debug.so'
@@ -2,7 +2,6 @@
2
2
  # vim: set shiftwidth=2 tabstop=2 expandtab:
3
3
 
4
4
  require 'rake'
5
- require 'test/unit'
6
5
  require 'rake/delphi'
7
6
  require 'rake/delphi/projectinfo'
8
7
  require 'rake/delphi/dcc32'
@@ -1,7 +1,6 @@
1
1
  # encoding: Windows-1251
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
5
4
  require 'rake/delphi'
6
5
  require 'rake/delphi/projectinfo'
7
6
  require 'rake/delphi/dcc32'
data/test/test-string.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
4
+ require 'minitest/autorun'
5
5
  require 'rake/helpers/unittest'
6
6
  require 'rake/helpers/string'
7
7
 
8
- class TestString < Test::Unit::TestCase
8
+ class TestString < MiniTest::Unit::TestCase
9
9
  def test_prepend
10
10
  assert_equal('prefix_a', 'a'.prepend('prefix_'))
11
11
  end
data/test/test-zip.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'rake'
4
- require 'test/unit'
4
+ require 'minitest/autorun'
5
5
  require 'rake/common/ziptask'
6
6
  require 'rake/helpers/unittest'
7
7
 
8
- class TestZipTask < Test::Unit::TestCase
8
+ class TestZipTask < MiniTest::Unit::TestCase
9
9
  private
10
10
  public
11
11
  def setup
@@ -15,14 +15,14 @@ public
15
15
  end
16
16
 
17
17
  def test_zip_no_filename
18
- assert_raise RuntimeError do
18
+ assert_raises RuntimeError do
19
19
  # second argument must be non-empty
20
20
  Rake::Delphi::ZipTask.new(@rake_task, nil, nil)
21
21
  end
22
22
  end
23
23
 
24
24
  def test_zip_empty_filename
25
- assert_raise RuntimeError do
25
+ assert_raises RuntimeError do
26
26
  # second argument must be non-empty
27
27
  Rake::Delphi::ZipTask.new(@rake_task, '', nil)
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-delphi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Shumkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: test-unit
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: minitest
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +133,8 @@ files:
147
133
  - lib/rake/common/sendmailtask.rb
148
134
  - lib/rake/common/ziptask.rb
149
135
  - lib/rake/delphi.rb
150
- - lib/rake/delphi/androidmanifest.rb
136
+ - lib/rake/delphi/android/manifest.rb
137
+ - lib/rake/delphi/android/sdk.rb
151
138
  - lib/rake/delphi/dcc32.rb
152
139
  - lib/rake/delphi/dcc32tool.rb
153
140
  - lib/rake/delphi/dccaarmtool.rb
@@ -189,6 +176,7 @@ files:
189
176
  - test/resources/testproject-android/ExplicitLib/ExplicitLibUnit.pas
190
177
  - test/resources/testproject-android/Rakefile.rb
191
178
  - test/resources/testproject-android/TestProject.cfg
179
+ - test/resources/testproject-android/TestProject.cfg.1
192
180
  - test/resources/testproject-android/TestProject.dpr
193
181
  - test/resources/testproject-android/TestProject.rc
194
182
  - test/resources/testproject-android/TestProject.xe5.dproj
@@ -274,6 +262,7 @@ test_files:
274
262
  - test/resources/testproject-android/ExplicitLib/ExplicitLibUnit.pas
275
263
  - test/resources/testproject-android/Rakefile.rb
276
264
  - test/resources/testproject-android/TestProject.cfg
265
+ - test/resources/testproject-android/TestProject.cfg.1
277
266
  - test/resources/testproject-android/TestProject.dpr
278
267
  - test/resources/testproject-android/TestProject.rc
279
268
  - test/resources/testproject-android/TestProject.xe5.dproj