xref: /JGit/tools/maven-central/download.rb (revision f2bfaca08484b5547448640a01bf69f4f1176b17)
1#!/usr/bin/env ruby
2version = ARGV[0].freeze
3if version =~ /\A(\d+\.\d+\.\d+)\.(\d{12})-(m\d|rc\d|r)\Z/
4   printf "version %s qualifier %s classifier %s\n", $1, $2, $3
5else
6   printf "invalid version %s\n", version
7   abort
8end
9
10group = 'org.eclipse.jgit'
11artifacts = [group,
12             group + '.ant',
13             group + '.archive',
14             group + '.gpg.bc',
15             group + '.http.apache',
16             group + '.http.server',
17             group + '.junit',
18             group + '.junit.http',
19             group + '.junit.ssh',
20             group + '.lfs',
21             group + '.lfs.server',
22             group + '.pgm',
23             group + '.ssh.apache',
24             group + '.ssh.jsch',
25             group + '.ui']
26
27puts 'Deleting current files'
28`rm -fr *.jar *.sh *.pom`
29
30puts 'Downloading org.eclipse.jgit-parent'
31`curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{group}-parent/#{version}/#{group}-parent-#{version}.pom -o #{group}-parent-#{version}.pom`
32
33artifacts.each {|artifact|
34  puts "Downloading #{artifact}-#{version}.jar"
35  `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}.jar -o #{artifact}-#{version}.jar`
36  `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}.pom -o #{artifact}-#{version}.pom`
37  `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}-javadoc.jar -o #{artifact}-#{version}-javadoc.jar`
38  `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}-sources.jar -o #{artifact}-#{version}-sources.jar`
39}
40
41puts "Downloading org.eclipse.jgit.pgm-#{version}.sh"
42`curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{group}.pgm/#{version}/#{group}.pgm-#{version}.sh -o #{group}.pgm-#{version}.sh`
43