Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Refactor update version script to use new locations
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 3 Oct 2020 10:16:39 +0000 (11:16 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 3 Oct 2020 10:16:39 +0000 (11:16 +0100)
source/tools/updateversion.pl

index 1f7dc3e..6be5653 100755 (executable)
@@ -70,9 +70,9 @@ foreach my $file_data_line(@file_data) {
 
 }
 
-# Update projects/msw/xestiaab.rc
+# Update source/os/msw/xestiaab.rc
 
-$filename = "../../projects/msw/xestiaab.rc";
+$filename = "../os/msw/xestiaab.rc";
 tie(@file_data, 'Tie::File', $filename);
 foreach my $file_data_line(@file_data) {
 
@@ -97,22 +97,30 @@ foreach my $file_data_line(@file_data) {
                $line_output .= ",0,0";
                $file_data_line = $line_output;
        }       
-
 }
 
-# Update projects/osx/XestiaAddressBook.xcodeproj/project.pbxproj
-
-$filename = "../../projects/osx/XestiaAddressBook.xcodeproj/project.pbxproj";
-tie(@file_data, 'Tie::File', $filename);
-foreach my $file_data_line(@file_data) {
-
-       # Look for PRODUCT_VERSION
-
-       if ($file_data_line =~ /^\t\t\t\tPRODUCT_VERSION/){
-               my $line_output = "\t\t\t\tPRODUCT_VERSION = ";
-               $line_output .= $version;
-               $line_output .= ";";
-               $file_data_line = $line_output;
+# Update source/os/osx/Info.plist
+
+$filename = "../os/osx/Info.plist";
+open($file_handle, '+<', $filename);
+my $line_found = 0;
+my $new_file = "";
+while(<$file_handle>)
+{
+       if ($line_found eq 1)
+       {
+               my $new_line = "\t<string>" . $version_major . "." . $version_minor . "</string>\n";
+               $new_file .= $new_line;
+               $line_found = 0;
+               next;
        }
 
+       if (/.*<key>CFBundleVersion<\/key>/)
+       {
+               $line_found = 1;
+       }
+       $new_file .= $_;
 }
+close($file_handle);
+
+print $new_file;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy