rakelib/install.rake
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 24 Sep 2018 20:55:06 +0100
changeset 258 65caf0201157
parent 234 05943c900d5e
permissions -rw-r--r--
Fix missing `smalltalk.svg` and `smalltalkx.desktop` in toy archive ...which caused a warning when run on system without these already installed: cp: cannot stat './smalltalkx.svg': No such file or directory cp: cannot stat './smalltalkx.desktop': No such file or directory Thanks Pocho for reporting.

desc 'Install project into INSTALL_DIR'
task :install => %i(compile
                    install:pre
                    install:main
                    install:post)

namespace :install do
  task :pre
  task :post
  task :main
end

desc 'Create build artifacts, e.g., deployable archives & packages'
task :artifacts => %i(install
                      artifacts:pre
                      artifacts:main
                      artifacts:post)


namespace :'artifacts' do
  task :pre
  task :post
  task :main => :setup do
    (zip ARTIFACTS_DIR / BUILD_NAME, remove: true) if File.exist? ARTIFACTS_DIR / BUILD_NAME
  end

  task :'prebuilt-stc' do
    archive = ARTIFACTS_DIR / "#{project.app_name}-#{project.app_version}_#{BUILD_TARGET}_prebuilt-stc.zip"
    mkdir_p ARTIFACTS_DIR
    zip BUILD_DIR / 'stx' / 'stc' , archive: archive, include: STC_BINARY_FILES
  end

  task :'prebuilt-librun' do
    archive = ARTIFACTS_DIR / "#{project.app_name}-#{project.app_version}_#{BUILD_TARGET}_prebuilt-librun.zip"
    mkdir_p ARTIFACTS_DIR
    zip BUILD_DIR / 'stx' / 'librun' , archive: archive, include: LIBRUN_BINARY_FILES
  end  

  desc 'Create source archive'
  task :'source' => :checkout do
    archive = ARTIFACTS_DIR / "#{project.app_name}-#{project.app_version}_sources.tar.gz"
    mkdir_p ARTIFACTS_DIR
    zip ".", archive: archive, exclude: %w(CVS .svn .git .hg *.obj *.o *.dll *.so *.debug *.H *.STH *Init.c *-Test.xml artifacts tmp)
  end
end