@@ -22,6 +22,8 @@ module Constants
22
22
script_folder = File . expand_path ( File . dirname ( __FILE__ ) )
23
23
24
24
PARSE_CONSTANTS_HEADER = File . join ( script_folder , 'Parse' , 'PFConstants.h' )
25
+ PARSE_PODSPEC = File . join ( script_folder , 'Parse.podspec' )
26
+
25
27
PLISTS = [
26
28
File . join ( script_folder , 'Parse' , 'Resources' , 'Parse-iOS.Info.plist' ) ,
27
29
File . join ( script_folder , 'Parse' , 'Resources' , 'Parse-OSX.Info.plist' ) ,
@@ -54,6 +56,12 @@ module Constants
54
56
PLISTS . each do |plist |
55
57
update_info_plist_version ( plist , version )
56
58
end
59
+
60
+ podspec_file = File . open ( PARSE_PODSPEC , 'r+' )
61
+ podspec = podspec_file . read
62
+ podspec . gsub! ( /(.*s.version\s *=\s *')(.*)(')/ , "\\ 1#{ version } \\ 3" )
63
+ podspec_file . seek ( 0 )
64
+ podspec_file . write ( podspec )
57
65
end
58
66
59
67
def self . update_info_plist_version ( plist_path , version )
@@ -158,6 +166,11 @@ namespace :package do
158
166
`#{ bolts_folder } /scripts/build_framework.sh -n -c Release --with-watchos --with-tvos`
159
167
end
160
168
169
+ task :set_version , [ :version ] do |_ , args |
170
+ version = args [ :version ] || Constants . current_version
171
+ Constants . update_version ( version )
172
+ end
173
+
161
174
desc 'Build and package all frameworks for the release'
162
175
task :frameworks , [ :version ] => :prepare do |_ , args |
163
176
version = args [ :version ] || Constants . current_version
0 commit comments