rakelib/install.rake
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 24 Aug 2017 17:14:44 +0100
branchstx-8.0.0
changeset 177 6ad33f64e566
parent 137 e665031cade7
child 234 05943c900d5e
permissions -rw-r--r--
Rakefiles: make use of (new) `include` parameter to `zip()` ...when archiving prebuild stx:stc and stx:librun. This allows us to create these archives without wiping out sources from the working copy.
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
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
    19
namespace :'artifacts' do
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    20
  task :pre
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    21
  task :post
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    22
  task :main => :setup do
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 24
diff changeset
    23
    (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
    24
  end
177
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    25
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    26
  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
    27
    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
    28
    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
    29
    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
    30
  end
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    31
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    32
  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
    33
    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
    34
    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
    35
    zip BUILD_DIR / 'stx' / 'librun' , archive: archive, include: LIBRUN_BINARY_FILES
6ad33f64e566 Rakefiles: make use of (new) `include` parameter to `zip()`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 137
diff changeset
    36
  end
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
end