diff --git a/AppKit/Rakefile b/AppKit/Rakefile deleted file mode 100644 index a93beb55c..000000000 --- a/AppKit/Rakefile +++ /dev/null @@ -1,79 +0,0 @@ -#!/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) diff --git a/AppKit/Themes/BlendKit/Rakefile b/AppKit/Themes/BlendKit/Rakefile deleted file mode 100644 index 0de00f5c5..000000000 --- a/AppKit/Themes/BlendKit/Rakefile +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env ruby - -require 'rake' -require '../../../common' -require 'objective-j' -require 'objective-j/bundletask' - - -$ENVIRONMENT_PRODUCT = File.join($ENVIRONMENT_FRAMEWORKS_DIR, 'BlendKit') -$BUILD_PATH = File.join($BUILD_DIR, $CONFIGURATION, 'BlendKit') - -ObjectiveJ::BundleTask.new(:BlendKit) do |t| - t.name = 'BlendKit' - t.identifier = 'com.280n.BlendKit' - t.version = '0.7.1' - t.author = '280 North, Inc.' - t.email = 'feedback @nospam@ 280north.com' - t.summary = 'BlendKit classes for Cappuccino' - t.sources = FileList['*.j'] - t.resources = FileList['Resources/*'].to_a - t.license = ObjectiveJ::License::LGPL_v2_1 - t.build_path = $BUILD_PATH - t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug' - t.flag = '-O' if $CONFIGURATION == 'Release' - t.type = ObjectiveJ::Bundle::Type::Framework -end - -#Framework in environment directory -file_d $ENVIRONMENT_PRODUCT => [:BlendKit] do - cp_r(File.join($BUILD_PATH, '.'), $ENVIRONMENT_PRODUCT) -end - -task :build => [:BlendKit, $ENVIRONMENT_PRODUCT] - -CLOBBER.include($ENVIRONMENT_PRODUCT) diff --git a/Foundation/Rakefile b/Foundation/Rakefile deleted file mode 100644 index fe768cbc4..000000000 --- a/Foundation/Rakefile +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env ruby - -require 'rake' -require '../common' -require 'objective-j' -require 'objective-j/bundletask' - - -$ENVIRONMENT_PRODUCT = File.join($ENVIRONMENT_FRAMEWORKS_DIR, 'Foundation') -$BUILD_PATH = File.join($BUILD_DIR, $CONFIGURATION, 'Foundation') - -task :build => [:Foundation, $ENVIRONMENT_PRODUCT] - -ObjectiveJ::BundleTask.new(:Foundation) do |t| - t.name = 'Foundation' - t.identifier = 'com.280n.Foundation' - t.version = '0.7.1' - t.author = '280 North, Inc.' - t.email = 'feedback @nospam@ 280north.com' - t.summary = 'Foundation classes for Cappuccino' - t.sources = FileList['**/*.j'] - t.resources = FileList['Resources/*'].to_a - 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.type = ObjectiveJ::Bundle::Type::Framework -end - -#Framework in environment directory -file_d $ENVIRONMENT_PRODUCT => [:Foundation] do - cp_r(File.join($BUILD_PATH, '.'), $ENVIRONMENT_PRODUCT) -end - -CLOBBER.include($ENVIRONMENT_PRODUCT) diff --git a/Rakefile b/Rakefile index 695a67f7e..78cf05ca7 100644 --- a/Rakefile +++ b/Rakefile @@ -1,161 +1,11 @@ #!/usr/bin/env ruby -require 'common' -require 'rake' -require 'rake/clean' +print(' + Building with rake is no longer supported, use "jake" instead. + The commands are all the same (e.g. rake install -> jake install). -subprojects = %w{External Objective-J Foundation AppKit Tools External/ojunit} + If you do not have jake, you can run sudo ./bootstrap.sh to install it and its dependencies. -%w(build clean clobber).each do |task_name| - task task_name do - subrake(subprojects, task_name) - end -end - -$DEBUG_ENV = File.join($BUILD_DIR, 'Debug', 'env') -$RELEASE_ENV = File.join($BUILD_DIR, 'Release', 'env') - -$DOXYGEN_CONFIG = File.join('Tools', 'Documentation', 'Cappuccino.doxygen') -$DOCUMENTATION_BUILD = File.join($BUILD_DIR, 'Documentation') - -$TOOLS_README = File.join('Tools', 'READMEs', 'TOOLS-README') -$TOOLS_EDITORS = File.join('Tools', 'Editors') -$TOOLS_INSTALLER = File.join('Tools', 'Install', 'install-tools') -$TOOLS_DOWNLOAD = File.join($BUILD_DIR, 'Cappuccino', 'Tools') -$TOOLS_DOWNLOAD_ENV = File.join($TOOLS_DOWNLOAD, 'objj') -$TOOLS_DOWNLOAD_EDITORS = File.join($TOOLS_DOWNLOAD, 'Editors') -$TOOLS_DOWNLOAD_README = File.join($TOOLS_DOWNLOAD, 'README') -$TOOLS_DOWNLOAD_INSTALLER = File.join($TOOLS_DOWNLOAD, 'install-tools') - -$STARTER_README = File.join('Tools', 'READMEs', 'STARTER-README') -$STARTER_DOWNLOAD = File.join($BUILD_DIR, 'Cappuccino', 'Starter') -$STARTER_DOWNLOAD_APPLICATION = File.join($STARTER_DOWNLOAD, 'NewApplication') -$STARTER_DOWNLOAD_README = File.join($STARTER_DOWNLOAD, 'README') - -$NARWHAL_PACKAGE = File.join($BUILD_DIR, 'Cappuccino', 'objj') - -task :downloads => [:starter_download, :tools_download, :narwhal_package] - -file_d $TOOLS_DOWNLOAD_ENV => [:debug, :release] do - rm_rf($TOOLS_DOWNLOAD_ENV) - cp_r(File.join($RELEASE_ENV), $TOOLS_DOWNLOAD_ENV) - cp_r(File.join($DEBUG_ENV, 'packages', 'objj', 'lib', 'Frameworks'), File.join($TOOLS_DOWNLOAD_ENV, 'packages', 'objj', 'lib', 'Frameworks', 'Debug')) -end - -file_d $TOOLS_DOWNLOAD_EDITORS => [$TOOLS_EDITORS] do - cp_r(File.join($TOOLS_EDITORS, '.'), $TOOLS_DOWNLOAD_EDITORS) -end - -file_d $TOOLS_DOWNLOAD_README => [$TOOLS_README] do - cp($TOOLS_README, $TOOLS_DOWNLOAD_README) -end - -file_d $TOOLS_DOWNLOAD_INSTALLER => [$TOOLS_INSTALLER] do - cp($TOOLS_INSTALLER, $TOOLS_DOWNLOAD_INSTALLER) -end - -task :objj_gem do - subrake('Tools/Rake', :objj_gem) -end - -task :tools_download => [$TOOLS_DOWNLOAD_ENV, $TOOLS_DOWNLOAD_EDITORS, $TOOLS_DOWNLOAD_README, $TOOLS_DOWNLOAD_INSTALLER, :objj_gem] - -task :starter_download => [$STARTER_DOWNLOAD_APPLICATION, $STARTER_DOWNLOAD_README] - -task :narwhal_package => [$TOOLS_DOWNLOAD_ENV] do - rm_rf($NARWHAL_PACKAGE) - cp_r(File.join($TOOLS_DOWNLOAD_ENV, 'packages', 'objj'), $NARWHAL_PACKAGE) -end - -task :deploy => [:downloads, :docs] do - #copy the docs into the starter pack - cp_r(File.join($DOCUMENTATION_BUILD, 'html', '.'), File.join($STARTER_DOWNLOAD, 'Documentation')) - - cappuccino_output_path = File.join($BUILD_DIR, 'Cappuccino') - - #zip the starter pack - starter_zip_output = File.join($BUILD_DIR, 'Cappuccino', 'Starter.zip') - rm_rf(starter_zip_output) - - `cd #{cappuccino_output_path} && zip -ry -8 Starter.zip Starter` - - #zip the tools pack - tools_zip_output = File.join($BUILD_DIR, 'Cappuccino', 'Tools.zip') - rm_rf(tools_zip_output) - - `cd #{cappuccino_output_path} && zip -ry -8 Tools.zip Tools` -end - -file_d $STARTER_DOWNLOAD_APPLICATION => [$TOOLS_DOWNLOAD_ENV] do - - ENV['PATH'] = "#{File.join($TOOLS_DOWNLOAD_ENV, 'bin')}:#{ENV['PATH']}" - - rm_rf($STARTER_DOWNLOAD_APPLICATION) - mkdir_p($STARTER_DOWNLOAD) - - system %{capp gen #{$STARTER_DOWNLOAD_APPLICATION} -t Application --noconfig } - rake abort if ($? != 0) - - # No tools means no objective-j gem - rm(File.join($STARTER_DOWNLOAD_APPLICATION, 'Rakefile')) - -end - -file_d $STARTER_DOWNLOAD_README => [$STARTER_README] do - cp($STARTER_README, $STARTER_DOWNLOAD_README) -end - -task :install => [:tools_download] do - if ENV['prefix'] - prefix = "--prefix #{ENV['prefix']}" - else - prefix = '' - end - - system %{cd #{$TOOLS_DOWNLOAD} && sudo sh ./install-tools #{prefix} } - rake abort if ($? != 0) -end - -task :test => [:build] do - tests = "'" + FileList['Tests/**/*Test.j'].join("' '") + "'" - build_result = %x{ojtest #{tests} } - - if build_result.match(/Test suite failed/i) - puts "tests failed, aborting the build" - puts build_result - rake abort - else - puts build_result - end -end - -task :docs do - if executable_exists? "doxygen" - system %{doxygen #{$DOXYGEN_CONFIG} } - rake abort if ($? != 0) - - rm_rf $DOCUMENTATION_BUILD - mv "debug.txt", "Documentation" - mv "Documentation", $DOCUMENTATION_BUILD - else - puts 'doxygen not installed. skipping documentation generation.' - end -end - -task :submodules do - if executable_exists? "git" - system %{git submodule init && git submodule update} - rake abort if ($? != 0) - else - puts "Git not installed" - rake abort - end -end - -=begin - -TODO: documentation - -TODO: zip/tar. -=end +'); +exit(1); diff --git a/Tools/nib2cib/Rakefile b/Tools/nib2cib/Rakefile deleted file mode 100644 index e62d3de10..000000000 --- a/Tools/nib2cib/Rakefile +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env ruby - -require 'rake' -require '../../common' -require 'objective-j' -require 'objective-j/bundletask' - - -$PRODUCT = :nib2cib -$BUILD_PATH = File.join($BUILD_DIR, $CONFIGURATION, 'nib2cib') -$ENVIRONMENT_BIN_PRODUCT = File.join($ENVIRONMENT_BIN_DIR, 'nib2cib') -$ENVIRONMENT_LIB_PRODUCT = File.join($ENVIRONMENT_LIB_DIR, 'nib2cib') - -ObjectiveJ::BundleTask.new(:nib2cib) do |t| - t.name = 'nib2cib' - t.identifier = 'com.280n.nib2cib' - t.version = '0.7.1' - t.author = '280 North, Inc.' - t.email = 'feedback @nospam@ 280north.com' - t.summary = 'nib2cib converts Cocoa nib and xibs to Cappuccino cibs' - t.sources = FileList['**/*.j'] - t.resources = FileList['Resources/*'] - t.license = ObjectiveJ::License::LGPL_v2_1 - t.build_path = $BUILD_PATH - t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug' - t.flag = '-O' if $CONFIGURATION == 'Release' -end - -#executable in environment directory -file_d $ENVIRONMENT_BIN_PRODUCT do - make_objj_executable($ENVIRONMENT_BIN_PRODUCT) -end - -file_d $ENVIRONMENT_LIB_PRODUCT => [:nib2cib] do - cp_r(File.join($BUILD_PATH, '.'), $ENVIRONMENT_LIB_PRODUCT) -end - -task :build => [:nib2cib, $ENVIRONMENT_BIN_PRODUCT, $ENVIRONMENT_LIB_PRODUCT] - -CLOBBER.include($ENVIRONMENT_BIN_PRODUCT, $ENVIRONMENT_LIB_PRODUCT ) diff --git a/Tools/press/Rakefile b/Tools/press/Rakefile deleted file mode 100644 index b483a0b05..000000000 --- a/Tools/press/Rakefile +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env ruby - -require 'rake' -require '../../common' -require 'objective-j' -require 'objective-j/bundletask' - - -$PRODUCT = :press -$BUILD_PATH = File.join($BUILD_DIR, $CONFIGURATION, 'press') -$ENVIRONMENT_BIN_PRODUCT = File.join($ENVIRONMENT_BIN_DIR, 'press') -$ENVIRONMENT_LIB_PRODUCT = File.join($ENVIRONMENT_LIB_DIR, 'press') -$ENVIRONMENT_BRIDGE = File.join($ENVIRONMENT_LIB_DIR, 'press', 'bridge.js') - -# Debug Framework -ObjectiveJ::BundleTask.new(:press) do |t| - t.name = 'press' - t.identifier = 'com.280n.press' - t.version = '0.7.1' - t.author = '280 North, Inc.' - t.email = 'feedback @nospam@ 280north.com' - t.summary = 'Deployment tool for Cappuccino applications' - t.sources = FileList['*.j'] - t.resources = FileList['Resources/*'] - t.license = ObjectiveJ::License::LGPL_v2_1 - t.build_path = $BUILD_PATH - t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug' - t.flag = '-O' if $CONFIGURATION == 'Release' -end - -#executable in environment directory -file_d $ENVIRONMENT_BIN_PRODUCT do - make_objj_executable($ENVIRONMENT_BIN_PRODUCT) -end - -file_d $ENVIRONMENT_LIB_PRODUCT => [:press] do - cp_r(File.join($BUILD_PATH, '.'), $ENVIRONMENT_LIB_PRODUCT) -end - -file_d $ENVIRONMENT_BRIDGE => [File.join($HOME_DIR, 'Tools', 'Utilities', 'bridge.js')] do - cp(File.join($HOME_DIR, 'Tools', 'Utilities', 'bridge.js'), $ENVIRONMENT_BRIDGE) -end - -task :build => [:press, $ENVIRONMENT_BIN_PRODUCT, $ENVIRONMENT_LIB_PRODUCT, $ENVIRONMENT_BRIDGE] - -CLOBBER.include($ENVIRONMENT_BIN_PRODUCT, $ENVIRONMENT_LIB_PRODUCT) diff --git a/common.rb b/common.rb deleted file mode 100644 index c58be580f..000000000 --- a/common.rb +++ /dev/null @@ -1,160 +0,0 @@ -require 'rake' -require 'pathname' - -def gem_command - case RUBY_PLATFORM - when /win32/ - 'gem.bat' - when /java/ - 'jruby -S gem' - else - 'gem' - end -end - -begin - require 'rubygems' - require 'plist' -rescue LoadError - puts 'Plist gem not installed, installing...' - cmd = "#{gem_command} install plist" - puts cmd - puts %x(#{cmd}) -end - -# Read in and set up development environment variables. -if !ENV['BUILD_PATH'] - - # Global Cappuccino build directory - if ENV['CAPP_BUILD'] - ENV['BUILD_PATH'] = ENV['CAPP_BUILD'] - - # Maintain backwards compatibility with steam. - elsif ENV['STEAM_BUILD'] - ENV['BUILD_PATH'] = ENV['STEAM_BUILD'] - - # Just build here. - else - ENV['BUILD_PATH'] = File.join(File.dirname(__FILE__), 'Build') - end -end - -ENV['BUILD_PATH'] = File.expand_path(ENV['BUILD_PATH']) - -if !ENV['CONFIG'] - ENV['CONFIG'] = 'Release' -end - -$CONFIGURATION = ENV['CONFIG'] -$BUILD_DIR = ENV['BUILD_PATH'] -$PRODUCT_DIR = File.join($BUILD_DIR, $CONFIGURATION) -$ENVIRONMENT_DIR = File.join($BUILD_DIR, $CONFIGURATION, 'env') -$ENVIRONMENT_NARWHAL_BIN_DIR= File.join($ENVIRONMENT_DIR, 'bin') -$ENVIRONMENT_BIN_DIR = File.join($ENVIRONMENT_DIR, 'packages', 'objj', 'bin') -$ENVIRONMENT_LIB_DIR = File.join($ENVIRONMENT_DIR, 'packages', 'objj', 'lib') -$ENVIRONMENT_FRAMEWORKS_DIR = File.join($ENVIRONMENT_LIB_DIR, 'Frameworks') - -$HOME_DIR = File.expand_path(File.dirname(__FILE__)) -$LICENSE_FILE = File.expand_path(File.join(File.dirname(__FILE__), 'LICENSE')) - -if !(defined? COMMON_DO_ONCE) - - COMMON_DO_ONCE = true - - $LOAD_PATH << File.join($HOME_DIR, 'Tools', 'Rake', 'lib') - ENV['PATH'] = $ENVIRONMENT_NARWHAL_BIN_DIR + ':' + ENV['PATH'] -end - -require 'objective-j' - -def serialized_env - env = "" - env += %{CONFIG="#{ENV['CONFIG']}" } if ENV['CONFIG'] - env += %{BUILD_DIR="#{ENV['BUILD_DIR']}" } if ENV['BUILD_DIR'] - - return env - -end - -def subrake(directories, task_name) - directories.each do |directory| - if (File.directory?(directory) && File.file?(File.join(directory, "Rakefile"))) - system(%{cd #{directory} && #{$serialized_env} #{$0} #{task_name}}) - rake abort if ($? != 0) - else - puts "warning: subrake missing: " + directory +" (this is not necessarily an error, "+directory+" may be optional)" - end - end -end - -def executable_exists?(name) - ENV["PATH"].split(":").any? {|p| File.executable? File.join(p, name) } -end - -$OBJJ_TEMPLATE_EXECUTABLE = File.join($HOME_DIR, 'Tools', 'Rake', 'lib', 'objj-executable') - -def make_objj_executable(path) - cp($OBJJ_TEMPLATE_EXECUTABLE, path) - File.chmod(0755, path) - symlink_executable(path) -end - -def symlink_executable(source) - relative = Pathname.new(source).relative_path_from(Pathname.new($ENVIRONMENT_NARWHAL_BIN_DIR)) - destination = File.join($ENVIRONMENT_NARWHAL_BIN_DIR, File.basename(source)) - FileUtils.ln_sf(relative, destination) -end - -task :build -task :default => [:build] - -task :release do - ENV['CONFIG'] = 'Release' - spawn_rake(:build) -end - -task :debug do - ENV['CONFIG'] = 'Debug' - spawn_rake(:build) -end - -task :all => [:debug, :release] - -task 'clean-debug' do - ENV['CONFIG'] = 'Debug' - spawn_rake(:clean) -end - -task :cleandebug => ['clean-debug'] - -task 'clean-release' do - ENV['CONFIG'] = 'Release' - spawn_rake(:clean) -end - -task :cleanrelease => ['clean-release'] - -task 'clean-all' => ['clean-debug', 'clean-release'] -task :cleanall => ['clean-all'] - -task 'clobber-debug' do - ENV['CONFIG'] = 'Debug' - spawn_rake(:clobber) -end - -task :clobberdebug => ['clobber-debug'] - -task 'clobber-release' do - ENV['CONFIG'] = 'Release' - spawn_rake(:clobber) -end - -task :clobberrelease => ['clobber-release'] - -task 'clobber-all' => ['clobber-debug', 'clobber-release'] -task :clobberall => ['clobber-all'] - -def spawn_rake(task_name) - system %{#{$serialized_env} #{$0} #{task_name}} - rake abort if ($? != 0) -end