<commit_before># Rake file to make the OS X release
#
# APP, RELEASE_VERSION and RELEASE_FOLDER_BASE must be defined elsewhere.

GAME_URL = "com.github.spooner.#{APP}"
OSX_APP = "#{APP.split("_").map(&:capitalize).join(" ")}.app"

OSX_GEMS = %w[chingu]

RELEASE_FOLDER_OSX = "#{RELEASE_FOLDER_BASE}_OSX"

OSX_BUILD_DIR =  File.expand_path("~/gosu_wrappers")
BASE_OSX_APP = File.join(OSX_BUILD_DIR, "RubyGosu App.app")
TMP_OSX_PKG_DIR = File.join(OSX_BUILD_DIR, File.basename(RELEASE_FOLDER_OSX))
TMP_OSX_APP = File.join(TMP_OSX_PKG_DIR, OSX_APP)
TMP_OSX_SOURCE_DIR = File.join(TMP_OSX_APP, "Contents", "Resources", APP) # Where I copy my game source.
TMP_OSX_GEM_DIR = File.join(TMP_OSX_APP, "Contents", "Resources", 'lib') # Gem location.
TMP_OSX_INFO_FILE = File.join(TMP_OSX_APP, "Contents", "Info.plist")
TMP_OSX_MAIN_FILE = File.join(TMP_OSX_APP, "Contents", "Resources", "Main.rb")
TMP_OSX_RUBY = File.join(TMP_OSX_APP, "Contents", "MacOS", "RubyGosu App")

RUN_FILE_OLD = File.join(TMP_OSX_SOURCE_DIR, "bin/#{APP}.rbw")
RUN_FILE_NEW = RUN_FILE_OLD.sub('.rbw', '.rb')

desc "Create OS X releases v#{RELEASE_VERSION}"
task "release:osx" => ["build:osx:app"]

# Create folders for release.
file RELEASE_FOLDER_OSX => [OSX_APP, README_HTML] do
  mkdir_p RELEASE_FOLDER_OSX
  cp OSX_APP, RELEASE_FOLDER_OSX
  cp CHANGELOG_FILE, RELEASE_FOLDER_OSX
  cp README_HTML, RELEASE_FOLDER_OSX
end

file OSX_APP => "build:osx:app"

desc "Generate #{OSX_APP} (OS X) v#{RELEASE_VERSION}"<commit_msg>Pulled OSX gems out, since that is specific to the game.<commit_after>raise "OSX_GEMS must be defined for release" unless defined? OSX_GEMS

GAME_URL = "com.github.spooner.#{APP}"
OSX_APP = "#{APP.split("_").map(&:capitalize).join(" ")}.app"

RELEASE_FOLDER_OSX = "#{RELEASE_FOLDER_BASE}_OSX"

OSX_BUILD_DIR =  File.expand_path("~/gosu_wrappers")
BASE_OSX_APP = File.join(OSX_BUILD_DIR, "RubyGosu App.app")
TMP_OSX_PKG_DIR = File.join(OSX_BUILD_DIR, File.basename(RELEASE_FOLDER_OSX))
TMP_OSX_APP = File.join(TMP_OSX_PKG_DIR, OSX_APP)
TMP_OSX_SOURCE_DIR = File.join(TMP_OSX_APP, "Contents", "Resources", APP) # Where I copy my game source.
TMP_OSX_GEM_DIR = File.join(TMP_OSX_APP, "Contents", "Resources", 'lib') # Gem location.
TMP_OSX_INFO_FILE = File.join(TMP_OSX_APP, "Contents", "Info.plist")
TMP_OSX_MAIN_FILE = File.join(TMP_OSX_APP, "Contents", "Resources", "Main.rb")
TMP_OSX_RUBY = File.join(TMP_OSX_APP, "Contents", "MacOS", "RubyGosu App")

RUN_FILE_OLD = File.join(TMP_OSX_SOURCE_DIR, "bin/#{APP}.rbw")
RUN_FILE_NEW = RUN_FILE_OLD.sub('.rbw', '.rb')

desc "Create OS X releases v#{RELEASE_VERSION}"
task "release:osx" => ["build:osx:app"]

# Create folders for release.
file RELEASE_FOLDER_OSX => [OSX_APP, README_HTML] do
  mkdir_p RELEASE_FOLDER_OSX
  cp OSX_APP, RELEASE_FOLDER_OSX
  cp CHANGELOG_FILE, RELEASE_FOLDER_OSX
  cp README_HTML, RELEASE_FOLDER_OSX
end

file OSX_APP => "build:osx:app"

desc "Generate #{OSX_APP} (OS X) v#{RELEASE_VERSION}"
{'fraction_non_alphanumeric': 0.1401015228426396, 'fraction_numerical': 0.0, 'mean_word_length': 6.946236559139785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4863442', 'n_tokens_mistral': 1276, 'n_tokens_neox': 1279, 'n_words': 232}