File: release.rake

package info (click to toggle)
jruby 9.4.8.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 89,244 kB
  • sloc: ruby: 548,574; java: 276,189; yacc: 25,873; ansic: 6,178; xml: 6,111; sh: 1,855; sed: 94; makefile: 78; jsp: 48; tcl: 40; exp: 12
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