File: release.rake

package info (click to toggle)
jruby 9.3.9.0%2Bds-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,856 kB
  • sloc: ruby: 517,823; java: 260,094; xml: 31,930; ansic: 5,777; yacc: 4,973; sh: 1,163; makefile: 105; jsp: 48; tcl: 40; exp: 11
file content (40 lines) | stat: -rw-r--r-- 1,576 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

DIST_FILES_GLOB = "jruby-dist-*.{zip,gz}"
DIST_FILES_DIR = File.join('maven', 'jruby-dist', 'target')
JRUBY_COMPLETE_DIR = File.join('maven', 'jruby-complete', 'target')
JRUBY_COMPLETE_GLOB = 'jruby-complete-*.jar'
JRUBY_JARS_DIR = File.join('maven', 'jruby-jars', 'pkg')
JRUBY_JARS_GLOB = 'jruby-jars-*.gem'
JRUBY_EXE_GLOB = '*.exe'

desc "post-process mvn build to generate properly named and fingerprinted files"
task :post_process_artifacts => :windows_installer do
  cp Dir[File.join(DIST_FILES_DIR, DIST_FILES_GLOB)], RELEASE_DIR
  Dir[File.join(RELEASE_DIR, DIST_FILES_GLOB)].each do |file|
    real_file = file.sub(/-dist/, '')
    if real_file =~ /-bin/
      real_file = real_file.sub(/-bin/, '').sub(/-/, '-bin-')
    elsif real_file =~ /-src/
      real_file = real_file.sub(/-src/, '').sub(/-/, '-src-')
    end
    mv file, real_file
    checksums real_file
  end

  cp Dir[File.join(JRUBY_COMPLETE_DIR, JRUBY_COMPLETE_GLOB)], RELEASE_DIR
  Dir[File.join(RELEASE_DIR, JRUBY_COMPLETE_GLOB)].each {|file| checksums file }

  cp Dir[File.join(JRUBY_JARS_DIR, JRUBY_JARS_GLOB)], RELEASE_DIR
  Dir[File.join(RELEASE_DIR, JRUBY_JARS_GLOB)].each {|file| checksums file }

  Dir[File.join(RELEASE_DIR, JRUBY_EXE_GLOB)].each {|file| checksums file }
end

# Assume there will only be one release performed after a clean so
# we don't have multiple artifacts in target.
def jruby_version
  Dir[File.join(DIST_FILES_DIR, "jruby-dist-*.zip")].each do |f|
    return $1 if f =~ /jruby-dist-(.*)-bin.zip/
  end
  raise ArgumentError "mvn release:prepare has not been run"
end