rakelib/install.rake
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 28 Feb 2019 11:15:57 +0000
changeset 262 3bd7db4697fd
parent 234 05943c900d5e
permissions -rw-r--r--
Makefiles/Win32: pass `-g` to `stc` to get smalltalk debug info
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
     1
desc 'Install project into INSTALL_DIR'
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
     2
task :install => %i(compile
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
     3
                    install:pre
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
     4
                    install:main
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
     5
                    install:post)
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
     7
namespace :install do
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
     8
  task :pre
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
     9
  task :post
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    10
  task :main
4
48ec8a59ced4 Renamed `dist` target to `install`. Added new target `artifacts` (mainly) for Jenkins builds.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    11
end
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    13
desc 'Create build artifacts, e.g., deployable archives & packages'
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    14
task :artifacts => %i(install
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    15
                      artifacts:pre
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    16
                      artifacts:main
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    17
                      artifacts:post)
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
234
05943c900d5e Rakefiles: added new target `artifacts:source`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    19
4
48ec8a59ced4 Renamed `dist` target to `install`. Added new target `artifacts` (mainly) for Jenkins builds.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    20
namespace :'artifacts' do
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    21
  task :pre
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    22
  task :post
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    23
  task :main => :setup do
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    24
    (zip ARTIFACTS_DIR / BUILD_NAME, remove: true) if File.exist? ARTIFACTS_DIR / BUILD_NAME
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
  end
177
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    26
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    27
  task :'prebuilt-stc' do
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    28
    archive = ARTIFACTS_DIR / "#{project.app_name}-#{project.app_version}_#{BUILD_TARGET}_prebuilt-stc.zip"
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    29
    mkdir_p ARTIFACTS_DIR
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    30
    zip BUILD_DIR / 'stx' / 'stc' , archive: archive, include: STC_BINARY_FILES
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    31
  end
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    32
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    33
  task :'prebuilt-librun' do
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    34
    archive = ARTIFACTS_DIR / "#{project.app_name}-#{project.app_version}_#{BUILD_TARGET}_prebuilt-librun.zip"
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    35
    mkdir_p ARTIFACTS_DIR
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    36
    zip BUILD_DIR / 'stx' / 'librun' , archive: archive, include: LIBRUN_BINARY_FILES
234
05943c900d5e Rakefiles: added new target `artifacts:source`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    37
  end  
05943c900d5e Rakefiles: added new target `artifacts:source`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    38
05943c900d5e Rakefiles: added new target `artifacts:source`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    39
  desc 'Create source archive'
05943c900d5e Rakefiles: added new target `artifacts:source`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    40
  task :'source' => :checkout do
05943c900d5e Rakefiles: added new target `artifacts:source`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    41
    archive = ARTIFACTS_DIR / "#{project.app_name}-#{project.app_version}_sources.tar.gz"
05943c900d5e Rakefiles: added new target `artifacts:source`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    42
    mkdir_p ARTIFACTS_DIR
05943c900d5e Rakefiles: added new target `artifacts:source`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    43
    zip ".", archive: archive, exclude: %w(CVS .svn .git .hg *.obj *.o *.dll *.so *.debug *.H *.STH *Init.c *-Test.xml artifacts tmp)
177
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    44
  end
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
end