From 3d11f8b144573e41be2f385b132710c157b04d1b Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Fri, 27 Sep 2013 20:33:11 -0700 Subject: [PATCH] Removed Scripts --- Scripts/launchd_nightly.plist | 24 ------- Scripts/update_feed.rb | 118 ---------------------------------- 2 files changed, 142 deletions(-) delete mode 100644 Scripts/launchd_nightly.plist delete mode 100755 Scripts/update_feed.rb diff --git a/Scripts/launchd_nightly.plist b/Scripts/launchd_nightly.plist deleted file mode 100644 index 4343be307..000000000 --- a/Scripts/launchd_nightly.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Label - org.cogx.cog.nightly - ProgramArguments - - /Users/vspader/Projects/Cog.Nightly/Scripts/build_nightly.rb - - UserName - vspader - WorkingDirectory - /Users/vspader/Projects/Cog.Nightly - StartCalendarInterval - - Hour - 3 - Minute - 0 - - - - diff --git a/Scripts/update_feed.rb b/Scripts/update_feed.rb deleted file mode 100755 index 006e98b08..000000000 --- a/Scripts/update_feed.rb +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env ruby - -require 'tempfile' -require 'open-uri' -require 'rexml/document' -include REXML - -feed = ARGV[0] || 'nightly' - -appcast = open("http://cogx.org/appcast/#{feed}.xml") - -appcastdoc = Document.new(appcast) - -#Get the latest revision from the appcast -appcast_revision = Regexp.new('\d+$').match(appcastdoc.elements['//channel/item/title'].text.to_s()).to_s().to_i() || 0 - -#Remove modified files that may cause conflicts. -%x[hg revert --all] - -#Offset needed for SVN <=> HG conversion. We'll use 1000 because it's simple. -revision_offset = 1000 - -#Update to the latest revision -%x[hg pull -u] -latest_revision = %x[hg tip --style compact].match(/^[0-9]+/)[0].to_i() + revision_offset - -if appcast_revision < latest_revision - #Get the changelog - changelog = %x[hg log --template '{desc}\n' -r #{latest_revision - revision_offset}:#{appcast_revision - revision_offset + 1}] - - description = '' - ignore_next = false - changelog.each_line do |line| - if (ignore_next) - ignore_next = false - next - end - if Regexp.new('^-+$').match(line) - ignore_next = true - next - elsif Regexp.new('^\s*$').match(line) - next - end - description += line - end - - #Remove the previous build directories - %x[find . -type d -name build -print0 | xargs -0 rm -r ] - - #Update the version in the plist - plist = open('Info.plist') - plistdoc = Document.new(plist) - plist.close() - - version_element = plistdoc.elements["//[. = 'CFBundleVersion']/following-sibling::string"]; - version_element.text = "r#{latest_revision}" - - newplist = open('Info.plist', 'w') - plistdoc.write(newplist) - newplist.close() - - #Build Cog! - %x[xcodebuild -alltargets -configuration Release 2>&1].each_line do |line| - if line.match(/\*\* BUILD FAILED \*\*/) - exit - end - end - - filename = "Cog-r#{latest_revision}.tbz" - - #Zip the app! - %x[rm -f build/Release/#{feed}.tar.bz2] - %x[tar -C build/Release -cjf build/Release/#{feed}.tar.bz2 Cog.app] - - filesize = File.size("build/Release/#{feed}.tar.bz2") - - #Send the new build to the server - %x[scp build/Release/#{feed}.tar.bz2 cogx@cogx.org:~/cogx.org/#{feed}_builds/#{filename}] - - #Add new entry to appcast - new_item = Element.new('item') - - new_item.add_element('title') - new_item.elements['title'].text = "Cog r#{latest_revision}" - - new_item.add_element('description') - new_item.elements['description'].text = description - - new_item.add_element('pubDate') - new_item.elements['pubDate'].text = Time.now().strftime("%a, %d %b %Y %H:%M:%S %Z") #RFC 822 - - new_item.add_element('sparkle:minimumSystemVersion') - new_item.elements['sparkle:minimumSystemVersion'].text = '10.5.0' - - new_item.add_element('enclosure') - new_item.elements['enclosure'].add_attribute('url', "http://cogx.org/#{feed}_builds/#{filename}") - new_item.elements['enclosure'].add_attribute('length', filesize) - new_item.elements['enclosure'].add_attribute('type', 'application/octet-stream') - new_item.elements['enclosure'].add_attribute('sparkle:version', "r#{latest_revision}") - - appcastdoc.insert_before('//channel/item', new_item) - - #Limit number of entries to 5 - appcastdoc.delete_element('//channel/item[position()>5]') - - new_xml = Tempfile.new('appcast.xml') - appcastdoc.write(new_xml) - new_xml.close() - appcast.close() - - #Send the updated appcast to the server - %x[scp #{new_xml.path} cogx@cogx.org:~/cogx.org/appcast/#{feed}.xml] - -end - - - -