#!/usr/bin/env ruby require 'rake' require '../common' require 'objective-j' require 'objective-j/bundletask' $BUILD_PATH = File.join($BUILD_DIR, $CONFIGURATION, 'AppKit') $ENVIRONMENT_PRODUCT = File.join($ENVIRONMENT_FRAMEWORKS_DIR, 'AppKit') $THEME_PRODUCT = File.join($BUILD_PATH, 'Resources', 'Aristo.blend') $ENVIRONMENT_THEME_PRODUCT = File.join($ENVIRONMENT_PRODUCT, 'Resources', 'Aristo.blend') AppKitFiles = FileList['**/*.j'].exclude('CoreGraphics/CGContextCanvas.j', 'CoreGraphics/CGContextVML.j', 'Themes/**', 'Tools/**') ObjectiveJ::BundleTask.new(:AppKit) do |t| t.name = 'AppKit' t.identifier = 'com.280n.AppKit' t.version = '0.7.1' t.author = '280 North, Inc.' t.email = 'feedback @nospam@ 280north.com' t.summary = 'AppKit classes for Cappuccino' t.sources = AppKitFiles t.resources = FileList['Resources/*'] t.license = ObjectiveJ::License::LGPL_v2_1 t.build_path = $BUILD_PATH t.flag = '-DDEBUG -g' if $CONFIGURATION == 'Debug' t.flag = '-O' if $CONFIGURATION == 'Release' t.platforms = [ObjectiveJ::Platform::Browser, ObjectiveJ::Platform::Rhino] t.type = ObjectiveJ::Bundle::Type::Framework end # It would be nice to just have ENVIRONMENT_PRODUCT depend on THEME_PRODUCT, # but this would be a circular dependency because THEME_PRODUCT needs # ENVIRONMENT_PRODUCT up-to-date since it runs an objj application that uses # AppKit. file_d $ENVIRONMENT_PRODUCT => [:AppKit] do cp_r(File.join($BUILD_PATH, '.'), $ENVIRONMENT_PRODUCT) end file_d $ENVIRONMENT_THEME_PRODUCT => $THEME_PRODUCT do cp_r(File.join($THEME_PRODUCT, '.'), $ENVIRONMENT_THEME_PRODUCT) end ThemeFiles = FileList['Themes/Aristo/*'] file_d $THEME_PRODUCT => ThemeFiles << $ENVIRONMENT_PRODUCT do File.popen("blend -d Themes/Aristo/ThemeDescriptors.j -o #{$THEME_PRODUCT} -R Themes/Aristo/Resources") do |blend| blend.sync = true while str = blend.gets puts str end end rake abort if ($? != 0) end task :build => [:build_subprojects, :AppKit, $ENVIRONMENT_PRODUCT, $THEME_PRODUCT, $ENVIRONMENT_THEME_PRODUCT] task :clean => :clean_suprojects task :clobber => :clobber_subprojects subprojects = %w{Tools} task :build_subprojects do subrake(subprojects, :build) end task :clean_suprojects do subrake(subprojects, :clean) end task :clobber_subprojects do subrake(subprojects, :clobber) end CLOBBER.include($ENVIRONMENT_PRODUCT)